qtbase/config_help.txt

353 lines
18 KiB
Plaintext
Raw Permalink Normal View History

Usage: configure [options] [-- cmake-options]
This is a convenience script for configuring Qt with CMake.
Options after the double dash are directly passed to CMake.
You can pass CMake variables as configure arguments:
configure VAR=value
which is equivalent to
configure -- -DVAR=value
Top-level installation directories:
-prefix <dir> ...... The deployment directory, as seen on the target device.
[/usr/local/Qt-$QT_VERSION; qtbase build directory if
-developer-build]
-no-prefix ......... The deployment directory is set to the qtbase build
directory. Can be used instead of -developer-build
to not have to install, as well as avoid
-developer-build's default of -warnings-are-errors.
-extprefix <dir> ... The installation directory, as seen on the host machine.
[SYSROOT/PREFIX]
Fine tuning of installation directory layout. Note that all directories
except -sysconfdir should be located under -prefix:
-bindir <dir> ......... Executables [PREFIX/bin]
-headerdir <dir> ...... Header files [PREFIX/include]
-libdir <dir> ......... Libraries [PREFIX/lib]
-archdatadir <dir> .... Arch-dependent data [PREFIX]
-plugindir <dir> ...... Plugins [ARCHDATADIR/plugins]
-libexecdir <dir> ..... Helper programs [ARCHDATADIR/bin on Windows,
ARCHDATADIR/libexec otherwise]
-qmldir <dir> ......... QML imports [ARCHDATADIR/qml]
CMake: Generate an SPDX v2.3 SBOM file for each built repository This change adds a new -sbom configure option to allow generating and installing an SPDX v2.3 SBOM file when building a qt repo. The -sbom-dir option can be used to configure the location where each repo sbom file will be installed. By default it is installed into $prefix/$archdatadir/sbom/$sbom_lower_project_name.sdpx which is basically ~/Qt/sbom/qtbase-6.8.0.spdx The file is installed as part of the default installation rules, but it can also be installed manually using the "sbom" installation component, or "sbom_$lower_project_name" in a top-level build. For example: cmake install . --component sbom_qtbase CMake 3.19+ is needed to read the qt_attribution.json files for copyrights, license info, etc. When using an older cmake version, configuration will error out. It is possible to opt into using an older cmake version, but the generated sbom will lack all the attribution file information. Using an older cmake version is untested and not officially supported. Implementation notes. The bulk of the implementation is split into 4 new files: - QtPublicSbomHelpers.cmake - for Qt-specific collecting, processing and dispatching the generation of various pieces of the SBOM document e.g. a SDPX package associated with a target like Core, a SDPX file entry for each target binary file (per-config shared library, archive, executable, etc) - QtPublicSbomGenerationHelpers.cmake - for non-Qt specific implementation of SPDX generation. This also has some code that was taken from the cmake-sbom 3rd party project, so it is dual licensed under the usual Qt build system BSD license, as well as the MIT license of the 3rd party project - QtPublicGitHelpers.cmake - for git related features, mainly to embed queried hashes or tags into version strings, is dual-licensed for the same reasons as QtPublicSbomGenerationHelpers.cmake - QtSbomHelpers.cmake - Qt-specific functions that just forward arguments to the public functions. These are meant to be used in our Qt CMakeLists.txt instead of the public _qt_internal_add_sbom ones for naming consistency. These function would mostly be used to annotate 3rd party libraries with sbom info and to add sbom info for unusual target setups (like the Bootstrap library), because most of the handling is already done automatically via qt_internal_add_module/plugin/etc. The files are put into Public cmake files, with the future hope of making this available to user projects in some capacity. The distinction of Qt-specific and non-Qt specific code might blur a bit, and thus the separation across files might not always be consistent, but it was best effort. The main purpose of the code is to collect various information about targets and their relationships and generate equivalent SPDX info. Collection is currently done for the following targets: Qt modules, plugins, apps, tools, system libraries, bundled 3rd party libraries and partial 3rd party sources compiled directly as part of Qt targets. Each target has an equivalent SPDX package generated with information like version, license, copyright, CPE (common vulnerability identifier), files that belong to the package, and relationships on other SPDX packages (associated cmake targets), mostly gathered from direct linking dependencies. Each package might also contain files, e.g. libQt6Core.so for the Core target. Each file also has info like license id, copyrights, but also the list of source files that were used to generate the file and a sha1 checksum. SPDX documents can also refer to packages in other SPDX documents, and those are referred to via external document references. This is the case when building qtdeclarative and we refer to Core. For qt provided targets, we have complete information regarding licenses, and copyrights. For bundled 3rd party libraries, we should also have most information, which is usually parsed from the src/3rdparty/libfoo/qt_attribution.json files. If there are multiple attribution files, or if the files have multiple entries, we create a separate SBOM package for each of those entries, because each might have a separate copyright or version, and an sbom package can have only one version (although many copyrights). For system libraries we usually lack the information because we don't have attribution files for Find scripts. So the info needs to be manually annotated via arguments to the sbom function calls, or the FindFoo.cmake scripts expose that information in some form and we can query it. There are also corner cases like 3rdparty sources being directly included in a Qt library, like the m4dc files for Gui, or PCRE2 for Bootstrap. Or QtWebEngine libraries (either Qt bundled or Chromium bundled or system libraries) which get linked in by GN instead of CMake, so there are no direct targets for them. The information for these need to be annotated manually as well. There is also a distinction to be made for static Qt builds (or any static Qt library in a shared build), where the system libraries found during the Qt build might not be the same that are linked into the final user application or library. The actual generation of the SBOM is done by file(GENERATE)-ing one .cmake file for each target, file, external ref, etc, which will be included in a top-level cmake script. The top-level cmake script will run through each included file, to append to a "staging" spdx file, which will then be used in a configure_file() call to replace some final variables, like embedding a file checksum. There are install rules to generate a complete SBOM during installation, and an optional 'sbom' custom target that allows building an incomplete SBOM during the build step. The build target is just for convenience and faster development iteration time. It is incomplete because it is missing the installed file SHA1 checksums and the document verification code (the sha1 of all sha1s). We can't compute those during the build before the files are actually installed. A complete SBOM can only be achieved at installation time. The install script will include all the generated helper files, but also set some additional variables to ensure checksumming happens, and also handle multi-config installation, among other small things. For multi-config builds, CMake doesn't offer a way to run code after all configs are installed, because they might not always be installed, someone might choose to install just Release. To handle that, we rely on ninja installing each config sequentially (because ninja places the install rules into the 'console' pool which runs one task at a time). For each installed config we create a config-specific marker file. Once all marker files are present, whichever config ends up being installed as the last one, we run the sbom generation once, and then delete all marker files. There are a few internal variables that can be set during configuration to enable various checks (and other features) on the generated spdx files: - QT_INTERNAL_SBOM_VERIFY - QT_INTERNAL_SBOM_AUDIT - QT_INTERNAL_SBOM_AUDIT_NO_ERROR - QT_INTERNAL_SBOM_GENERATE_JSON - QT_INTERNAL_SBOM_SHOW_TABLE - QT_INTERNAL_SBOM_DEFAULT_CHECKS These use 3rd party python tools, so they are not enabled by default. If enabled, they run at installation time after the sbom is installed. We will hopefully enable them in CI. Overall, the code is still a bit messy in a few places, due to time constraints, but can be improved later. Some possible TODOs for the future: - Do we need to handle 3rd party libs linked into a Qt static library in a Qt shared build, where the Qt static lib is not installed, but linked into a Qt shared library, somehow specially? We can record a package for it, but we can't create a spdx file record for it (and associated source relationships) because we don't install the file, and spdx requires the file to be installed and checksummed. Perhaps we can consider adding some free-form text snippet to the package itself? - Do we want to add parsing of .cpp source files for Copyrights, to embed them into the packages? This will likely slow down configuration quite a bit. - Currently sbom info attached to WrapFoo packages in one repo is not exported / available in other repos. E.g. If we annotate WrapZLIB in qtbase with CPE_VENDOR zlib, this info will not be available when looking up WrapZLIB in qtimageformats. This is because they are IMPORTED libraries, and are not exported. We might want to record this info in the future. [ChangeLog][Build System] A new -sbom configure option can be used to generate and install a SPDX SBOM (Software Bill of Materials) file for each built Qt repository. Pick-to: 6.8 Task-number: QTBUG-122899 Change-Id: I9c730a6bbc47e02ce1836fccf00a14ec8eb1a5f4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-03-07 18:02:56 +01:00
-sbomdir <dir> ....... Software Bill of Materials (SBOM)
installation directory [ARCHDATADIR/sbom]
-datadir <dir> ........ Arch-independent data [PREFIX]
-docdir <dir> ......... Documentation [DATADIR/doc]
-translationdir <dir> . Translations [DATADIR/translations]
-sysconfdir <dir> ..... Settings used by Qt programs [PREFIX/etc/xdg]
-examplesdir <dir> .... Examples [PREFIX/examples]
-testsdir <dir> ....... Tests [PREFIX/tests]
-hostdatadir <dir> .... Data used by qmake [PREFIX]
Conventions for the remaining options: When an option's description is
followed by a list of values in brackets, the interpretation is as follows:
'yes' represents the bare option; all other values are possible prefixes to
the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g.,
--gui=yes. Values are listed in the order they are tried if not specified;
'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary
options without auto-detection.
Configure meta:
-help, -h ............ Display this help screen
-redo ................ Re-configure with previously used options. In addition,
redo removes CMakeCache.txt file and CMakeFiles/ directory
and recreates them from scratch.
Additional options may be passed, but will not be
saved for later use by -redo.
-feature-<feature> ... Enable <feature>
-no-feature-<feature> Disable <feature> [none]
-list-features ....... List available features. Note that some features
have dedicated command line options as well.
Build options:
-cmake-generator <name> ... Explicitly specify the build system generator for
CMake instead of auto-detecting one.
-cmake-use-default-generator ... Turn off auto-detection of the CMake build
system generator.
-cmake-file-api ...... Let CMake store build metadata for loading the build
into an IDE. [no; yes if -developer-build]
-no-guess-compiler ... Do not guess the compiler from the target mkspec.
-release ............. Build Qt with optimizations and without debug
symbols [yes]
Note that -developer-build implies -debug unless
-release is also explicitly specified
-debug ............... Build Qt without optimizations and with debug symbols
[no]
-debug-and-release ... Build two versions of Qt in one build tree [no]
-optimize-debug ...... Enable debug-friendly optimizations in debug builds
[auto] (Not supported with MSVC or Clang toolchains)
-optimize-size ....... Optimize release builds for size instead of speed [no]
-force-debug-info .... Create symbol files for release builds [no]
-separate-debug-info . Split off debug information to separate files [no]
-gdb-index ........... Index the debug info to speed up GDB
[no; auto if -developer-build with debug info]
-gc-binaries ......... Place each function or data item into its own section
and enable linker garbage collection of unused
sections. [auto for static builds, otherwise no]
-force-asserts ....... Enable Q_ASSERT even in release builds [no]
-developer-build ..... Compile and link Qt for developing Qt itself
(exports for auto-tests, extra checks, implies
-no-prefix, etc.) [no]
-shared .............. Build shared Qt libraries [yes] (no for UIKit)
-static .............. Build static Qt libraries [no] (yes for UIKit)
-framework ........... Build Qt framework bundles [yes] (Apple only)
-platform <target> ... Select mkspec for the qmake companion files
-device <name> ....... Select devices/mkspec for the qmake companion files
-device-option <key=value> ... Add option for the device mkspec
-appstore-compliant .. Disable code that is not allowed in platform app stores.
This is on by default for platforms which require distribution
through an app store by default, in particular Android,
iOS, tvOS, and watchOS. [auto]
-sbom ................ Enable generation of Software Bill of Materials (SBOM)
documents in SPDX tag:value format
[yes; no for developer builds]
-sbom-json ........... Enable SBOM generation in SPDX JSON format [auto]
(if Python dependencies are available)
-sbom-json-required .. Fails the build if the Python dependencies for JSON
generation are not found [no]
-sbom-verify ......... Verify generated SBOM files [auto] (if Python
dependencies are available)
-sbom-verify-required Fails the build if the Python dependencies for SBOM
verification are not found [no]
CMake: Generate an SPDX v2.3 SBOM file for each built repository This change adds a new -sbom configure option to allow generating and installing an SPDX v2.3 SBOM file when building a qt repo. The -sbom-dir option can be used to configure the location where each repo sbom file will be installed. By default it is installed into $prefix/$archdatadir/sbom/$sbom_lower_project_name.sdpx which is basically ~/Qt/sbom/qtbase-6.8.0.spdx The file is installed as part of the default installation rules, but it can also be installed manually using the "sbom" installation component, or "sbom_$lower_project_name" in a top-level build. For example: cmake install . --component sbom_qtbase CMake 3.19+ is needed to read the qt_attribution.json files for copyrights, license info, etc. When using an older cmake version, configuration will error out. It is possible to opt into using an older cmake version, but the generated sbom will lack all the attribution file information. Using an older cmake version is untested and not officially supported. Implementation notes. The bulk of the implementation is split into 4 new files: - QtPublicSbomHelpers.cmake - for Qt-specific collecting, processing and dispatching the generation of various pieces of the SBOM document e.g. a SDPX package associated with a target like Core, a SDPX file entry for each target binary file (per-config shared library, archive, executable, etc) - QtPublicSbomGenerationHelpers.cmake - for non-Qt specific implementation of SPDX generation. This also has some code that was taken from the cmake-sbom 3rd party project, so it is dual licensed under the usual Qt build system BSD license, as well as the MIT license of the 3rd party project - QtPublicGitHelpers.cmake - for git related features, mainly to embed queried hashes or tags into version strings, is dual-licensed for the same reasons as QtPublicSbomGenerationHelpers.cmake - QtSbomHelpers.cmake - Qt-specific functions that just forward arguments to the public functions. These are meant to be used in our Qt CMakeLists.txt instead of the public _qt_internal_add_sbom ones for naming consistency. These function would mostly be used to annotate 3rd party libraries with sbom info and to add sbom info for unusual target setups (like the Bootstrap library), because most of the handling is already done automatically via qt_internal_add_module/plugin/etc. The files are put into Public cmake files, with the future hope of making this available to user projects in some capacity. The distinction of Qt-specific and non-Qt specific code might blur a bit, and thus the separation across files might not always be consistent, but it was best effort. The main purpose of the code is to collect various information about targets and their relationships and generate equivalent SPDX info. Collection is currently done for the following targets: Qt modules, plugins, apps, tools, system libraries, bundled 3rd party libraries and partial 3rd party sources compiled directly as part of Qt targets. Each target has an equivalent SPDX package generated with information like version, license, copyright, CPE (common vulnerability identifier), files that belong to the package, and relationships on other SPDX packages (associated cmake targets), mostly gathered from direct linking dependencies. Each package might also contain files, e.g. libQt6Core.so for the Core target. Each file also has info like license id, copyrights, but also the list of source files that were used to generate the file and a sha1 checksum. SPDX documents can also refer to packages in other SPDX documents, and those are referred to via external document references. This is the case when building qtdeclarative and we refer to Core. For qt provided targets, we have complete information regarding licenses, and copyrights. For bundled 3rd party libraries, we should also have most information, which is usually parsed from the src/3rdparty/libfoo/qt_attribution.json files. If there are multiple attribution files, or if the files have multiple entries, we create a separate SBOM package for each of those entries, because each might have a separate copyright or version, and an sbom package can have only one version (although many copyrights). For system libraries we usually lack the information because we don't have attribution files for Find scripts. So the info needs to be manually annotated via arguments to the sbom function calls, or the FindFoo.cmake scripts expose that information in some form and we can query it. There are also corner cases like 3rdparty sources being directly included in a Qt library, like the m4dc files for Gui, or PCRE2 for Bootstrap. Or QtWebEngine libraries (either Qt bundled or Chromium bundled or system libraries) which get linked in by GN instead of CMake, so there are no direct targets for them. The information for these need to be annotated manually as well. There is also a distinction to be made for static Qt builds (or any static Qt library in a shared build), where the system libraries found during the Qt build might not be the same that are linked into the final user application or library. The actual generation of the SBOM is done by file(GENERATE)-ing one .cmake file for each target, file, external ref, etc, which will be included in a top-level cmake script. The top-level cmake script will run through each included file, to append to a "staging" spdx file, which will then be used in a configure_file() call to replace some final variables, like embedding a file checksum. There are install rules to generate a complete SBOM during installation, and an optional 'sbom' custom target that allows building an incomplete SBOM during the build step. The build target is just for convenience and faster development iteration time. It is incomplete because it is missing the installed file SHA1 checksums and the document verification code (the sha1 of all sha1s). We can't compute those during the build before the files are actually installed. A complete SBOM can only be achieved at installation time. The install script will include all the generated helper files, but also set some additional variables to ensure checksumming happens, and also handle multi-config installation, among other small things. For multi-config builds, CMake doesn't offer a way to run code after all configs are installed, because they might not always be installed, someone might choose to install just Release. To handle that, we rely on ninja installing each config sequentially (because ninja places the install rules into the 'console' pool which runs one task at a time). For each installed config we create a config-specific marker file. Once all marker files are present, whichever config ends up being installed as the last one, we run the sbom generation once, and then delete all marker files. There are a few internal variables that can be set during configuration to enable various checks (and other features) on the generated spdx files: - QT_INTERNAL_SBOM_VERIFY - QT_INTERNAL_SBOM_AUDIT - QT_INTERNAL_SBOM_AUDIT_NO_ERROR - QT_INTERNAL_SBOM_GENERATE_JSON - QT_INTERNAL_SBOM_SHOW_TABLE - QT_INTERNAL_SBOM_DEFAULT_CHECKS These use 3rd party python tools, so they are not enabled by default. If enabled, they run at installation time after the sbom is installed. We will hopefully enable them in CI. Overall, the code is still a bit messy in a few places, due to time constraints, but can be improved later. Some possible TODOs for the future: - Do we need to handle 3rd party libs linked into a Qt static library in a Qt shared build, where the Qt static lib is not installed, but linked into a Qt shared library, somehow specially? We can record a package for it, but we can't create a spdx file record for it (and associated source relationships) because we don't install the file, and spdx requires the file to be installed and checksummed. Perhaps we can consider adding some free-form text snippet to the package itself? - Do we want to add parsing of .cpp source files for Copyrights, to embed them into the packages? This will likely slow down configuration quite a bit. - Currently sbom info attached to WrapFoo packages in one repo is not exported / available in other repos. E.g. If we annotate WrapZLIB in qtbase with CPE_VENDOR zlib, this info will not be available when looking up WrapZLIB in qtimageformats. This is because they are IMPORTED libraries, and are not exported. We might want to record this info in the future. [ChangeLog][Build System] A new -sbom configure option can be used to generate and install a SPDX SBOM (Software Bill of Materials) file for each built Qt repository. Pick-to: 6.8 Task-number: QTBUG-122899 Change-Id: I9c730a6bbc47e02ce1836fccf00a14ec8eb1a5f4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-03-07 18:02:56 +01:00
-qt-host-path <path> . Specify path to a Qt host build for cross-compiling.
-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
-qtinlinenamespace ... Make -qtnamespace an inline namespace
-qtlibinfix <infix> .. Rename all libQt6*.so to libQt6*<infix>.so.
-coverage <tool> ..... Instrument with the code coverage tool.
-gcov ................ Instrument with the GCov code coverage tool [no]
-trace [backend] ..... Enable instrumentation with tracepoints.
Currently supported backends are 'etw' (Windows),
'lttng' (Linux), 'ctf' (Common Trace Format, cross-platform)
or 'yes' for auto-detection. [no]
-sanitize {address|thread|memory|fuzzer-no-link|undefined}
Instrument with the specified compiler sanitizer.
Note that some sanitizers cannot be combined;
for example, -sanitize address cannot be combined with
-sanitize thread.
-mips_dsp/-mips_dspr2 Use MIPS DSP/rev2 instructions [auto]
-qreal <type> ........ typedef qreal to the specified type. [double]
Note: this affects binary compatibility.
-R <string> .......... Add an explicit runtime library path to the Qt
libraries. Supports paths relative to LIBDIR.
-rpath ............... Link Qt libraries and executables using the library
install path as a runtime library path. Similar to
-R LIBDIR. On Apple platforms, disabling this implies
using absolute install names (based in LIBDIR) for
dynamic libraries and frameworks. [auto]
-reduce-exports ...... Reduce amount of exported symbols [auto]
-reduce-relocations .. Reduce amount of relocations [auto] (Unix only)
-plugin-manifests .... Embed manifests into plugins [no] (Windows only)
-static-runtime ...... With -static, use static runtime [no] (Windows only)
-pch ................. Use precompiled headers [auto]
-ltcg ................ Use Link Time Code Generation [no]
Add hardening build options This commit enables hardened-specific checks and codegen, inspired by GCC 14's -fhardened command line switch and LLVM/libc++'s hardened modes. We enable (depending on compiler capabilities): * -ftrivial-auto-var-init=pattern; * -fstack-protector-strong; * -fstack-clash-protection; * -fcf-protection=full or /CETCOMPAT; * -D_FORTIFY_SOURCE=3 or 2 on Glibc, depending on the Glibc version, provided that some optimization level is enabled (release build or optimized debug build); * on libstdc++, -D_GLIBCXX_ASSERTIONS; * on libc++, -D_LIBCPP_HARDENING_MODE set to _LIBCPP_HARDENING_MODE_EXTENSIVE in debug and to _LIBCPP_HARDENING_MODE_FAST in release (_DEBUG is too slow); * -Wl,-z,relro,-z,now. This aligns us 100% with -fhardened (we already pass -fPIE and -pie anyhow). Some Linux distributions already ship GCC/Clang with some of these options enabled by default. The check for Intel CET has been amended to always test if the compiler supports the corresponding flag; and, if so, enable the feature. Before, it was behind a configure option and the test only checked if the compiler had CET support automatically active (the test didn't pass -fcf-protection to the compiler). The check for -fstack-protector-strong has been made general (rather than QNX-specific). We don't support QNX < 7 anyhow. Finally, the qt_config_linker_supports_flag_test test has been amended to also support MSVC. All of the hardening options are enabled by default. [ChangeLog][Build System] Qt builds by default in "hardened mode", meaning that a series of security-related compiler options are automatically enabled. In the unlikely case in which these options constitute an unacceptable performance hit, it is possible to disable individual hardening options when configuring Qt. Change-Id: I2c026b0438010ad10d5e7b1136fedf4ae3af8822 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-06 16:22:12 +01:00
-intelcet ............ Use Intel Control-flow Enforcement Technology [auto]
-glibc-fortify-source Use Glibc function fortification [auto]
-trivial-auto-var-init-pattern
Use -ftrivial-auto-var-init=pattern [auto]
-stack-protector ..... Use -fstack-protector-strong [auto]
-stack-clash-protection
Use -fstack-clash-protection [auto]
-libstdcpp-assertions Use libstdc++ assertions [auto]
-libcpp-hardening .... Use libc++ hardening [auto]
-relro-now-linker .... Use -z relro -z now when linking [auto]
-linker [bfd,gold,lld,mold]
Force use of the GNU ld, GNU gold, LLVM/LLD or mold
linker instead of default one (GCC and clang only)
-ccache .............. Use the ccache compiler cache [no] (Unix only)
-unity-build ......... Enable Unity (Jumbo) build
-unity-build-batch-size <int>
Maximum number of source files used by the unity build
to create unity source files [32]
-warnings-are-errors . Treat warnings as errors [no; yes if -developer-build]
-disable-deprecated-up-to <version>
Set the QT_DISABLE_DEPRECATED_UP_TO value to <version>.
QT_DISABLE_DEPRECATED_UP_TO is used to remove
deprecated methods from both API and ABI.
<version> is a hex value, for example 0x060500 can be
used to remove all code deprecated in Qt 6.5.0 or
earlier releases.
By default <version> is set to 0x040000 and 0x050000 on
Windows, and non-Windows respectively.
Build environment:
-pkg-config .......... Use pkg-config [auto] (Unix only)
-vcpkg ............... Use vcpkg [no]
-D <string> .......... Pass additional preprocessor define
-I <string> .......... Pass additional include path
-L <string> .......... Pass additional library path
-F <string> .......... Pass additional framework path (Apple only)
-sdk <sdk> ........... Build Qt using Apple provided SDK <sdk>. The argument
should be one of the available SDKs as listed by
'xcodebuild -showsdks'.
-android-sdk path .... Set Android SDK root path [$ANDROID_SDK_ROOT]
-android-ndk path .... Set Android NDK root path [$ANDROID_NDK_ROOT]
-android-ndk-platform Set Android platform
-android-abis ....... Only one ABI can be specified, default is: armeabi-v7a
-android-javac-target Set the javac build target version [8]
-android-javac-source Set the javac build source version [8]
-android-style-assets Automatically extract style assets from the device at
run time. This option makes the Android style behave
correctly, but also makes the Android platform plugin
incompatible with the LGPL2.1. [yes]
Component selection:
-submodules <repo>[,<repo>] ... Build the listed repositories and those they
depend on rather than all checked-out repositories.
The list should be separated with commas, e.g.
-submodules qtsvg,qtnetworkauth
[default is to build all checked out repositories]
-skip <repo>[,<repo>] Exclude one or more entire repositories from the
build. The list should be separated with commas.
e.g. -skip qtimageformats,qtsvg
-skip-tests <repo>[,<repo>] ... Skip building tests for one or more
repositories. The list should be separated with commas.
e.g. -skip-tests qtimageformats,qtsvg
-skip-examples <repo>[,<repo>] ... Skip building examples for one or more
repositories. The list should be separated with commas.
e.g. -skip-examples qtimageformats,qtsvg
-init-submodules ..... When configure is called from the qt git super module,
it will automatically clone and initialize the
repositories specified by the -submodules option. When
no -submodules are specified, and no existing
submodules are cloned, a default set of submodules
will be initialized. To adjust other aspects of the
cloning process, check the init-repository --help
output for additional options that can be passed
to configure.
-make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first.
(allowed values: libs, tools, examples, tests,
benchmarks, manual-tests, minimal-static-tests)
[default: libs and examples, also tools if not
cross-building, also tests if -developer-build]
-nomake <part> ....... Exclude <part> from the list of parts to be built.
CMake: Allow installation of example sources into the Qt prefix In Qt 5 times, if Qt was configured with -make examples, running make install would not only build and install the example binaries, but would also install the example sources into the prefix. Installation of example sources was not implemented when the Qt 6 build system has switched to using CMake. There is still a use case for it though, mainly for Qt Creator, which only shows the examples of a Qt kit if the sources are available. In contrast to Qt 5, in Qt 6 we will not install example sources by default. It will be opt in. To enable installation of examples sources, configure with configure -make examples -install-examples-sources or cmake -DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON The -make examples part is required, otherwise -install-examples-sources has no effect. All example sources can be installed by calling cmake --install . --component examples_sources in the qt repo build directory. In a top-level build, per-repo installation can be done using cmake --install . --component examples_sources_<repo_name> where repo_name could be 'qtbase'. A single example's source can be installed by calling cmake --install . --component examples_sources_<subdir_name> where subdir_name is the subdirectory name of the example, e.g. 'gallery'. Implement installation of example sources by hooking into the qt_internal_add_example command. This means that all examples in all repos need to be added via qt_internal_add_example instead of add_subdirectory, to ensure the sources are installed. The majority of repos already use it. For testing purposes one can configure with -DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON -DQT_INTERNAL_NO_CONFIGURE_EXAMPLES=ON to allow testing installation of examples sources without building them. Take into account an additional variable called QT_INTERNAL_EXAMPLES_SOURCES_INSTALL_PREFIX to allow installation of example sources into a location different from the example binaries. As a cleanup, the NAME option that could previously be passed to qt_internal_add_example_external_project has been removed. That's because it's never used anywhere and could not have worked anyway because qt_internal_add_example_in_tree never handled it. Pick-to: 6.6 Fixes: QTBUG-112135 Change-Id: I52aa5ec643ff7e212276c88d8dd2dfecdbdbeb0d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-08-07 12:15:35 +02:00
-install-examples-sources Installs examples source code into the Qt prefix
Only possible when -make examples is also passed
[no]
-gui ................. Build the Qt GUI module and dependencies [yes]
-widgets ............. Build the Qt Widgets module and dependencies [yes]
-no-dbus ............. Do not build the Qt D-Bus module
[default on Android and Windows]
-dbus-linked ......... Build Qt D-Bus and link to libdbus-1 [auto]
-dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
-accessibility ....... Enable accessibility support [yes]
Note: Disabling accessibility is not recommended.
Qt comes with bundled copies of some 3rd party libraries. These are used
by default if auto-detection of the respective system library fails.
-force-bundled-libs .. Only use bundled 3rd party libraries [no]
-force-system-libs ... Do not use bundled 3rd party libraries [no]
Core options:
-doubleconversion .... Select used double conversion library [system/qt/no]
No implies use of sscanf_l and snprintf_l (imprecise).
-glib ................ Enable Glib support [no; auto on Unix]
-inotify ............. Enable inotify support
-icu ................. Enable ICU support [auto]
Add jemalloc support Large graphical Qt applications heavily rely on heap allocations. Jemalloc is a general-purpose malloc(3) implementation designed to reduce heap fragmentation and improve scalability. It also provides extensive tuning options. Add a -jemalloc configure option, disabled by default. When enabled, Qt and user code link to jemalloc, overriding the system's default malloc(). Add cooperation with jemalloc for some Qt key classes: QArrayData (used by QByteArray, QString and QList<T>), QBindingStoragePrivate, QDataBuffer (used by the Qt Quick renderer), QDistanceFieldData, QImageData, QObjectPrivate::TaggedSignalVector, QVarLengthArray. This cooperation relies on two jemalloc-specific optimizations: 1. Efficient allocation via fittedMalloc(): Determine the actual allocation size using nallocx(), then adjust the container’s capacity to match. This minimizes future reallocations. Note: we round allocSize to a multiple of sizeof(T) to ensure that we can later recompute the exact allocation size during deallocation. 2. Optimized deallocation via sizedFree(): Use sdallocx(), which is faster than free when the allocation size is known, as it avoids internal size lookups. Adapt the QVarLengthArray auto tests on capacity. Non-standard functions docs are at https://jemalloc.net/jemalloc.3.html [ChangeLog][QtCore] Added optional support for the jemalloc allocator, and optimized memory allocations and deallocations in core Qt classes to cooperate with it. Change-Id: I6166e64e66876dee22662d3f3ea3e42a6647cfeb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-01-24 17:09:58 +01:00
-jemalloc ............ Enable jemalloc support and cooperation [no]
-pcre ................ Select used libpcre2 [system/qt/no]
-zlib ................ Select used zlib [system/qt]
Logging backends:
-journald .......... Enable journald support [no] (Unix only)
-syslog ............ Enable syslog support [no] (Unix only)
-slog2 ............. Enable slog2 support [auto] (QNX only)
Network options:
-ssl ................. Enable either SSL support method [auto]
-no-openssl .......... Do not use OpenSSL [default on Apple]
-openssl-linked ...... Use OpenSSL and link to libssl [no]
-openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]
-schannel ............ Use Secure Channel [auto] (Windows only)
-securetransport ..... Use SecureTransport [auto] (Apple only)
-sctp ................ Enable SCTP support [no]
-libproxy ............ Enable use of libproxy [no]
-system-proxies ...... Use system network proxies by default [yes]
Gui, printing, widget options:
-cups ................ Enable CUPS support [auto] (Unix only)
-emojisegmenter ...... Enable complex emoji sequences [yes]
-fontconfig .......... Enable Fontconfig support [auto] (Unix only)
-freetype ............ Select used FreeType [system/qt/no]
-harfbuzz ............ Select used HarfBuzz-NG [system/qt/no]
(Not auto-detected on Apple and Windows)
-gtk ................. Enable GTK platform theme support [auto]
-no-opengl ........... Disable OpenGL support
-opengl <api> ........ Enable OpenGL support. Supported APIs:
Remove ANGLE This marks the end of EGL and OpenGL ES support on Windows. The concepts of -opengl dynamic, -opengl desktop, QT_OPENGL=software, etc. remain unchanged, with the exception of the disapperance of everything ANGLE related. CMake builds now work identically to qmake on Windows: they default to 'dynamic' OpenGL on Windows, unless -DINPUT_opengl=desktop is specified. On Windows, Qt 6 is expected to default to the "dynamic" OpenGL model by default, just like Qt 5.15. This can be changed by switching to "desktop" OpenGL, which will link to opengl32 (publicly, so other libs and applications will do so as well) and disallows using another OpenGL DLL. The "dynamic" mode is essential still because the fallback to a software rasterizer, such as the opengl32sw.dll we ship with the Qt packages, has to to work exactly like in Qt 5, the removal of ANGLE does not change this concept in any way (except of course that the middle option of using ANGLE is now gone) When it comes to the windows plugin's OpenGL blacklist feature, it works like before and accepts the ANGLE/D3D related keywords. They will then be ignored. Similarly, requesting QT_OPENGL=angle is ignored (but will show a warning). The D3D11 and DXGI configure time tests are removed: Qt 5.14 already depends on D3D 11.1 and DXGI 1.3 headers being available unconditionally on Win32 (in QRhi's D3D11 backend). No need to test for these. [ChangeLog][Windows] ANGLE is no longer included with Qt. Dynamic OpenGL builds work like before but ANGLE is no longer an option. OpenGL proper or an alternative opengl32 implementation are the two remaining options now. Attempting to set QT_OPENGL=angle or Qt::AA_UseOpenGLES will have no effect on Windows. Fixes: QTBUG-79103 Change-Id: Ia404e0d07f3fe191b27434d863c81180112ecb3b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-05-18 15:16:30 +02:00
es2, desktop (default on Unix),
dynamic (Windows only, default on Windows)
-opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
-egl ................. Enable EGL support [auto]
Change the -qpa configure argument logic Parse the -qpa configure argument as list and translate it to the QT_QPA_PLATFORMS cmake variable. This variable is new to the Qt build procedure. The QT_QPA_DEFAULT_PLATFORM variable supposed to get multiple values, but this didn't work at all, since the variable value then was used in the compile definition that is expected to be a single value QPA platfrom definition. This inconsistency forced to introduce a new variable. The QT_QPA_DEFAULT_PLATFORM variable now controls the first-choice QPA plugin for the GUI applications. The new configure argument -default-qpa is now translated to the QT_QPA_DEFAULT_PLATFORM variable instead the of -qpa one. The -qpa configure argument is now translated to the QT_QPA_PLATFORMS variable, which is new one as well. The variable contains the list of QPA plugins that are "default" for this Qt configuration. The meaning of the "default" plugins is related to the DEFAULT_IF argument of qt_internal_add_plugin command. Plugins that are listed in the QT_QPA_PLATFORMS variable will be treated as default by the build system and will be deployed within user applications when using deployment API or linked statically when using static Qt. The QT_QPA_DEFAULT_PLATFORM falls back to the QT_QPA_PLATFORMS first value in the list if it's not set explicitly and either '-DQT_QPA_PLATFORMS' or '-qpa' arguments are specified. [ChangeLog][CMake] Added QT_QPA_PLATFORMS variable which controls the list of QPA plugins that will be deployed within the applications by default. [ChangeLog][CMake] The '-qpa' configure argument now is mapped to the QT_QPA_PLATFORMS variable and has different functionality. It doesn't control the platform plugin that the GUI application is using by default, but controls the list of QPA plugins that will be deployed within the applications by default. [ChangeLog][CMake] Added '-default-qpa' argument which replaces the '-qpa' one. The argument is translated to the QT_DEFAULT_QPA_PLATFORM CMake variable and selects the default platform that should be used by GUI application if QT_QPA_PLATFORM environment variable is not set. Task-number: QTBUG-124265 Task-number: QTBUG-87805 Task-number: QTBUG-124449 Change-Id: Ibcebaccc535aaed6374f15ccfeddb3e6128f5ce0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-04-11 10:55:53 +02:00
-qpa <qpa1>[;<qpa2>] . Select supported QPA backend(s) (e.g., xcb, cocoa,
windows). A list separated by semi-colons.
-default-qpa <name> .. Select the default QPA backend (e.g., xcb, cocoa,
windows).
-xcb-xlib............. Enable Xcb-Xlib support [auto]
Platform backends:
-direct2d .......... Enable Direct2D support [auto] (Windows only)
-directfb .......... Enable DirectFB support [no] (Unix only)
-eglfs ............. Enable EGLFS support [auto; no on Android and Windows]
-gbm ............... Enable backends for GBM [auto] (Linux only)
-kms ............... Enable backends for KMS [auto] (Linux only)
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
3rdparty: remove xcb libs and bump minimal required version to 1.11 With libxcb 1.11 as minimal required version we can: (a) (Maybe) Enable threaded GL for MESA, see QTBUG-67277. (b) Avoid performance issues described in QTBUG-46017. Bundled xcb libs don't contain the more modern SHM fd passing APIs. The official binaries use "-qt-xcb", therefore we were shipping with the performance fix #ifdef-ed out. (c) Make xcb-xkb a mandatory dependency avoiding issues described in QTBUG-30911. Issues that appear when Qt was configure with "-no-xkb -xcb-xlib", but X server has the XKB extension. (d) Drop all, but xcb-xinput sources from src/3rdparty/xcb/, for which we need "xcb-xinput >= 1.12". This way we can reduce maintenance work. The xcb libraries were origianlly bundled because of lack of availability on supported distributions. This is not the case anymore: CI for Qt 5.13 has: Ubuntu 18.04 - libxcb 1.13 RHEL 7.4 - libxcb 1.13 openSUSE 15.0 - libxcb 1.13 CI for Qt 5.12 has: Ubuntu 16.04 - libxcb 1.11 RHEL 7.4 - libxcb 1.13 openSUSE 42.3 - libxcb 1.11 RHEL 6.x - not relevant because it was dropped from supported platforms. Why 1.11 (released on Aug, 2014), but not 1.13 (released on March 2018)? Based on what we have in CI for 5.13 and 5.14 we could update to 1.13, but it means that Qt would require a very recent version of 3rd party dependency. [ChangeLog][Configure][X11] The minimal required version of libxcb now is 1.11. [ChangeLog][Third-Party Code][X11] Removed all bundled XCB libs, with the exception of xcb-xinput, which is not available on systems with libxcb 1.11. [ChangeLog][Configure][X11] Removed -qt-xcb, -system-xcb, -xkb, -xcb-xinput switches. [ChangeLog][Platform Specific Changes][X11] XKB and XInput2 now are mandatory dependencies for XCB plugin. XCB-XKB is a part of libxcb 1.11 releases. XCB-XInput is not part of libxcb 1.11 releases, but Qt builders can use -bundled-xcb-xinput switch. Fixes: QTBUG-73862 Fixes: QTBUG-73888 Task-number: QTBUG-67277 Task-number: QTBUG-30939 Change-Id: I4c2bd2a0e667220d32fd1fbfa1419c844f17fcce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-19 10:09:19 +01:00
-xcb ............... Enable X11 support [auto] (Linux only)
Input backends:
-libudev............ Enable udev support [auto]
-evdev ............. Enable evdev support [auto]
-libinput .......... Enable libinput support [auto]
-mtdev ............. Enable mtdev support [auto]
-tslib ............. Enable tslib support [auto]
3rdparty: remove xcb libs and bump minimal required version to 1.11 With libxcb 1.11 as minimal required version we can: (a) (Maybe) Enable threaded GL for MESA, see QTBUG-67277. (b) Avoid performance issues described in QTBUG-46017. Bundled xcb libs don't contain the more modern SHM fd passing APIs. The official binaries use "-qt-xcb", therefore we were shipping with the performance fix #ifdef-ed out. (c) Make xcb-xkb a mandatory dependency avoiding issues described in QTBUG-30911. Issues that appear when Qt was configure with "-no-xkb -xcb-xlib", but X server has the XKB extension. (d) Drop all, but xcb-xinput sources from src/3rdparty/xcb/, for which we need "xcb-xinput >= 1.12". This way we can reduce maintenance work. The xcb libraries were origianlly bundled because of lack of availability on supported distributions. This is not the case anymore: CI for Qt 5.13 has: Ubuntu 18.04 - libxcb 1.13 RHEL 7.4 - libxcb 1.13 openSUSE 15.0 - libxcb 1.13 CI for Qt 5.12 has: Ubuntu 16.04 - libxcb 1.11 RHEL 7.4 - libxcb 1.13 openSUSE 42.3 - libxcb 1.11 RHEL 6.x - not relevant because it was dropped from supported platforms. Why 1.11 (released on Aug, 2014), but not 1.13 (released on March 2018)? Based on what we have in CI for 5.13 and 5.14 we could update to 1.13, but it means that Qt would require a very recent version of 3rd party dependency. [ChangeLog][Configure][X11] The minimal required version of libxcb now is 1.11. [ChangeLog][Third-Party Code][X11] Removed all bundled XCB libs, with the exception of xcb-xinput, which is not available on systems with libxcb 1.11. [ChangeLog][Configure][X11] Removed -qt-xcb, -system-xcb, -xkb, -xcb-xinput switches. [ChangeLog][Platform Specific Changes][X11] XKB and XInput2 now are mandatory dependencies for XCB plugin. XCB-XKB is a part of libxcb 1.11 releases. XCB-XInput is not part of libxcb 1.11 releases, but Qt builders can use -bundled-xcb-xinput switch. Fixes: QTBUG-73862 Fixes: QTBUG-73888 Task-number: QTBUG-67277 Task-number: QTBUG-30939 Change-Id: I4c2bd2a0e667220d32fd1fbfa1419c844f17fcce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-19 10:09:19 +01:00
-bundled-xcb-xinput Use bundled XInput2 support [auto]
-xkbcommon ......... Enable key mapping support [auto]
Image formats:
-gif ............... Enable reading support for GIF [auto]
-ico ............... Enable support for ICO [yes]
-libpng ............ Select used libpng [system/qt/no]
-libjpeg ........... Select used libjpeg [system/qt/no]
Database options:
-sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
db2 ibase mysql oci odbc psql sqlite mimer
[all auto]
-sqlite .............. Select used sqlite [system/qt]