Remove code duplication by calling qt6_add_plugin() from
qt_internal_add_plugin().
Separate out the public and internal arguments for the
variables defined in QtBuild.cmake for these functions.
Provide them via commands instead for greater robustness.
This separation allows other Qt repos to access the appropriate
set of keywords where they define commands that forward
on to *_add_plugin() in their implementations. Retain
the old variables for now to simplify the integration
steps for updating other repos. The old variables can
be removed once there are no more references left to
them in any repo.
Task-number: QTBUG-88763
Pick-to: 6.1
Change-Id: I0105523afd95995923bd20fc963d245bbb15d34d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Set QT_DEFAULT_MKSPEC for various bsd systems, this is needed to
find qplatformdefs.h when compiling.
Change-Id: I9450193b737930548f32c87be3525c5ecd1e0e13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Associated changes in the qtdeclarative repo now ensure that arguments
for qml plugins are handled on the calling side. This reduces the
qml-specific logic needed in qtbase and gives qtdeclarative clearer
control over qml build and install locations.
As part of that work, the INSTALL_LOCATION keyword used in
qt_internal_record_rcc_object_files() has been renamed to
INSTALL_DIRECTORY to make it consistent with the keyword used for the
same concept in other commands.
Pick-to: 6.1
Change-Id: Iebd319899f63d79fbe15ce965b84ce324c28a508
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Move the qmake-specific logic of the QLibraryInfo class to
qmake internals. 'qconfig.cpp.in' now stores information about
the library info entries to keep them consistent between qmake
and the Core library. qmake requires specific features enabled
in the Core library, so building qmake will be skipped if the
features are not enabled.
All flags directly related to the qmake have been removed from
Core lib.
Remove all bootstrap related sections from qmake CMakeLists.txt
Task-number: QTBUG-89369
Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Putting each keyword on its own line makes it much easier to read and
improves maintainability. It is friendlier to source control when
keywords need to be added or removed.
This commit introduces no functional change.
Pick-to: 6.1
Change-Id: I79efd039e5afa5f11f1d859405d6487ad6b3beb2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Commit 18fc9e1bf8 introduced a
Windows-only QT_TOOL_PATH_SETUP_COMMAND to make it possible to
call the tool of a module while building the module itself.
The "set PATH=..." command in QT_TOOL_PATH_SETUP_COMMAND was flawed,
because it contained escaped double quotes which made the set command ineffective.
Fix this by removing the escaping of the double quotes.
This was uncovered when porting qtscxml to CMake.
Change-Id: I5909aa841e7895d6d0feb4037a935b805ccfdc99
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In QtSetup.cmake the PROJECT_VERSION_MAJOR variable was used to
identify prefix of 'Qt<version>HostInfoConfig.cmake'.
Qt<version>HostInfo is not found, if project version differs
from qtbase version.
Move the 'INSTALL_CMAKE_NAMESPACE' and 'QT_CMAKE_EXPORT_NAMESPACE'
variables to 'QtBuildInternalsConfig.cmake'. In this case
variables will be exposed for a wider list of internal routines.
Use the 'INSTALL_CMAKE_NAMESPACE' variable as prefix to find
Qt<version>HostInfo module.
Fixes: QTBUG-90345
Change-Id: Ic595d1c5beb74f34e69b58e18590a3afc2f346f7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Move UNICODE and _UNICODE definitions from the public Qt::Platform
target to the private Qt::PlatformCommonInternal target.
Fixes: QTBUG-89951
Change-Id: Ib4c1c4cab74acda0a43c4ddb3cffd3954393dc89
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
If CMake version is 3.19 or greater, use cmake_language(DEFER CALL)
for Qt internal scope finalizers, instead of the homegrown
implementation.
Apart from not depending on the hacky homegrown solution, it
significantly improves the readability of --trace-redirect logs.
Pick-to: 6.0
Task-number: QTBUG-77377
Change-Id: I5ce374bb313865662c536826e86052bc762438b9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
...and include it in QtBuild.cmake.
Commit e8d8b1a5e4 added two different code paths to include
QtBuildInternalsAndroid.cmake.
This was needed, because:
In a top-level build, we must not include files that are not yet
installed. We have the source tree available, and
"${QT_SOURCE_TREE}/cmake" is in CMAKE_MODULE_PATH.
We can use the "module syntax" of the include() command.
In a per-repository build, when building against an installed qtbase, we
must not include files of the source tree, because that's not guaranteed
to be available. However, Qt6BuildInternalsConfig.cmake is installed,
and we can directly include QtBuildInternalsAndroid.cmake, which is
right next to it.
We can circumvent this whole issue by moving the Android-related
functions out of the Qt6BuildInternals package and including it in
QtBuild.cmake.
Pick-to: 6.0
Task-number: QTBUG-88718
Change-Id: I5192ba19bb77952505c20d053d7285f798d16ac5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Updates due to newer compiler version in QNX7.1
Task-number: QTBUG-88300
Change-Id: If9bbc08d49a077d80174a1807e069b5d4ef61c0d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The EntryPoint interface target now contains all the logic
for what flags and optional static libraries to add when the
entrypoint is enabled.
The target property QT_NO_ENTRYPOINT can be used to disable
the entrypoint.
Change-Id: I9b14ff729366cd6307789c969ebd4b2ca19de77d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In multi-config builds (which equals the debug-and-release feature) we
exclude tools of the non-main configurations from the default build.
But we still create installation rules for them. Mark those as optional
to avoid "cmake --install" yielding errors if those tools weren't built.
Fixes: QTBUG-85411
Change-Id: Ic2d3897d1a1c28a715d9a024ec8606fff00e0315
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The value of this variable must be exactly "mkspecs" or end with
"/mkspecs".
Change-Id: I39f83e9660794dfe23f5fd39fb1084b87ba1f140
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For top-level builds it's desirable to have "ninja generate_docs" build
all tools needed to generate the documentation.
This is problematic since the doc-generating targets are created before
the doc tool targets. Thus, we must defer the dependency connection if
the doc tool target is not yet available.
This patch adds the functions qt_internal_defer_dependency and
qt_internal_add_deferred_dependencies.
Change-Id: Ica940b80882e67cb0e0943e95541f7f4d1885948
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add an abstraction over Qt::WinMain (aka qtmain.lib) and
iOS's runtime linker entry point (_qt_main_wrapper).
The Core target will now link against the Startup target on all
platforms, instead of just WinMain on Windows.
The creation and linkage interface definition of the Startup target
is done at find_package(Qt6Core) time via the private call of
_qt_internal_setup_startup_target().
This will add automatic linkage of WinMain to executables marked with
the WIN32_EXECUTABLE property on Windows.
As well as the addition of the '-Wl,-e,_qt_main_wrapper' linker flag
when linking iOS executables.
Qt users can opt out of this behavior by either setting the
QT_NO_LINK_QTMAIN property or variable. This is in line with
Qt 5 behavior.
Task-number: QTBUG-87060
Change-Id: I7d5e9f1be0e402cf8e67e6f55bfd285f9e6b04f4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
As there is no other way of obtaining information about Qt's paths at the
moment, windeployqt is still querying qmake for these information. For a
cross compiled Qt, the proper target mkspec has to be set in this case.
Change-Id: I0b7b7719c9055d432576185ac4f7572a5ba1dd6b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
All usages should be replaced with qt_internal_add_executable instead.
This should fix configuration failure of benchmarks and manual tests.
Amends e0c62a48b8
Task-number: QTBUG-86815
Change-Id: I0791d849998ed9517e32f699d843367949b97cb9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If no mkspec is provided, we default to the macx-clang-ios mkspec when
building for iOS. This ensures that the wrapper qmake script is usable
for building iOS apps with qmake.
Task-number: QTBUG-87218
Change-Id: Ib02b580c8382b04455c9f820163062591d14a15b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qt_apply_rpaths takes into account properties like MACOSX_BUNDLE. This
property might not yet be set when qt_internal_add_app is called, but
later.
To handle that, move the call of qt_apply_rpaths to
qt_internal_finalize_app.
As a result, the installed apps will have 2 rpaths, the $ORIGIN style
relocatable one, and an absolute path one pointing to the Qt
prefix/lib. The last one might be unnecessary.
Fixes: QTBUG-86514
Change-Id: I25e0d695c78c8b5703e94c99cc2457f772721456
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Configure Qt with -DQT_FEATURE_headersclean=ON to enable the
check. There will be separate target for each module include
(e.g. QtCore_header_check), but the check will also be done
when the module is built for the first time.
There are notable differences to the qmake version:
- the build does not pick up anymore default defines or flags from
the module, or Qt. Instead options like -fPIC they have to be listed
explicitly. Also for this reason, we have to skip the vulkan-related
headers from the check, since vulkan/vulkan.h is not necessarily
in the compiler's default search path.
- some checks for nowadays unsupported compiler versions are
removed.
- -Wdouble-promotion -Wshorten-64-to-32 is not added for clang
builds; the qmake code path did never enforce that on CI
machines (it was non-Apple clang only), and the check currently
fails on these configurations.
Fixes: QTBUG-82615
Change-Id: I1cd303677b1472116910b6c27748f96436feb35e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit allows building Qt6's QtBase using QNX 7.1 and a toolchain
file which is almost identical to what CMake has in its documentation:
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-qnx
set(CMAKE_SYSTEM_NAME QNX)
set(arch gcc_ntoarmv7le)
set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER q++)
set(CMAKE_CXX_COMPILER_TARGET ${arch})
set(CMAKE_SYSROOT $ENV{QNX_TARGET})
The only difference is the usage of q++ instead of QCC, which is no
longer present in QNX 7.1 SDK.
Task-number: QTBUG-83202
Change-Id: I51031540721275f2ee83cee9e7df4994a65db0e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The configure argument -qreal <type> maps to the CMake argument
-DQT_COORD_TYPE=<type>.
Fixes: QTBUG-83325
Change-Id: I94970f31ccfb241b1dd4f1d9b6cef25d6684dc05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QtBuild.cmake is huge. Split it.
Move module, plugin, tools, executables and test related functions out
of QtBuild.cmake into separate files.
Do the same for many other things too.
An additional requirement is that all the new Helpers files only
define functions and macros.
No global variable definitions are allowed, nor execution of commands
with side effects.
Some notes:
qt_install_qml_files is removed because it's dead code.
Some functions still need to be figured out, because they are
interspersed and depend on various global state assignments.
Task-number: QTBUG-86035
Change-Id: I21d79ff02eef923c202eb1000422888727cb0e2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The endless saga of fighting with qt_find_package and global target
promotion. In certain scenarios we want to opt out of target promotion
to global scope.
One such case is in qttools with WrapLibClang and Threads::Threads.
Threads::Threads will be found in the top-level scope via
Qt6Dependencies.
WrapLibClang is declared in src/ directory scope, and
then we try to promote it ands its dependencies to the global scope,
via qt_find_package() ->
qt_find_package_promote_targets_to_global_scope().
This fails because we can't promote Threads::Threads due to it being
added in a different subdirectory scope.
Introduce 2 new functions.
qt_internal_should_not_promote_package_target_to_global and
qt_internal_disable_find_package_global_promotion.
The first one is used to disable promotion of targets to global scope
in qt_find_package.
To mark a target not to be promoted, the second function is used.
It will be used by qttools for the WrapLibClang case.
Task-number: QTBUG-85877
Change-Id: If6caf10a94999402026517a623ae29e3ab1eeb7f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Also use the value to actually write it into qconfig.cpp so that qmake
reports the right information.
Change-Id: Icc4bf36b0dc6ad75d93ac16f39e5b361c0ce52b4
Fixes: QTBUG-81289
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Our initial approach to looking for host Qt tools when cross-compiling
to a platform with a different architecture bitness compared to the
host one was to unset CMAKE_SIZEOF_VOID_P before calling
find_package(Qt6FooTools) and then restoring the value.
That works to bypass the architecture bitness test in the
ConfigVersion files, but it also influences the paths that
find_package() searches in, specifically the lib<arch> paths like
/usr/lib64 will not be searched in.
Fortunately since CMake 3.14, write_basic_package_version_file() can
take an additional ARCH_INDEPENDENT parameter. This disables the
architecture bitness test when looking for the package, while allowing
to still search in the /usr/lib64 like paths.
Use it when creating the QtFooToolConfigVersion.cmake files.
One could argue we should actually check if the tool executables could
run on the host system where find_package is called for
cross-compilation.
We could do that in another change if the problem ever arises.
Amends 03aa74e40d
Amends 914b367c7f
Change-Id: I1181ff637ac80064a6a8538170b28a41743fc90c
Fixes: QTBUG-81672
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If the user specified CMAKE_OSX_DEPLOYMENT_TARGET=10.15 for the Qt
build then building projects with qmake failed, because the mkspec
hard-codes QMAKE_MACOSX_DEPLOYMENT_TARGET to 10.14.
We now write QMAKE_MACOSX_DEPLOYMENT_TARGET to qconfig.pri to override
the mkspecs' default.
Fixes: QTBUG-85923
Change-Id: I6a39cfe047ac0f99e1da0ca0728d63c741bd4fed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Apparently CMake encods targets from different scopes with a different
encoding scheme for earlier CMake versions.
CMake 3.16.3: Threads::Threads::@<0x5604cb3f6b50>
CMake 3.18.0: ::@(0x5604cb3f6b50);Threads::Threads;::@
Handle the earlier version approach as well. It needs to be done both
when writing out 3rd party dependencies, as well as for lib prl files.
Possibly in more places as well, but I didn't detect additional
places yet.
Amends 92ee9bd6b8
Task-number: QTBUG-85801
Task-number: QTBUG-85877
Change-Id: Ib348b51b2d623fb50d9080dba2beeb931d47a69c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
For qt_import_qml_plugins to work, it needs to have access to the Qml
plugin targets by the time find_package(Qt6Qml) is called.
To do that, we modify the generation of Qml plugin Config, Targets and
Dependencies files to go into a special 'QmlPlugins' subfolder of the
Qml package.
The Qml package will then GLOB include all the Config files in that
folder, to make them available whenever find_package(Qt6Qml) is
called.
This is similar to how the Qt plugins were glob included in the CMake
integration of Qt 5.15. In fact that glob including is missing in Qt 6
for regular Qt plugins, and should be implemented in a following
change. Currently the Qt Plugins config files that are included are
hardcoded to the list of known plugins at Qt configuration time.
As a drive-by to make this all work, the naming of the various Config
and Dependencies files has been normalized to include the Qt6 prefix.
This is done for both regular Qt plugins and Qml plugins.
Task-number: QTBUG-85961
Change-Id: Id20da72337ca2945fa330ea6fb43535e44a83292
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Static Qt plugins should not be included in the list of libraries of
a prl file. They end up being there due to our circular dependency
trick where the plugins depend on the module they belong
to.
This in turn causes the giant static plugin generator expressions to
be processed in qt_collect_libs(), and the generated prl file ends up
having target names like Qt6::QJpegPlugin which are obviously not
linker flags.
To eliminate the static plugins from prl files, add an additional
dummy boolean generator expression '$<BOOL:QT_IS_PLUGIN_GENEX>'
that always evaluates to true. We can string match on this expression
in qt_collect_libs, and thus remove the whole static plugin genex
entry.
This should fix linking of apps with qmake that use a CMake-built
static Qt.
Task-number: QTBUG-85865
Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: I949dc5edb10d94c4ab84ed430af7c164d8efaaa6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
mkspecs/features/qt.prf adds a dependency on the system threading
library if the Qt Core thread feature is enabled. Because qt.prf is
loaded by any public or internal Qt project, it's essentially a public
dependency for any Qt consumer.
To mimic that in CMake, we check if the thread feature is enabled, and
and set the Threads::Threads library as a dependency of Qt6::Platform,
which is a public target used by all Qt modules and plugins and Qt
consumers.
We also need to create a Qt6Dependencies.cmake file so we
find_package(Threads) every time find_package(Qt6) is called.
For the .prl files to be usable, we have to filter out some
CMake implementation specific directory separator tokens
'CMAKE_DIRECTORY_ID_SEP' aka '::@', which are added because we call
target_link_libraries() with a target created in a different scope
(I think).
As a result of this change, we shouldn't have to hardcode
Threads::Threads in other projects, because it's now a global public
dependency.
Task-number: QTBUG-85801
Task-number: QTBUG-85877
Change-Id: Ib5d662c43b28e63f7da49d3bd77d0ad751220b31
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The include directory in Qt's build directory is always named
"include", no matter what the value of INSTALL_INCLUDEDIR is. The main
reason is that the name "include" is hard-coded in syncqt.
The INSTALL_INCLUDEDIR variable must only affect the installation
location of headers.
Fixes: QTBUG-85893
Change-Id: I5367bc589cba129eb41817e2b58d470f730bb5ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The logic is a bit involved in qmake.
The Qt internal qt_common.prf adds CONFIG += strict_c++ which applies
to qt modules, qt plugins, qml plugins, qt helper libs, winmain and
qt_apps, qt_tools, but NOT tests (which is important because the tests
on Windows MinGW fail to build without the GNU extensions).
Then default_post.prf checks for the strict_c++ value and either uses
the strict or non-strict C++ standard flags. default_post.prf is
loaded for all qmake projects, not just the Qt internal ones.
Now CMake doesn't provide a transitive based option to disable C++
GNU extensions with a mechanism similar to target_compile_features.
It only provides the CXX_EXTENSIONS property and it's associated
CMAKE_CXX_EXTENSIONS variable. We can't set the variable at a
directory scope, because that is too coarse grained.
So we rely on setting the property via a function in every relevant
qt_add_<target> function.
Now the naming of the function is weird.
We name the function as qt_internal_<...>, because it's not meant to be
used by Qt users.
We prepend an underscore to the name because we need to place it in
Qt6CoreMacros, so that the function can be called by
qt_add_qml_module which IS a public function.
That's because in Qt5 load(qml_plugin) was private API, but in Qt 6 +
CMake we decided to make qt_add_qml_module() as public API.
Change-Id: Id014626b087d590e25cb46843f93d0c67fc36e44
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Windows shared library prl files should not have a
QMAKE_PRL_LIBS section. Such information is not useful because it's
not used by the linker as per 523c7e3fd5
Amends 46d7abc9172f82756ccd3641a314dcc066353c3f
Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: Ic40491a568f72c507a16322f6f0c61f98d3a5913
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Apply the same kind of transformations to the contents of the prl
files as we do for pri files. Mainly, transform system library paths
that are absolute, into link flags to make them relocatable across
systems.
Also change the Qt frameworks to be linked via the -framework flags
instead of via absolute paths.
Implementation notes
Move the common required functions for both QtFinishPrlFile and
QtGenerateLibPri into a common QtGenerateLibHelpers.cmake file.
Make sure it's listed as a dependency for the custom commands.
Also make sure to pass the necessary input values like possible
library prefixes and suffixes, as well as the link flag.
Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: I36f24207f92a1d2ed3ed2d81bb96e4e62d927b6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This new function is meant to be used where load(qt_app) is used.
It delegates functionality to qt_add_executable, while handling
some additional behavior via a finalization function (mostly handling
of macOS Info.plist files and icons, as well as Windows icons and
resource files)
It uses a new PlatformAppInternal interface target.
Task-number: QTBUG-85757
Change-Id: I1a2d5851b137fcd4a6323e0e06fb154f91619800
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Our CMake build system only generated working .prl files for
the Release configuration in debug_and_release.
This caused a linking failure when building a Widgets example that
links against qtmain, specifically
qtmaind.lib(qtmain_win.cpp.obj) : error LNK2019: unresolved external
symbol __imp_CommandLineToArgvW referenced in function WinMain
The symbol is located in shell32.dll, which was not linked in, because
there was no qtmaind.prl file.
The fix to generate per config prl files is a bit complicated, because
add_custom_command does not support generator expressions in OUTPUT
and DEPENDS.
Instead we pre-generate 2 files per config, one with the preliminary
prl file content and another file that contains the final prl file
path (via generator expression).
Then we iterate over all configurations and create custom commands
with well known paths, and the final prl file is created by the script
called by the command.
Amends 06557312d2
Task-number: QTBUG-85240
Change-Id: I413b705bc69732b0cbe1ee8cd089a1aef19365db
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
On Windows, if Qt is built with Vulkan support but the user's machine
does not have Vulkan, it should still be possible to configure and
build an application (if the application does not use Vulkan of
course).
When Qt is built with qmake, the special windows_vulkan_sdk.prf file
makes sure not to export build time Vulkan include headers into the
generated .pri files. The same file also tries to find the include
headers via an environment variable. If it isn't set, it just adds a
bogus "/include" include path, which doesn't fail a user's application
build.
This wasn't the case for an application built with CMake, because the
exported Vulkan_nolink target uncodinitionally referenced Vulkan's
target properties. Which means that if the Vulkan package was not
found, the application failed to configure.
To mimic qmake's behavior, make sure to query the target properties
only if the Vulkan target exists, via the TARGET_EXISTS generator
expression.
Apply the same logic to all _nolink targets. This might not be
entirely correct in all cases, but we can revise this behavior later
after more feedback. At the very least it allows building non-Vulkan
based applications.
Task-number: QTBUG-85240
Change-Id: Iffbb03a84e8637ed54d0811433e66fe6de43d71f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Change added dep in qt_add_cmake_library():
PlarformModuleInternal -> PlatformCommonInternal.
Change-Id: I303a6a520f0dda7260b12cb21673b8f1a23d536b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It doesn't understand the arguments we usually pass to testlib.
Change-Id: Iea83d1d8c31a510b2bc442cbfc810eac631322e7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For repositories other than qtbase the QT_STAGING_PREFIX was empty,
because it was only determined in qtbase.
Also, we save the CMAKE_STAGING_PREFIX in the Qt6BuildInternals package
and set this variable if it's not explicitly set by the user.
As with CMAKE_INSTALL_PREFIX this behavior can be prevented by defining
QT_BUILD_INTERNALS_NO_FORCE_SET_STAGING_PREFIX=ON.
Change-Id: I73100abbef24f5d3fb8f82029d0374176edc8048
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fix the conditions in qt_add_simd_part for arch_haswell and the
avx512 profiles to mimic what simd.prf does.
Add missing SIMD flags in QtCompilerOptimization for arch_haswell.
Compute the compile flags for the avx512 profiles from the
profile dependencies.
Remove the special case in Gui that hardcoded the compilation of
qdrawhelper_avx2.cpp to be conditional on avx2 being enabled
instead of arch_haswell. The Gui project already has another
qt_add_simd_part that is enabled if arch_haswell is enabled, which
will now work correctly due to the fixes in qt_add_simd_part.
Change-Id: I7a61a03b5565d4fa438f22b329e0d9dd7acd9273
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qdevice.pri should embed info about the Android SDK, NDK, host,
platform api level and ABI.
The machine tuple test should not be run for uikit and Android
platforms.
Sysroot should also not be prepended for uikit and Android
platforms, otherwise it breaks Qt module include paths.
Task-number: QTBUG-85399
Task-number: QTBUG-82581
Change-Id: Ic48c88f6ab15d75c2ebc323c8d7a3b7e5596f3c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Add the cache variable QT_STAGING_PREFIX that is the same as
CMAKE_STAGING_PREFIX - if it's set, or CMAKE_INSTALL_PREFIX otherwise.
Use the variable in the places where we check for the emptiness of
CMAKE_STAGING_PREFIX to use CMAKE_INSTALL_PREFIX.
Change-Id: I372d57dfa41818c1965b824c59ab3cac80b38f60
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Interface libraries like our Qt header modules should not propagated
private defines which are meant only for building a specific Qt
module, and in the case of a header module there is nothing to build.
Exclude the usual private defines we set in qt_add_module for header
modules. This also fixes the content of header module .pri files.
Change-Id: I0791ebdb73e8b020ddb8116433ed36c7b3d71303
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To achieve this, we save the result of the subarch test in the cache
variable TEST_subarch_result and use this value as the right hand side
of the QT_CPU_FEATURES.xxx assignment. The Qt6HostInfo package now
sets the variable QT6_HOST_INFO_SUBARCHS which will be used for the
host_build scope in qmodule.pri when cross-building.
Change-Id: I2c25f205bfc0692aef0d6f43ff4e542d27e1b948
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Apple deprecated the entire OpenGL API in favor of Metal, which
we are aware of, so we don't need to see the warnings when building
Qt.
Instead of applying the silencing globally for all Qt consumers,
both internal and external, we now limit the silencing to Qt itself.
That means user code that explicitly uses any of the deprecated APIs
will see the warnings. Note that this does not apply to merely using
any of the Qt OpenGL APIs. The user has to explicitly use the platform
APIs that have been deprecated.
The warnings need to be disabled on a build system level, so that
that they are passed as -D flags on the command line. If the defines
were done in Qt headers (qguiglobal.h e.g.), they would require the
user to always include this header before any of the Apple headers.
Change-Id: I3f2a2a5211332a059ad4416394251772c677fdcb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It wasn't possible to create a cross, non-prefix build with
CMAKE_INSTALL_PREFIX set to something else but the qtbase build dir
and CMAKE_STAGING_PREFIX set to the qtbase build dir.
This would be equivalent to
configure -prefix /usr \
-extprefix ~/my/qtbase/build/dir
Fix this by comparing the qtbase build dir against
CMAKE_STAGING_PREFIX if it is set. We also have to adjust the
QT_BUILD_DIR variable in a similar way.
Change-Id: Iaba5cf0f6954ae4b15d8af1fc62634f5d7f68835
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch modifies the two preprocessor definitions
QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and
QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH which are exclusively used
by qmake (and not QtCore's QLibraryInfo) to determine the ext prefix
and the host prefix.
In the qmake build of Qt, qmake considers the host prefix as "location
where qmake is installed". This is usually the same as the ext prefix
but can be modified by the user at configure time.
In the CMake build, we don't build tools for the host but always for
the target platform. The QT_HOST_PATH is an external prefix we never
install to. That means, the qmake we build is always installed into
the ext prefix (CMAKE_STAGING_PREFIX or CMAKE_INSTALL_PREFIX).
Therefore, we can calculate the path of <ext_prefix>/bin relative to
<ext_prefix> and use this value for both,
QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and
QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH.
The "path of <ext_prefix>/bin relative to <ext_prefix>" is equivalent to
just the "path <prefix>/bin relative to <prefix>", meaning we can
safely use <prefix>, which is just CMAKE_INSTALL_PREFIX.
Task-number: QTBUG-84886
Change-Id: Ie1d4628a7049ddfd0d0a56dfe4ee2f2bb4952277
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Building an iOS app with qmake failed because Qt itself was not built
with bitcode enabled.
Enable building with bitcode.
Make sure qrc resource files and bundled 3rd party libraries also
build with the regular Qt module flags and thus with bitcode enabled.
As a consequence gc_sections has to be disabled for UIKIT platforms.
Task-number: QTBUG-82581
Task-number: QTBUG-84781
Task-number: QTBUG-85240
Change-Id: I15fe668725a139c02f2a32a5db849b46d4ce325c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This is required for qmake to correctly pick up and use plugins that
have strange characters in the types (slashes for platforms/darwin
type and dashes for wayland plugin types).
This fixes some issues with trying to build an iOS application
using qmake due to the qiosnsphotolibrarysupport plugin.
Task-number: QTBUG-85240
Task-number: QTBUG-84781
Task-number: QTBUG-82581
Change-Id: I94faf2d3dbbdeb22dbd96dfb11c7bff00645b524
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The EffectivePaths section does not inherit the Prefix value from
the Paths section.
Specfiy it explicitly, otherwise the paths reported by qmake -query
for /get variants ended up containing an extra "./bin/" part, which
ended up breaking building iOS apps with qmake.
Amends d7fd684861
Task-number: QTBUG-85240
Task-number: QTBUG-84781
Task-number: QTBUG-82581
Change-Id: I288a6e76a21d779a7e03443777f8a4ce28df9974
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Promotes qt_find_package()'d targets and their transitive dependency
targets to global scope. This will allow .prl file generation to
access targets in a sibling repo scope.
Retrofits qt_collect_libs() to be a bit more general, so it can be
reused both for prl lib collection, and traversing of dependencies
of qt_find_package() provided targets.
Removes the bail out checks for top-level static builds.
Amends 8c8c0f65e3
Amends dde11715d3
Task-number: QTBUG-84874
Fixes: QTBUG-84917
Change-Id: Id95b4cb7a0887c52f35c40bfdb96ad4a68dd6794
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Show a status message when we run syncqt for a module (gives a bit
more insight into why the configuration seems to stall for a moment).
Remove some uninformative messages about generating config.h files
and Depends headers, etc.
Change-Id: I5ff2774b9cf5d92ddde564dc09f4197c2835ee4a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qmake builds of Qt don't use libraries in /usr/local because the
path is not considered a system path. Only the SDK path should be
used as a source of system libraries.
We should do the same for the CMake builds, which involves a couple of
things.
Tell CMake not to consider /usr/local (and a bunch of other
paths) as system prefix paths.
Disable pkg-config usage which by default is not used in qmake
Windows and macOS builds.
If a user wishes to use libraries located in /usr/local on macOS, they
can explicitly enable the behavior via -DFEATURE_pkg_config=ON.
In addition to enabling pkg-config, that will also disable the system
prefix modification described above.
Implementation notes
To disable pkg-config usage, we set an empty path for
PKG_CONFIG_EXECUTABLE, because there is no other good way. The
downside to this is that a lot of warning messages will be printed
that the pkg-config package can not be found.
The pkg-config feature needs to be computed in QtBuildInternals before
qtbase/src/configure.cmake, because it's too late to do it in that
file where a few qt_find_package calls already exist.
The feature value is also saved to QtBuildInternalsExtra, to make sure
that pkg-config is disabled whenever building another repo.
System prefix adjustment is done by removing paths from
CMAKE_SYSTEM_PREFIX_PATH.
Ideally we would remove also /usr as a path, to match what qmake does,
but that breaks find_program() calls for perl, python, etc.
We have to make sure that qt_find_package does not look in
PATH when looking for packages, which is the default behavior, because
PATH on macOS most likely contains /usr/local.
One last curiosity for future generations is that CMake 3.18+ has
merged a change to prioritise SDK locations over regular /usr/lib.
Fixes: QTBUG-85261
Change-Id: I28fe5bae7997507a83b37b4eb1e0188e64062c57
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This adds the CMake equivalent to the classical -device-option key=value
configure argument:
-DQT_QMAKE_DEVICE_OPTIONS=key1=value1[;keyN=valueN]
The keys and values get dumped verbatim into qdevice.pri.
This patch also ports the machineTuple configure test. Its result is
written into qdevice.pri as value for the GCC_MACHINE_DUMP variable.
Change-Id: I29f2323fd87639fafaed99ec7446c7ee75504705
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's now possible to pass -DQT_QMAKE_TARGET_MKSPEC=foo to cmake. If the
value is not passed, then we will guess the mkspec like we did before.
Change-Id: If6e8324654cb8bd83d3cba9eb6ee1e4ad2692a2c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For a cross-built, gcc-built Qt, the qmake build writes code into
qconfig.pri that adds the --sysroot flag to compiler and linker flags.
Follow suit in the CMake build.
To keep the diff small between the qmake-generated and CMake-generated
qconfig.pri files, the sysroot code is added at the top of
qconfig.pri, which is the reason for the new 'content' string variable.
Change-Id: I50649100e4368be64bf98ca19e46312e3ebf619d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When cross-compiling, we now create a target_qt.conf file that's to be
used with the host Qt's qmake. With "qmake -qtconf .../target_qt.conf"
projects can be cross-built against the cross-built Qt.
We also create wrapper scripts for the host qmake to save the user from
passing the -qtconf argument.
Fixes: QTBUG-82581
Change-Id: Ib5866e7e820369efea9eb3171e3e3e3ca5c0c3c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Before this change, the qt_lib_foo_private .pri files contained
absolute paths to libraries, e.g.
/usr/lib/x86_64-linux-gnu/libcups.so
Whereas the qmake build instead embeds link flags like -lcups.
Detect absolute library file paths, and transform them into link
flags. This should make the .pri files relocatable.
Fix the add_custom_commands to have the scripts as dependencies.
Make sure to pass the suffix, prefix and other options to the
qconfig.pri generation command as well.
Also reverse the order of the link flags, to mirror the order
that qmake generates for .pri files.
Task-number: QTBUG-84781
Task-number: QTBUG-85240
Change-Id: I7bc3b234d9c86c785b169b11f3042450aa225c1f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In a prefix build, this function uses install(PROGRAMS) which correctly
sets the executable bit. In a non-prefix build, we did file(COPY)
without explicitly setting executable permissions.
Now, we're also setting the executable bit for
qt_copy_or_install(PROGRAMS) calls in non-prefix builds.
Change-Id: I283e9aeed2a23016ee196d83d584a7eaaa5edd66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A developer could write 'ninja host_tools' to build the qtbase tools
and their dependencies, and then configure another cross-compiling
build dir pointing to the previous host build. This shortens the
workflow for cross-building when working in qtbase.
Change-Id: I69e70d23ce9df8669bcadf326d0586f097e5cb21
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Rather than embedding the full absolute path to the framework, we
should instead write a -framework Foo flag.
qmake seems to do this by specifying QMAKE_LIBS_FOO in the mkspec.
We'll try to get away with just deriving the name of the framework
from the path, to avoid having to introduce a mkspec equivalent
mapping for CMake.
This doesn't currently handle framework include paths, which qmake
also handled by harcoding QMAKE_INCDIR_FOO in the mkspec, and then
sysrootifying it via mkspecs/common/mac/sdk.prf.
Hopefully that's not really needed, given that -framework flag
should imply include paths as well.
Somewhat partially amends c254254c55
Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I70ea5021422d7b1f5afa9c4a595d1a9b8a8217d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Otherwise the Objective-C++ sources will be built with the default
compiler visibility (visible), and then linked with moc-generated
C++ sources that have the Qt overridden hidden visibility, resulting
in linker warnings such as:
ld: warning: direct access in function 'X' from file 'moc_foo.cpp.o'
to global weak symbol 'Y' from file 'bar.mm.o' means the weak symbol
cannot be overridden at runtime. This was likely caused by different
translation units being compiled with different visibility setting
Change-Id: I22e15e7e181a74de8c0a22c73d06e600e582d7fd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is required for qttools, where the configure.cmake file lives in
the top-level source dir, but the module is in src/global.
The new CONFIGURE_FILE_PATH option allows specifying a different
location for the configure.cmake instead of the default value.
Change-Id: I260d7c93dd49337ebe07ae4cc871394da9e9c2c6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The qml app was crashing when used by qtdeclarative auto tests. It
complained about unregistered QML types. qmltyperegistrar didn't
create registration info for these types. moc didn't output class info
about these types because the build system didn't provide the proper
include paths.
In qmake land, moc was given 2 sets of paths when building a module:
the non-installed framework dirs as -F flags, and also the
$repo_build_dir/include paths as regular -I flags.
In CMake land we only gave include paths to the non-installed
framework dirs as -I flags, not -F flags.
That's because AUTOMOC checks for a specific pattern in the include
paths to transform them into framework include paths
(existence of Foo.Framework/Headers symlink),
and we didn't pass such an include path.
Make sure to mimic what qmake does, and pass -I flags to
$repo_build_dir/include as public include paths, but only via
BUILD_INTERFACE aka when building Qt itself.
Also pass -F flags by specifying framework include paths in the
pattern that AUTOMOC expects.
Fixes the following qtdeclarative tests
tst_qdebugmessageservice
tst_qqmlinspector
tst_qqmlenginedebuginspectorintegration
tst_qqmlpreview
Task-number: QTBUG-84886
Change-Id: Iab9693d9889bf6d2c40fed067ab9b9da8683a053
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We must filter out expressions of the form $<TARGET_PROPERTY:name>, because
1. They cannot be used in file(GENERATE) content.
2. They refer to the consuming target we have no access to here.
The CMake error
Error evaluating generator expression:
$<TARGET_PROPERTY:QT_PLUGIN_CLASS_NAME>
was triggered when building the UiPlugin module of qttools.
Change-Id: Idf639be50120b94d68a70965604e6f1ef72edc9b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Assuage the fears in the previous commit, by actually querying and
using the public defines set on a target, rather than hardcoding one
single QT_FOO_LIB define + the extra namespace define.
This should future-proof .pri file generation for qmake mixing.
Amends 3452b08df6
Task-number: QTBUG-84781
Task-number: QTBUG-84881
Change-Id: Ide68ecf3f89be6d5462cfe43706c27f9cb53394f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
While we recorded the namespace define in the CMake generated Targets
file, we also have to record it in qt_lib_core.pri, so that qmake
knows to use the define when building other modules / apps.
It does scare me what other MODULE_DEFINES we might be missing, and
that we should perhaps put all public modules defines into the
generated module .pri files.
Amends 3452b08df6
Task-number: QTBUG-84781
Task-number: QTBUG-84881
Change-Id: I3175aa9991a06a4541eb0dd153ba2e6e58c019ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Previously .prl files were created via add_custom_command with a
POST_BUILD command. This means they were only created after linking
the libraries, and that whenever a relinking happened, dependees had
to rebuild many parts of their target.
Ideally we would use generator expressions in the OUTPUT argument, but
versions up-to CMake 3.18 don't support doing that.
A workaround is to create and depend on a .prl file name without
generator expressions, and as a side effect also create a .prl file
that does use generator expressions, but don't specify it as an
OUTPUT.
This seems to work well, and improves the dependency tracking issue,
at the cost of one more file copy per .prl file whenever it changes.
Change-Id: I7dd99777fec5a08552503bdbafb6116f93ebe66b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Use ARGN that already has the out_var parameter removed.
Change-Id: I79438caa4333a11493456fa219448ad500518880
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The referenced Qt libraries had paths to the build directory, instead
of the $$[QT_INSTALL_LIBS]/ prefix. The reason was two-fold:
1. QT_BUILD_LIBDIR had the wrong value, namely
"${QT_BUILD_DIR}/platforms/qfoo".
2. The QtFinishPrlFile.cmake script was called with a wrong OUT_FILE
parameter, placing the final .prl file in the build lib dir.
As drive-by change, surround arguments for QtFinishPrlFile.cmake that
can contain spaces with double quotes.
This amends 8c8c0f65e3.
Task-number: QTBUG-84781
Change-Id: I7188b799716576b3296ee7b2d460489867b9967a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Document what qmake expects and what CMake creates by default.
This change should fix qmake mixing for MinGW, where the WinMain
library was called qtmain.a instead of libqtmain.a.
Amends f626c73b28
and 9b0e23ef8a
Task-number: QTBUG-84781
Change-Id: I059db13f8d8a0aab8bd3fc69d4537a2b63687394
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
To make sure qmake generates appropriate rules when building other
applications.
Task-number: QTBUG-84781
Change-Id: I75618575602be820bf20a8067e3a6ee3ff7e7950
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qtremoteobjects has a tool that uses qt_process_qlalr. The function
doesn't have a check to see if the consuming target is an imported
target, to skip doing any work when corss compiling.
Fix it, like we do in qt_extend_target.
Change-Id: Ide389a371aa07225f08689d15125c04d8b0e3916
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Since commit e343affd63 we're creating object libraries for Qt
resources in static libraries. Those must be reflected in the
generated .prl files for static builds of Qt.
In qt_add_resource, we now calculate the install locations of the
object files of rcc-generated C++ files and save them in the target
property QT_RCC_OBJECTS. This property is then passed to
QtFinishPrlFile to write the object file paths to the .prl file.
Change-Id: Ic383892d723d02fc91f712bc2dbcbc90babad074
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A lot of qtdeclarative tests fail due to not finding the
QtTest qml plugin in ${prefix}/qml. This is just the symptom, the
problem is that the combination of CMake + MinGW + Qt relocatability
behaves incorrectly.
The value returned by
QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) for the
qmltestrunner executable is ${prefix}/bin/qml which is incorrect.
This happens due to a combination of things. The
c33916a279 change in qtbase introduced
checks to figure out whether an application is a windeployqt-ed app
to adjust the prefix path.
This check tries to find the import library libQt6Core.a in the lib
subfolder whenever the executed app dir path is equal to the
computed prefix path.
If it's found, the code assumes we are running a tool in
${prefix}/bin. If it's not found, the code assumes it's a
windeployqt'ed app, where the Qt .dlls are next to the executable.
Currently when QtCore is built with CMake targeting MinGW, we actually
create a libQt6Core.dll file instead of a Qt6Core.dll file, and also
an import library called libQt6Core.dll.a, instead of libQt6Core.a.
The prefix check code actually prepends an additional "lib", thus
trying to find the liblibQt6Core.a import library.
This fails, the code assumes a windeployqt'ed app, and returns the
currently executed app path dir as the prefix aka ${prefix}/bin in
the case of qmltestrunner, and thus none of the qml plugins are found.
To fix this, generated the shared library and the import library names
as qmake expects them, aka Qt6Core.dll and libQt6Core.a.
Some of this renaming was done for MinGW plugins and shared libraries,
but not for modules in 9b0e23ef8a.
Extract the duplicate code and apply it to all shared libraries built
by Qt on Windows. Adjust the prefix and suffix accordingly, depending
on whether we use MinGW or not.
Amends 9b0e23ef8a
Task-number: QTBUG-84886
Change-Id: I5a8618597df5f57ce256739adced3f24eb13dac7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The change fixes the labels to show up correctly in the configure
summary.
It also allows enabling the sanitizer via the feature flags, e.g.
-DFEATURE_sanitize_address=ON.
Finally the qtbase sanitizer option is saved in QtBuildInternalsExtra
so that repos built after qtbase have the same sanitizer options
enabled.
Change-Id: Ic9d9e3ce3c7ebbc244ced2e6d163d1ac8ee06b12
Fixes: QTBUG-84721
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
To successfully link plugins of a static Qt build into a Qt project we
need to generate .prl files for the plugins.
Task-number: QTBUG-84781
Change-Id: I1406052f2269050aa7cbe6aa2b546bece1c68467
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In qmake land the define is set in mkspecs/common/macx.conf which
means it should be public for all Qt consumer apps as well, not just
internal targets. Make it so.
Amends 17be43c58e
Task-number: QTBUG-83929
Change-Id: I9f9d7dfca24b54977cb8364723c3618d3fec2e73
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.
The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.
The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).
Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This mirrors what qt_tool.prf does.
Task-number: QTBUG-83929
Change-Id: I892a3f5f62d461456abfa414718fcc4c4c05c012
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Like in the qmake build, we now set the target description of a Qt tool
to a value, different from the description of the Qt libraries.
Fixes: QTBUG-84900
Change-Id: I93419ddd513c83fe8488e70b5a8328cadc3541c7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In a qmake build this file serves the purpose of setting the right
prefixes for the build directory's qmake binary. This can be used to
build Qt repositories other than qtbase, esp. in a top-level build.
In the CMake build, we don't have qmake top-level builds, and we do not
support building Qt repositories with the build directory's qmake binary
(exception: non-prefix build).
To build a Qt module or user project with qmake, the installed qmake
must be used.
This fixes qmake for non-prefix top-level CMake builds.
Change-Id: Ibd10c36e8359225553d782d0c8117760db9f3370
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In static builds, due to our CMake design for auto-linking plugins
being incorrect we sometimes cause link failures on Linux in leaf
modules, because the link line order is incorrect.
So far such failures were fixed by explicitly modifying the order of
libraries on the link line in each failing CMake project.
This proves to be problematic because the failures appear in seemingly
random integrations that don't even touch the build system parts.
Until we fix the design, another less performant but more
general / safe way is to increase the link interface multiplicity,
which causes a cycle of libraries to be repeated more than 2 times
on the link line, thus giving the ld linker more chances to figure out
which symbols are needed for linking.
Implement this for Linux static builds to avoid random integration
failures for people that know nothing about this issue.
The link multiplicity for all qt modules is increased to 3, thus
QtGui would be repeated 3 times on the link line of each dependent
library. The value is also configurable via the
QT_LINK_CYCLE_MULTIPLICITY cache variable.
Task-number: QTBUG-83498
Change-Id: I2fd2bb2b5e7fec4e3ef5d1194668b524d20f7067
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It used to be called HAVE_DASH_UNDEFINED_ERROR, but that always
cause Coin to print the compile check as the first build error snippet
because it contains the word "error", and whenever you get emails from
Gerrit the first snippet is always this compile check.
Rename it to avoid confusion in emails and Coin status reports.
Change-Id: I5487623abf9df177b100d2b45635688504f0e25a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>