[fpc-devel] Concerning compile options behavior

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Jan 29 10:01:39 CET 2012


Gennadiy Poryev wrote:
> Hi, all.
> 
> (Question 1)
> My library extensively uses $I directive to separate various aspects of a single unit, such that its source code looks like this:
> 
> Unit myunit;
> interface
> {$I myunit\branch_alpha.inc}
> {$I myunit\branch_beta.inc}
> {$I myunit\branch_gamma.inc}
> { etc … }
> implementation
> end.
> 
> This being so because each of the include file is quite large and need cross-references to-from the others, while all of them being essentially about the same subject.
> What I’ve found is that if I change one of the INCs, the unit does not get rebuilt regardless of the “-B” option (and when Lazarus says “Options changed, recompiling clean with -B”) and Lazarus’ own setting about “Always build even if nothing changed”.
> It is only getting rebuilt if I physically delete corresponding *.a, *.o and *.ppu prior to building. I surmise the underlying cause to be checking the last edit timestamp of the main unit file only, not every include that happen along its way.
> Does it qualify as a bug or is it “by design” ?
> 
> (Question 2)
> The same library source tree uses some subdirectories, so that each time I start a project using it, I have to manually include every subdir with its *.pas files into “-Fu” option, because the library sources are also being added and/or modified with each new project.  As the library grows, this is starting to be discomforting. May be I’m just not educated enough in the ways of FPC and missing some obvious functionality, but would it not be nice if we have “Add <x> to unit path recursively” option (such as -Fx) ? That way I can only specify lib’s root directory and not care about how much subdirs it has.
> 
> Thanks in advance,
> 
> // Gennadiy.
> 
> p.s. sorry for repost, I had an impression that my first message vanished into thin air.

This could be more appropriate in the fpc-pascal or lazarus mailing lists.

Another situation in which automatic rebuild fails is when Lazarus 
renames units, some of which are in a subdirectory. Hopefully somebody 
will be able to enlighten us, but I suspect that neither include files 
nor full path details are stored.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list