Sign in Join
Wiki copytemporary

Lazarus Delphi Compiler Tool: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Lazarus Delphi Compiler Tool

OldNewLine
1+## Synopsis
2+
3+The Lazarus Delphi tool allows you to compile with the Delphi compiler instead of the FPC compiler.
4+
5+It defines a message parser which will allow you to click on a compiler message and be taken to the correct location in the sources. The filenames in compiler output can be converted from windows to unix notation, taking into account the Wine emulator drive configuration.
6+
7+It also allows to write a configuration file based on the FPC compiler options: Whenever the project is compiled, it writes a configuration file usable for the Delphi compiler, which you can include in the compiler command. The file has the same name as the **.lpi** file, with adifferent extension (configurable, default **.conf**).
8+
9+## Installation
10+
11+The package file **components/compilers/delphi/lazdelphi.lpk** needs to be installed.
12+
13+## Usage
14+
15+The package defines 4 macros:
16+
17+DCC
18+The delphi compiler executable path, as set in the global settings.
19+
20+DCCCONFIG
21+If the 'Generate compiler configuration' settting is checked, this contains the generated delphi compiler configuration file, prepended with @.
22+
23+If the setting is not set, the macro will be empty.
24+
25+DCCARGS
26+The combined values of the global and project 'Extra compiler arguments' settings.
27+
28+DCCCOMPILE
29+This is equivalent to **\$(DCC) \$(DCCCONFIG) \$(DCCARGS)**.
30+
31+These can be used in the pre compiler command: Here you must do 3 things;
32+
33+- specify the macro you wish in the *Execute before* command
34+- Select the 'Delphi compiler' parser in the *Execute before* command
35+- Disable calling the compiler
36+
37+A sample is visible in the following image
38+
39+<figure>
40+<img src="delphicompilercommands.png" title="delphicompilercommands.png" />
41+<figcaption>delphicompilercommands.png</figcaption>
42+</figure>
43+
44+## Global Settings
45+
46+The following things can be set in the **Tools -- Options** menu:
47+
48+- **Delphi compiler executable** - the path to the delphi compiler.
49+- **Configuration file extension** - the extension of the configuration file.
50+- **Map filenames from Windows to Unit notation** on unix-like options, when set, any filenames in compiler output will be converted from Windows to Unix notation.
51+- **Additional compiler options** - use this to specify delphi command-line options common to all Delphi projects, for example the location of the linker or the library path.
52+
53+<figure>
54+<img src="idedelphisettings.png" title="idedelphisettings.png" />
55+<figcaption>idedelphisettings.png</figcaption>
56+</figure>
57+
58+## Project settings
59+
60+The following things can be set in the **Project options** menu:
61+
62+- **Generate Delphi config file based on FPC compiler options** as the name says, when checked a configuration file will be generated for the project whenever it is compiled.
63+- **Additional compiler options** - use this to specify delphi command-line options specific to the current project.
64+
65+<figure>
66+<img src="projectdelphioptions.png" title="projectdelphioptions.png" />
67+<figcaption>projectdelphioptions.png</figcaption>
68+</figure>
69+
70+---
71+*From the Free Pascal wiki, page "Lazarus Delphi Compiler Tool", as it stood on 2023-05-15 after a change by Michael, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history