Command-Line Interfaces of Clang-enhanced C++ Compilers
Command-line interfaces for Clang-enhanced C++ compilers are very similar one to another. This topic provides information that applies to all of them.
- 1 Command-Line Options of Clang-enhanced C++ Compilers
- 2 #include Paths and Lookup
- 3 Linking with the Delphi Run-Time System
- 4 Using Parallel Compilation
- 5 Displaying the Compiler Help
- 6 Generating Dependency Information
- 7 Topics
- 8 See Also
Command-Line Options of Clang-enhanced C++ Compilers
Clang-enhanced compilers are very similar to one another, and they share most of their command-line options. A subset of the features of Clang have been integrated into RAD Studio, and some of these are available on the Project Options dialog box.
Executing at the Command Line
For anyone who calls Clang-enhanced C++ compilers at the command line, we recommend going through the driver, as follows:
<compiler> -c test.cpp
<compiler> -tWCV myApplication.cpp
In this case, Clang-enhanced C++ compilers run with the following command-line parameters enabled by default:
If you are an experienced user of Clang and you want to use the Clang-enhanced C++ compilers without going through the driver, you should pass
-cc1 as the first option, telling the compiler that you are taking matters in your hands and want to have total/strict control on all options. In this case, no option is automatically injected for you, and you would need to specify the command-line parameters above manually.
Error Reporting Options
||Warn about duplicate common symbols.|
||Report unresolved symbols as warnings.|
||Report unresolved symbols as errors.|
#include Paths and Lookup
Clang-enhanced C++ compilers support three different header/source paths:
-isystemis for system headers included with the compiler. Warnings for headers found on this path are suppressed.
-Iis for headers provided by third parties.
-idirafteris for paths searched after paths specified via
-isystemhave been searched. If the path has a leading '=' character, this character is replaced with the value specified via
-iquoteis for your own source files and headers. As the name suggests, this path is used only for directives with quotes:
#include "file". If the named
fileis not found, then the paths specified by
-isystemare searched, as if the directive was
For more information, see #include.
Linking with the Delphi Run-Time System
By default, if you do not specify a target using the
-t command-line switch, Clang-enhanced C++ compilers link with the Delphi run-time system. For example, using BCCAARM.EXE:
BCCAARM builds your application as a console application that links with the Delphi run-time system.
BCCAARM builds your application as a console application that does not link with the Delphi run-time system.
BCCAARM builds your application as a FireMonkey application.
Using Parallel Compilation
To enable parallel compilation on the command line, use the
--jobs=<N> command-line option.
To specify the number of subprocesses to use, append a number to the command-line option. For example, to use 2 subprocesses, use
--jobs=2. You should not choose a number of subprocesses higher than the number of cores of your processor.
To use as many subprocesses as possible, use
Parallel compilation is not compatible with the following command-line options:
Displaying the Compiler Help
Execute the command-line interface executable of the target compiler with the
--help switch to display the command-line interface help. For example:
--help switches to display the switches that you can pass to the compiler using the command-line interface. For example:
bcc64 -cc1 --help
Generating Dependency Information
By default, the command-line interface of Clang-enhanced C++ compilers uses the
-sys-header-deps command-line option to generate full dependency information, including the system header files.