Recent

Author Topic: Automatically compiling dependencies  (Read 546 times)

440bx

  • Hero Member
  • *****
  • Posts: 5478
Automatically compiling dependencies
« on: May 21, 2025, 02:20:48 am »
Hello,

if a program, say "ProgramA" needs "DllB", both written in FPC, is there a way to have Lazarus recompile "DllB" automatically when compiling/building "ProgramA" if it notices that the source of "DllB" has been changed since the last time "DllB" was built ?

Thank you for your help.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v4.0rc3) on Windows 7 SP1 64bit.

ASBzone

  • Hero Member
  • *****
  • Posts: 724
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Automatically compiling dependencies
« Reply #1 on: May 21, 2025, 04:01:55 am »
But it's just a regular program and not a package, right?
-ASB: https://www.BrainWaveCC.com/

Lazarus v4.1.0.0 (c067bd336e) / FreePascal v3.2.3-1411-g8c665e3128 (aka fixes)
(Windows 64-bit install w/Win32 and Linux on ARM and x64 cross-compilers via FpcUpDeluxe)

My Systems: Windows 10/11 Pro x64 (Current)

440bx

  • Hero Member
  • *****
  • Posts: 5478
Re: Automatically compiling dependencies
« Reply #2 on: May 21, 2025, 04:10:36 am »
But it's just a regular program and not a package, right?
Hello, ASBzone,

Yes/correct.  Just a regular program.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v4.0rc3) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8431
Re: Automatically compiling dependencies
« Reply #3 on: May 21, 2025, 03:04:01 pm »
if a program, say "ProgramA" needs "DllB", both written in FPC, is there a way to have Lazarus recompile "DllB" automatically when compiling/building "ProgramA" if it notices that the source of "DllB" has been changed since the last time "DllB" was built ?

Write a makefile for either fpc or lazbuild as appropriate, or investigate the feasibility of a patch for Lazarus Project Groups.

My rationale for suggesting the latter is based on the assumption that a "quick compile" can be used to determine efficiently how much work needs to be done.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

n7800

  • Sr. Member
  • ****
  • Posts: 368
Re: Automatically compiling dependencies
« Reply #4 on: May 22, 2025, 02:20:43 am »
Yes, maybe the LazProjectGroups package should help you (I haven't used it).

An alternative is to use the "Compiler Commands" settings in the Project Options. There you can specify any command line to run before/after compilation (i.e. "hooks"). You can put a lazbuild call there for build your dependent project. The output of this command should also show up in the Messages window.

A last resort is to write a script that builds all dependent projects in the desired sequence. This script can be called directly from the IDE in the menu or with a hotkey if you use External Tools (menu Tools > Configure External Tools).

440bx

  • Hero Member
  • *****
  • Posts: 5478
Re: Automatically compiling dependencies
« Reply #5 on: May 22, 2025, 02:24:03 am »
@n7800,

I'll be giving your suggestions a try soon.  Thank you for pointing them out.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v4.0rc3) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018