Difference between revisions of "IDE Window: Compiler Options/de"

From Lazarus wiki
Jump to navigationJump to search
Line 83: Line 83:
 
* Das Vorgabe- widget set des aktuellen Projekts hängt vom gegenwärtigen Betriebssystem ab. Zum Beispiel: win32 für Windows 2000.
 
* Das Vorgabe- widget set des aktuellen Projekts hängt vom gegenwärtigen Betriebssystem ab. Zum Beispiel: win32 für 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.
 
* 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.
 +
 +
== Build modes ==
 +
 +
Only projects have this page. A package does not have this page.
 +
 +
Build modes allows to define '''sets of compiler options''' and to quickly change between these sets. For example you can define a ''mode'' for debugging which compiles your project with range checking, while your default mode does not.
 +
 +
Note: If you want to pass some options depending on the platform, for exampe passing some extra linker options under OS X, please take a look at the [[#Build_Macros|page Build Macros]].
 +
 +
The first grid on the page contains the list of build modes with three columns.
 +
 +
The first column shows which mode is currently active. When you activate another mode, all compiler options pages will load the settings of the new mode, including the macro values on the build modes page. There is always only one mode active and you can only edit the properties of one mode at a time.
 +
 +
The second column shows where each mode is saved. Either in the project file (lpi) or the project session file (lps). Of course this has only an effect, if the project session is stored separate (see Project options / Session / Save session info in). If the session is stored in the lpi file all modes are stored in the lpi file.
 +
 +
 +
For more details about build modes see [[Build modes]].
 +
 +
For more details about build macros and conditionals see [[Macros and Conditionals]].
 +
 +
''Build modes'' exists since 0.9.29.
  
 
== Parsen ==
 
== Parsen ==

Revision as of 17:31, 18 October 2010

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

Pfade

Other Unit Files

  • Relative Pfade werden mit dem Projekt- oder Package-Verzeichnis (wo die .lpi/.lpk Datei ist) erweitert .
  • Diese Pfade werden zu den Suchpfaden hinzugefügt.
  • Wenn ein Package oder Projekt ein Package verwendet, bindet es auch die zugehörigen Suchpfade ein. Sie können die geerbten Suchpfade sehen auf der #Vererbt Seite.
  • Wenn Sie das Lazarus Package-System verwenden, müssen Sie nur höchst selten Suchpfade per Hand eingeben.
  • Der FreePascal Compiler hat eine eigene Konfigurationsdatei (Vorgabe: /etc/fpc.cfg), welche eine Reihe von Suchpfaden definiert. Zum Beispiel um die FPC Units der RTL oder FCL wie 'classes', 'sysutils' zu finden.
  • Suchpfade werden durch ein Semikolon ';' getrennt.
  • Führende und trailing Leerzeichen werden von der IDE ignoriert und automatisch entfernt. Die IDE normalisiert die Suchpfade und fügt das Pfadbegrenzungszeichen hinzu (Windows: /, alle anderen: \). Suchpfade werden automatisch für das aktuelle Betriebssystem konvertiert, wenn eine .lpi oder .lpk Datei geöffnet wird.
  • Sie können Makros verwenden. Zum Beispiel $(TargetCPU). Siehe IDE Macros in paths and filenames.
  • If you do not want to use a search path inherited from a used package you must change the compiler options of the used package.

Andere Unitdateien

Dies ist der Suchpfad für die Pascal Units (.ppu, .pp, .pas, .p) des Projekts oder Packages. Schauen sie auf den Fenstertitel, um zu erfahren welches (aktiv ist). Dieser Pfad wird an den FreePascal Compiler übergeben, welcher ihn zu seinem Unit-Pfad hinzufügt.

  • Das Hinzufügen und Entfernen von Units zum Projekt/Package führt zu einer automatischen Nachfrage, ob der Unit-Pfad angepasst werden soll.
  • Dieser Suchpfad enthält die Verzeichnisse ihres Projekts (oder Packages), welche die .pas, .pp oder .p Dateien enthalten.
  • VORSICHT: Fügen sie keine Verzeichnisse von verwendeten Lazarus-Packages zu diesem Pfad hinzu. Andernfalls wird FPC die .ppu des Packages neu erstellen und sie in ihrem Projektverzeichnis ablegen. Dies führt zu mehrfachen .ppu Versionen und sie werden seltsame 'Can not find unit' Fehler erhalten.

Zum Beispiel: Fügen sie keine FPC oder LCL Quellverzeichnisse zu diesem Suchpfad hinzu.

  • If you want to share some units between your projects, create a package for them. Es ist einfach.

Include-Dateien

Dies ist der Suchpfad für die Include-Dateien (z.B. .inc oder .lrs Dateien). Dieser Pfad wird an den FreePascal Compiler gegeben, welcher ihn zu seinem Include-Pfad hinzufügt, der von den Include-Direktiven wie {$I filename.inc} oder {$INCLUDE filename.inc} verwendet wird.

Andere Quellen

Dies ist der Suchpfad für Pascal Unit-Quellen, der nur von der IDE verwendet wird und nicht vom Compiler.

Beispiel: Sie haben ein Verzeichnis mit Quellen und ein Verzeichnis mit den dazugehörigen .ppu Dateien. Sie fügen das .ppu Verzeichnis zum 'Andere Unitdateien' Pfad hinzu und das .pas Verzeichnis zum 'Andere Quellen' Pfad. Auf diese Weise wird der Compiler die .ppu Dateien verwenden und nicht versuchen, sie jedesmal neu zu erstellen. Und die IDE wird die Quellen finden und Find Declaration funktioniert.

Bibliotheken

Dies ist der Suchpfad für Bibliotheken (.dll oder .so oder .a Dateien).

Unit-Ausgabeverzeichnis

Dies ist das Verzeichnis, in dem der Compiler alle Ausgabedateien (Compilerschalter -FU) wie .ppu, .o oder .rst Dateien ablegt. 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. Zum Beispiel:

 units/$(TargetCPU)-$(TargetOS)

Anmerkungen:

  • 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.

Zieldateiname

Anmerkung: Dies existiert nur für Projekte, nicht für Packages.

Set here the filename of the generated executable. If the file is relative it will be expanded with the project directory (where the .lpi file is). If no file is given the executable is put into the unit output directory and has the name of the main source file name (usually the .lpr file) without the extension. If no extension is given, the default extension for the platform is added (e.g. .exe for MS Windows, none for others). When a new project was not yet saved and is built the IDE saves the files to the test directory. The relative files are then relative to this directory.

Lazarus passes the compiler switch

  • -o to define the target file name.
  • -FE if the target file name is not in the project directory (where the lpi file is)
  • -FU if the unit output directory is not empty

If the target file name is in another directory (not the directory of the .lpi file), Lazarus will pass the -FE switch to the compiler to make sure that the secondary files, like .o and .rst are put into the same directory. If you cleared the unit output directory then the IDE will not pass the -FU switch and the compiler will generate the .ppu/.o files of the units in the target directory too.

If you cleared the unit output directory and your project target file is in the project directory, then neither -FU nor -FE is passed to the compiler and the compiler will work Delphi compatible and generate the .ppu/.o file of each unit in the same directory as the unit.

Zusätzlicher Debuggerpfad

Diese Verzeichnisse werden zum Suchpfad des IDE-Debuggers hinzugefügt, wenn er nach Quelldateien sucht (Units und Include Dateien).

LCL-Schnittstelle

Dies ist das verwendete LCL widget set. Normalerweise wird das Vorgabe- widget set verwendet. Wenn sie ein anderes probieren wollen oder you are cross compiling, stellen sie hier ein anderes widget set ein.

  • Das Vorgabe- widget set eines Packages ist das widget set des aktuellen Projekts.
  • Das Vorgabe- widget set des aktuellen Projekts hängt vom gegenwärtigen Betriebssystem ab. Zum Beispiel: win32 für 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.

Build modes

Only projects have this page. A package does not have this page.

Build modes allows to define sets of compiler options and to quickly change between these sets. For example you can define a mode for debugging which compiles your project with range checking, while your default mode does not.

Note: If you want to pass some options depending on the platform, for exampe passing some extra linker options under OS X, please take a look at the page Build Macros.

The first grid on the page contains the list of build modes with three columns.

The first column shows which mode is currently active. When you activate another mode, all compiler options pages will load the settings of the new mode, including the macro values on the build modes page. There is always only one mode active and you can only edit the properties of one mode at a time.

The second column shows where each mode is saved. Either in the project file (lpi) or the project session file (lps). Of course this has only an effect, if the project session is stored separate (see Project options / Session / Save session info in). If the session is stored in the lpi file all modes are stored in the lpi file.


For more details about build modes see Build modes.

For more details about build macros and conditionals see Macros and Conditionals.

Build modes exists since 0.9.29.

Parsen

Siehe Free Pascal - Onlinedokumentation

Syntax mode

Wählen sie hier den Vorgabemodus. Wenn eine Unit keine {$mode irgendeinmodus} Direktive enthält, wird dies als Vorgabe verwendet.

Siehe Free Pascal - Online documentation

Syntaxeinstellungen

  • C-artige Operatoren (*=, +=, /= und -=)
  • Assertionen verwenden
  • LABEL und GOTO zulassen
  • C++-artige Inlineanweisungen
  • C-artige Makros (global)
  • TP/BP 7.0 kompatibel
  • Name des Konstruktors muß 'init' sein (Destruktor muß 'done' heißen)
  • 'static'-Schlüsselwort in Objekten
  • Ansi-Strings verwenden

Assembler-Stil

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

Quelltext

Siehe Free Pascal - Onlinedokumentation

Linken

Siehe Free Pascal - Onlinedokumentation

Ausführlichkeit

Meldungen

Siehe Free Pascal - Onlinedokumentation Note that adding a lot of verbosity slows down the parsing of the compiler out much, sogar wenn die meisten Nachrichten im Nachrichtenfenster verborgen werden.

Andere

Siehe Free Pascal - Onlinedokumentation

Build Macros

This page allows to define your project/package specific macros and conditionals. The IDE already provides a lot of macros. You can add your own macros that are valid when the project/package is loaded.

Conditionals allow to set macro values depending on target platform and other macros. For example you can add a linker option when compiling for Mac OS X.

Use the left + button to add a new macro for the project/package. Select a macro and click on the middle + button to add a new possible value. The actual value of a macro is set in the conditionals below, or by the current project on the build modes page (IDE menu / Project / Project Options / Compiler options / Build Modes). To delete a value or a macro, select it and click on the - button.

The conditionals use a scripting language similar to pascal and are edited in the text editor at the bottom of the page. Many short cuts work like in the source editor, including word/identifier completion.

For more details about build macros and conditionals see Macros and Conditionals.

Compileroptions buildmacros1.png

Build macros and conditionals exist since 0.9.29.

Vererbt

Diese Seite zeigt alle Compilereinstellungen, die von Packages geerbt wurden. Packages erben Optionen 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.

Kompilierung

Makedatei erzeugen

Aktivieren sie es, wenn die IDE vor jedem Erstellen ein Makefile und eine Makefile.fpc erzeugen soll. Dies wird gegenwärtig nur für Packages unterstützt, nicht für Projekte.

Vorher ausführen

Richten sie hier einen Befehl ein, der vor dem Starten des Compilers ausgeführt wird.

Aufruf an:

  • Kompilieren - ausführen bei normalem Kompilieren (F9).
  • Erstellen - ausführen wenn alles neu erstellt wird. This could for example a script to clean up.
  • Start - ausführen bei schnellem Kompilieren. Wenn ein Projekt gestarted wird, prüft die IDE, ob eine Neuerstellung notwendig ist. Wenn keine Neuerstellung motwendig ist, überspringt die IDE den Kompilierungsschritt. Setzen sie diese Option, um den Befehl immer auszuführen, sogar wenn der Kompilierungsschritt übersprungen wird.

Die IDE kann den Output des Befehlsndos analysieren und filtern und bei Fehlern stoppen. Aktivieren sie die Einstellungen, welche Meldungen die IDE überwachen soll.

Compiler

Dies ist der Compiler-Pfad, der vom Projekt oder Package verwendet wird. Voreinstellung ist das Makro $(CompPath), welches durch den Compiler Dateinamen in den Umgebungseinstellungen ersetzt wird.

Nachher ausführen

Richten sie hier einen Befehl ein, der nach dem Starten des Compilers ausgeführt wird. Siehe oben 'Vorher ausführen' für Details.

Buttons

Hilfe

Ruft die englische Version dieser Seite auf.

Einstellungen anzeigen

Öffnet einen Dialog, der die aktuellen Kommandozeilenparameter anzeigt.

Test

Dies wird verschiedene Tests starten, um übliche Konfigurationsfehler zu finden. Bei FPC 2.2.0 wird vor einigen doppelten Units gewarnt. Die Warnungen sind korrekt. Aber sie können diese ignorieren, wenn sie die betroffenen Units nicht verwenden.

Laden/Speichern

Öffnet einen Dialog zum speichern/öffnen der aktuellen Compilereinstellungen in/aus einer XML Datei.

OK

Wendet die Änderungen an und beendet den Dialog.

Abbrechen

Macht alle Änderungen rückgängig und beendet den Dialog.