[Lazarus] unit on relative path is not recompile

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Sep 30 21:57:45 CEST 2013


On Mon, 30 Sep 2013 22:34:14 +0300
patspiper <patspiper at gmail.com> wrote:

>[...]
> General guidelines:
> - The project/package directory is implicitly added to the Other unit 
> files (-Fu) of that project/package.

yes

> - Always add the directories of added units to the project/package to 
> the Other unit files (-Fu) of that project/package. The IDE will prompt 
> the user in such cases.

yes, with exception: If a directory is used only on one platform you can
use macros and/or conditionals.


> - A dot (.) can be used to add the project/package folder to the 
> 'Include Files' or other path setting.

Let me rephrase this:
A dot (.) in the Usage / Include Path can be used to add the package
folder to depending projects/packages.


> - There is no need to add lfm files to projects/packages.

yes, since 1.3

> - Never add a unit to several packages.

Yes, with exception: If you have two packages that are never used in
the same project then you can do that.

> - Never add a unit to a package and a project.

Yes.

> - ToDo: sharing of folders between packages

A package is basically a shared directory plus information how to
share it.
So to share a folder between packages, you add the files to a package.

 
> What triggers automatic recompilation of a project/package:
> - Modifying units added to the project/package.
> - Modifying  include files included in units added to the 
> project/package, provided they are located in the 'Include Files' 
> folders (-Fi).
> - ToDo: Changing project options

Changes of project options trigger rebuilds too.

 
> What does not trigger automatic recompilation of a project/package:
> - Modifying units not added to the project/package, even if they are 
> located in the 'Other Unit Files' folders.

yes.


> - Modifying include files included in units added to the project/package 
> but that are not located in the 'Include Files' folders (-Fi).

yes

> - Modifying lfm files without a corresponding pas file modification.

The IDE triggers the build, but the compiler does not compile the unit.


> - Modifying res files.

Yes.

 
> Note: Modification is a change of file timestamp.
> 
> 
> What triggers automatic reloading of files in the IDE:

If you mean the "file changed on disk dialog": 
It checks the open files. For example the files of the source editor and
the open lpi, lpk, lpr and lfm files.
The IDE has more files open, but they are silently reloaded.

> - Modifying units added to the project/package.

no

> - Modifying  include files included in units added to the 
> project/package, irrespective if they are located in the 'Include Files' 
> folders (-Fi) or not

no

> - Modifying lfm files with or without a corresponding pas file modification.

no

> - Modifying the project/package main file.

yes

 
> What does not trigger automatic reloading of files in the IDE:
> - Modifying units not added to the project/package, even if they are 
> located in the 'Other Unit Files' folders.
> 
> Note: Modification is a change of file timestamp (unless a special IDE 
> option is set).

The above dialog and the rebuild-needed-checks are independent.

Mattias




More information about the Lazarus mailing list