The cpp module contains the properties and rules for toolchains of the C/C++ family. On OS X this includes support for Objective-C/C++.
Type: | bool |
Default: | false |
Switch this on if you want the linking step to succeed even if the resulting binary contains unresolved symbols. Normally this makes little sense, but in special cases it is possible that the respective symbols will be available at load time even if they are not present during linking.
Type: | string |
Default: | qbs.architecture |
Target architecture. See qbs.architecture.
Type: | bool |
Default: | qbs.debugInformation |
Generate debug information. See qbs.debugInformation.
Type: | stringList |
Default: | undefined |
List of preprocessor macros that gets passed to the compiler. To set macro values use the following syntax:
cpp.defines: ["USE_COLORS=1", 'COLOR_STR="blanched almond"']
Type: | stringList |
Default: | undefined |
List of preprocessor macros that are used for all projects that are built for the current target platform. User project files usually do not set this property.
Type: | stringList |
Default: | undefined |
List of preprocessor macros that are used for all projects that are using the current toolchain. User project files usually do not set this property.
Type: | pathList |
Default: | undefined |
List of include paths. Relative paths are considered to be relative to the .qbs product file they are used in.
Type: | pathList |
Default: | undefined |
List of include paths that are passed as system include paths to the compiler. For header files in those paths warnings will be ignored. Relative paths are considered to be relative to the .qbs product file they are used in.
Type: | pathList |
Default: | undefined |
List of library search paths. Relative paths are considered to be relative to the .qbs product file they are used in.
Type: | stringList |
Default: | undefined |
List of dynamic libraries to be linked. If the library is part of your project, consider using a Depends item instead.
Type: | stringList |
Default: | undefined |
List of static libraries to be linked. If the library is part of your project, consider using a Depends item instead.
Type: | pathList |
Default: | undefined |
List of files to automatically include at the beginning of each source file in the product.
Type: | path |
Default: | undefined |
Name of the header file to be precompiled.
If you want to use the same precompiled header for all languages (C, C++, Objective-C and Objective-C++), set this property and ensure that the header contains appropriate ifdefs.
Otherwise, use the cPrecompiledHeader, cppPrecompiledHeader, objcPrecompiledHeader and objcppPrecompiledHeader to specify precompiled headers per-language.
Type: | path |
Default: | precompiledHeader |
Name of the C header file to be precompiled.
Type: | path |
Default: | precompiledHeader |
Name of the C++ header file to be precompiled.
Type: | path |
Default: | precompiledHeader |
Name of the Objective-C header file to be precompiled.
Type: | path |
Default: | precompiledHeader |
Name of the Objective-C++ header file to be precompiled.
Type: | path |
Default: | product.buildDirectory |
The directory that will contain the precompiled header files. Usually you won't need to set this.
Type: | string |
Default: | qbs.optimization |
Optimization level. See qbs.optimization.
Type: | bool |
Default: | false |
Warnings will be handled as errors and cause the build to fail.
Type: | string |
Allowed Values: | "none", "all" |
Default: | "all" |
Specifies the warning level for the compiler.
Type: | stringList |
Default: | undefined |
Flags that are added to all compilation commands independently of the language.
Type: | stringList |
Default: | undefined |
Additional flags for the C preprocessor.
Type: | stringList |
Default: | undefined |
Additional flags for the C compiler.
Type: | stringList |
Default: | undefined |
Additional flags for the C++ compiler.
Type: | stringList |
Default: | undefined |
Additional flags for the Objective-C compiler.
Type: | stringList |
Default: | undefined |
Additional flags for the Objective-C++ compiler.
Type: | stringList |
Default: | undefined |
Additional flags for the linker.
Type: | pathList |
Default: | undefined |
List of linker script files.
Type: | string |
Default: | determined by qbs-setup-toolchains |
Name of the main compiler binary. This is set in the build profile.
Type: | string |
Default: | determined by qbs-setup-toolchains |
Full path of the main compiler binary. This is set in the build profile. If the toolchain provides different compilers for different languages, then compilerPathByLanguage is used.
Type: | string to string map |
Default: | determined by qbs-setup-toolchains |
Maps file tags to full paths of compiler binaries. This is set in the build profile.
Type: | stringList |
Default: | undefined |
Wrapper binary and its arguments for wrapping compiler calls. This is useful for compiler wrappers like ccache and alike.
Type: | string |
Default: | determined by qbs-setup-toolchains |
Name of the linker binary. This is set in the build profile.
Type: | string |
Default: | determined by qbs-setup-toolchains |
Full path of the linker binary. This is set in the build profile.
Type: | stringList |
Default: | undefined |
List of file suffixes this toolchain's linker accepts as input. For example, for MinGW this list should be [".a", ".lib"].
Type: | string |
Default: | undefined |
Name of the entry point of an executable or dynamic library. If this property is undefined, the toolchain's default is used.
Type: | pathList |
Default: | undefined |
List of framework search paths. Relative paths are considered to be relative to the .qbs product file they are used in.
Type: | pathList |
Default: | undefined |
List of framework search paths. Relative paths are considered to be relative to the .qbs product file they are used in. Header files in frameworks in those paths will not cause warnings.
Type: | stringList |
Default: | undefined |
List of frameworks to be linked. If the framework is part of your project, consider using a Depends item instead.
Type: | stringList |
Default: | undefined |
List of frameworks to be weakly linked. If the framework is part of your project, consider using a Depends item instead.
Type: | path |
Default: | undefined |
Path to the Info.plist file used by the bundle. The contents of this file will be aggregated with the values in infoPlist. If infoPlistFile and infoPlist contain the same key, the latter will take precedence, but may also be overridden during postprocessing (see processInfoPlist). If undefined, will not be taken into account.
Type: | object |
Default: | undefined |
Dictionary of key-value pairs to add to the bundle's Info.plist. The contents of this property will be aggregated with the values from infoPlistFile. If infoPlist and infoPlistFile contain the same key, the former will take precedence, but may also be overridden during postprocessing (see processInfoPlist). If undefined, will not be taken into account.
Type: | bool |
Default: | true |
Whether to perform post-processing on the aggregated Info.plist contents. If this property is true, various post-processing operations will be applied to the bundle's property list dictionary after it has been aggregated from the contents of the file specified by the infoPlistFile property and the infoPlist property. First, values from a list of defaults will be added to the dictionary if they were not already present. Then, values from the AdditionalInfo key of the platform SDK's Info.plist file will be added to the dictionary if they were not already present, as well as some other miscellaneous keys, such as BuildMachineOSBuild and UIDeviceFamily (on iOS). Finally, variable expansions will be performed such that substrings of the form $(VAR) or ${VAR} will be replaced with their corresponding environment variables.
Type: | bool |
Default: | true if the product is a command line tool, otherwise false. |
Whether to create a __TEXT section in the product's executable containing the processed Info.plist. Only applies to command line applications.
Type: | string |
Allowed Values: | "xml1", "binary1", "json", "same-as-input" |
Default: | "binary1" for iOS; "same-as-input" or "xml1" for OS X depending on whether infoPlistFile is specified; undefined for all other operating systems. |
The file format to write the product's resulting Info.plist in.
Type: | string |
Default: | undefined, but may be set by generated profiles |
A version number in the format [major].[minor] indicating the earliest version of OS X that the product should run on. Passes -miphoneos-version-min=<version> to the compiler. If undefined, compiler defaults will be used.
Type: | string |
Default: | undefined, but may be set by generated profiles |
A version number in the format [major].[minor] indicating the earliest version of OS X that the product should run on. Passes -mmacosx-version-min=<version> to the compiler. If undefined, compiler defaults will be used.
Type: | string |
Default: | "ar" |
Name of the archiver binary. This is set in the build profile.
Type: | string |
Default: | determined by qbs-setup-toolchains |
Full path of the archiver binary. This is set in the build profile.
Type: | bool |
Default: | undefined |
Generate position independent code. If this property is undefined, then position independent code is generated for libraries, but not for applications.
Type: | stringList |
Default: | undefined |
List of rpaths that are passed to the linker.
Type: | bool |
Default: | true |
Set this property to false to prevent the linker from writing rpaths to the binary.
Type: | string |
Allowed Values: | "default", "hidden", "hiddenInlines", "minimal" |
Default: | "default" |
Visibility level for exported symbols. The "minimal" value combines "hidden" and "hiddenInlines".
Type: | string |
Allowed Values: | "unicode", "mbcs", undefined |
Default: | "unicode" |
Specifies the character set used in the Win32 API. "unicode" will define the preprocessor symbols UNICODE and _UNICODE, "mbcs" will define _MBCS, and setting the value to undefined will use the default character set.
Type: | string |
Default: | undefined, but may be set by generated profiles |
A version number in the format [major].[minor] indicating the earliest version of Windows that the product should run on. Defines WINVER, _WIN32_WINNT, and _WIN32_WINDOWS, and applies a version number to the linker flags /SUBSYSTEM and /OSVERSION for MSVC or -Wl,--major-subsystem-version, -Wl,--minor-subsystem-version, -Wl,--major-os-version and -Wl,--minor-os-version for MinGW. If undefined, compiler defaults will be used.