IDE Window: Compiler Options

From Lazarus wiki
Revision as of 17:39, 30 April 2006 by Mattias2 (talk | contribs) (→‎Paths)
Jump to navigationJump to search

Paths

  • Relative paths are expanded with the project or package directory (where .lpi/.lpk file is).
  • These paths are added to the search paths.
  • There is no way to remove a path from the search paths
  • If a package or project uses a package, it will inherited the usage search paths. You can see the inherited search paths in the #Inherited page.
  • Using the Lazarus package system, you hardly need to set search paths manually.
  • The FreePascal Compiler has a configuration file of its own (default /etc/fpc.cfg) which defines a set of search paths. For example to find the FPC units of the RTL or the FCL like 'classes', 'sysutils'.
  • Search paths are separated by semicolon ';'.
  • Heading and trailing spaces are ignored.
  • You can use macros. For example $(TargetCPU). See IDE Macros in paths and filenames.

Other Unit Files

This is the search path for the pascal units (.ppu, .pp, .pas, .p) of the project or package. See the title of the window to know which. This path is given to the FreePascal Compiler, which adds it to its Unit Path.

  • Adding and removing units to the project/package will automatically adjust the unit path.
  • BEWARE: if a package uses a separate output directory for its .ppu files, do not add the source directories to this path. Otherwise FPC will rebuild the .ppu of the package and put them into your project directory. You will end up with multiple .ppu versions and you will get strange 'Can not find unit' errors.

For example: Do not add any FPC or Lazarus source (.pas or .pp) directory to this search path.

Include Files

This is the search path for the include files (e.g. .inc, .lrs files). This path is given to the FreePascal Compiler, which adds it to its Include Path, which is used by include directives like {$I filename.inc} or {$INCLUDE filename.inc}.

Other sources

This is the search path for pascal unit sources, that is only used by the IDE and not by the compiler.

Example: You have a directory with sources and a directory with the corresponding .ppu files. You add the .ppu directory to the 'Other Unit Files' path and the .pas directory to the 'Other sources' path. This way the compiler will use the .ppu files and not try to rebuild them everytime. And the IDE will find the sources and Find Declaration works.


Libraries

This is the search path for libraries (.dll or .so or .a files).

Unit output directory

This is directory, where the compiler will put all output, like .ppu, .o, .rst files.

Note: Packages normally inherited their output directory via the 'usage' options.

= Debugger path addition

These directories are added to the search path of the IDE debugger, when it searches for sources (units and include files).

Parsing

Code

Linking

Messages

Other

Inherited