Command-Line Interfaces of Clang-enhanced C++ Compilers
Go Up to Command-Line Interfaces of 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.
Contents
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
or:
<compiler> -tWCV myApplication.cpp
In this case, Clang-enhanced C++ compilers run with the following command-line parameters enabled by default:
-fborland-extensions
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
Switch | Description |
---|---|
--warn-common
|
Warn about duplicate common symbols. |
--warn-unresolved-symbols
|
Report unresolved symbols as warnings. |
--error-unresolved-symbols
|
Report unresolved symbols as errors. |
#include Paths and Lookup
Clang-enhanced C++ compilers support three different header/source paths:
-isystem
is for system headers included with the compiler. Warnings for headers found on this path are suppressed.-I
is for headers provided by third parties.-idirafter
is for paths searched after paths specified via-I
or-isystem
have been searched. If the path has a leading '=' character, this character is replaced with the value specified via-sysroot
.-iquote
is for your own source files and headers. As the name suggests, this path is used only for directives with quotes:#include "file"
. If the namedfile
is not found, then the paths specified by-I
and-isystem
are searched, as if the directive was#include <file>
.
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:
Command | Description |
---|---|
|
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 --jobs=0
.
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:
bcc64 --help
Use the -cc1
and --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.