IDE Window: Compiler Options/es

From Free Pascal wiki
Revision as of 19:03, 23 August 2010 by Iskraelectrica (talk | contribs) (New page: {{IDE Window: Compiler Options}}Rcategory:Español =La ventana de opciones del compilador= == Rutas == * Las rutas relativas se completan con la ruta del proye...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) русский (ru)

La ventana de opciones del compilador

Rutas

  • Las rutas relativas se completan con la ruta del proyecto o paquete, el directorio donde están os archivos .lpi/.lpk).
  • Estas rutas se añaden a las rutas de búsqueda.
  • Si un paquete hace uso de otro paquete, heredará sus rutas de búsqueda. Puedes ver las rutas de búsqueda heredadas en la pestaña Heredado.
  • Usando el sistema de paquetes Lazarus, apenas necesitaras establecer rutas de búsqueda manualmente.
  • El compilador Free Pascal tiene un archivo de configuración de propio (/etc/fpc.cfg, es el predeterminado) que define un conjunto de rutas de búsqueda a los archivos .ppu de FPC. Por ejemplo para hallar las unidades de FPC de la RTL o del FCL como 'classes' o 'sysutils'.
  • Las rutas de búsqueda están separadas por punto y coma ';'.
  • Los espacios iniciales o finales son ignorados y eliminados automáticamente por el IDE. El IDE normaliza las rutas y añade el delimitador de ruta (windows: /, otros: \). Las rutas son automáticamente convertidas para el sistema operativo actual al abrir un archivo .lpi o .lpk.
  • Puedes utilizar macros. Por ejemplo $(TargetCPU). Ver Macros del IDE en rutas y nombres de archivo.
  • Si no quieres utilizar rutas de búsqueda heredadas de un paquete hay que cambiar las opciones de compilación de ese paquete.

Otros archivos de unidad

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 ask to adjust the unit path.
  • This search path contains the directories of your project (or your package) that contain the .pas, .pp or .p files.
  • BEWARE: Do not add directories of used lazarus packages to this path. Otherwise FPC will rebuild the .ppu files 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.

Por ejemplo: Do not add any FPC or LCL source directory to this search path.

  • If you want to share some units between your projects, create a package for them. It's easy.

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. Normally you will leave this empty. It is only useful when you build the ppu files without Lazarus.

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 every time. 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 (compiler switch -FU), like .ppu, .o, .rst files. If using $R directive for the lfm files, it will also copy the lfm files there.

A popular usage example, is a output directory named units, and then an extra sub-directory for the CPU and OS target. Por ejemplo:

 units/$(TargetCPU)-$(TargetOS)

Notes:

  • If the unit output directory is empty, Lazarus will not pass the -FU switch to the compiler. The compiler will then use the -FE switch. See Project target file
  • Packages normally inherit their output directory to other packages via the 'usage' options. You do not need to add package paths manually to your project.

Debugger path addition

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

LCL widget type

This is the used LCL widget set. Normally the default widget set is used. If you want to try another or you are cross compiling, set here another widget set.

  • The default widget set of a package is the widget set of the current project.
  • The default widget set of the current project depends on the current operating system. Por ejemplo: win32 for windows 2000.
  • You should not set the widget set for a package, because then the project can not override it. Only set it, if the package is part of a set of packages - one for each widget set.

Parsing

See Free Pascal - Online documentation

Syntax mode

Choose the default mode. If a unit does not contain a {$mode somemode} directive, this is used as the default.

See Free Pascal - Online documentation


Syntax Options

  • C Style Operators (*=, +=, /= and -=)
  • Include Assertion Code
  • Allow LABEL and GOTO
  • C++ Styled INLINE
  • C Style Macros (global)
  • Constructor name must be init (destructor must be done)
  • Static Keyword in Objects
  • Use Ansi Strings

Assembler style

  • -R<x> assembler reading style:
  • -Rdefault use default assembler
  • -Ratt read AT&T style assembler
  • -Rintel read Intel style assembler

Code

See Free Pascal - Online documentation

Linking

See Free Pascal - Online documentation

Verbosity (Messages)

See Free Pascal - Online documentation. Note that adding a lot of verbosity slows down the parsing of the compiler output much, even if most of the messages will be hidden in the messages view.

The page has been renamed to Verbosity, starting from 0.9.27 version.

Messages

(Introduced in Lazarus 0.9.27 version) The page allows to control what compiler output Notes, Hints and Warnings are shown. The feature requires FP compiler to support -m switch (version 2.2.2 or higher).

It's also possible to specify message Language file (file should be Utf-8 encoded), to see compiler messages translated, without need to modify fpc.cfg file.

Samples of the messages translation file can be found at ${LazarusDir}/fpc/${FPCTARGET}/msg, i.e. C:\Lazarus\fpc\2.2.3\msg

Other

See Free Pascal - Online documentation

Inherited

This page shows all the compiler options inherited from packages. Packages inherit options via their 'usage' options.

The topmost node shows all inherited options, that is the sum of all used packages.

The nodes below show the inherited options of each use package.

Compilation

Create Makefile

Enable this, if the IDE should create a Makefile and a Makefile.fpc before each build. This is currently only supported for packages, not for projects.

Execute before

Setup here a command to execute before running the compiler.

Call on:

  • Compile - execute when normally compiling (F9).
  • Build - execute when rebuilding all. This could Por ejemplo a script to clean up.
  • Run - execute when quick compiling. When running a project, the IDE checks if rebuild is needed. If no rebuild is needed the IDE skips the compile step. Set this option to always execute the command, even if the compile step is skipped.

The IDE can parse and filter the output of the command and stop on errors. Check the boxes for which messages the IDE should watch.

Compiler

This is compiler path used by the project or package. Default is the macro $(CompPath), which is replaced with the compiler filename in the environment options.

Execute after

Setup here a command to execute after running the compiler. See above 'Execute before' for details.

Use these settings as default for new projects

Check this checkbox and click Ok. The settings will be saved to ~/.lazarus/compileroptions.xml (or whatever you have as primary config path). When you create a new project this file will be loaded to initialize the compiler options. This feature exists since 0.9.29.

Buttons

Test

This will run various test and detects common configurations mistakes. For fpc 2.2.0 it will warn about some double units. The warnings are correct, but you can ignore them, if you don't use these units.

Show Options

Opens a dialog and presents the current command line parameters.

Load/Save

Opens a dialog to save and/or load the current compiler options from/to a xml file.

Ok

This will apply the changes and then exit the dialog.

Cancel

This will undo all changes and exits the dialog.