[fpc-devel] Concerning compile options behavior

Gennadiy Poryev core at barvinok.net
Fri Jan 20 11:54:05 CET 2012


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20120120/d17e235b/attachment.html>


More information about the fpc-devel mailing list