The standalone build of the sqldrivers plugin never called the SBOM
project begin and end functions.
This cause an error in qt_internal_add_plugin which tried to read the
SBOM project name.
Replace the calls to qt_prepare_standalone_project and
qt_print_feature_summary with qt_build_repo_begin and
qt_build_repo_end.
This ensures the SBOM project is setup, as well as many other
behaviors that a standalone internal build of a module is expected to
have.
Additionally we need to tell the SBOM project where to find the
licenses for the standalone build. This is done by setting the new
QT_SBOM_LICENSE_DIRS variable to the qtbase license directory.
Fixes: QTBUG-131799
Change-Id: I2e31ecffdff28561d1c4a6b8fbcd8125188d2c48
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit df30953228f0e364e9a3915d97f522efd8e67489)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use plain string find instead since paths containing special regex
symbols, give either the invalid MATCH results or lead to regex
compilation error.
Pick-to: 6.5
Fixes: QTBUG-116042
Change-Id: I9deb2fe760843c9be1e622cf2216c6dc81d73e71
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 41b72465d83af147cef4d560756ced2b457955ec)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use string(FIND) instead of if(MATCH) since paths containing special
regex symbols like "+", can either cause an invalid MATCH result or it
can lead to regex compilation errors like
RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
Amends 6e7f871edfd35174b40c7eb7386282bfe019f276
Fixes: QTBUG-131782
Task-number: QTBUG-122899
Task-number: QTBUG-130557
Change-Id: I59a2c3e4fe2431303c7cbca8fd54360f254da90f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9cb0d48aae81c5436bda783b64721d0b77bc3f6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add entries for the cmake 3rd party files, as well as mimetypes
and gradient gen.
Task-number: QTBUG-122899
Task-number: QTBUG-131477
Change-Id: I22f243798d66422a0b52aa37532eba2b3210c98d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cecff9ec41ca9387386215540cb851ca8b65e2a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently we have two options that allow overriding the minimum CMake
version required to either build or use Qt:
- QT_FORCE_MIN_CMAKE_VERSION_FOR_BUILDING_QT
- QT_FORCE_MIN_CMAKE_VERSION_FOR_USING_QT
These options require specifying an exact CMake version that should be
allowed, which is a bit cumbersome.
Introduce two new options that allow using any CMake version without
specifying the exact version.
- QT_FORCE_ANY_CMAKE_VERSION_FOR_BUILDING_QT
- QT_FORCE_ANY_CMAKE_VERSION_FOR_USING_QT
Also introduce a Qt CI specific check that would allow using any CMake
in Qt's CI Coin, to allow decoupling of the minimum CMake version bump
from the provisioning of the new minimum CMake version.
This check should only be enabled temporarily, and then reverted back
once the provisioning is done.
The current change has the check disabled, it will be enabled in a
follow up change, so it's easier to revert.
As usual, using any of these options is not officially supported.
Task-number: QTBUG-131169
Change-Id: Icc3f51ad457ebf8f4251309be97e72a3ff4cd2e0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit df7091d9f4cf7849cfc91f4987b2ad8cda141e0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We might want to raise the minimum CMake version for building or using
Qt, while keeping the minimum and maximum CMake policy NEW values
lower than the CMake min/max versions, because bumping the policy
values requires more testing.
Previously we always used the min cmake version as the lower range
for the policies.
Split QT_MIN_NEW_POLICY_CMAKE_VERSION and
QT_MAX_NEW_POLICY_CMAKE_VERSION
into per-type variables:
- QT_MIN_NEW_POLICY_CMAKE_VERSION_QT_SHARED
- QT_MIN_NEW_POLICY_CMAKE_VERSION_QT_STATIC
- QT_MIN_NEW_POLICY_CMAKE_VERSION_QT_APPLE
- QT_MAX_NEW_POLICY_CMAKE_VERSION_QT_SHARED
- QT_MAX_NEW_POLICY_CMAKE_VERSION_QT_STATIC
- QT_MAX_NEW_POLICY_CMAKE_VERSION_QT_APPLE
And change qt_internal_upgrade_cmake_policies to use the min new
policy as the lower range, instead of the min cmake version.
Task-number: QTBUG-131169
Change-Id: Ib39a377edf20e497dc8f7d742b48d102a66c6a95
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 572a313bb9678a920f5c59617b8a15a7b4866a7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously we used the TARGET_FILE genex as the destination where
to place the extracted dSYM bundle of an app in the build folder. For
Qt apps that have the MACOSX_BUNDLE property set, this is incorrect,
because it placed the dSYM bundle inside the app bundle.
We then manually install the dSYM bundle to the correct location.
Because the build folder app bundle still contains the dSYM
bundle, and CMake copies the entire app bundle dir when installing the
app, this resulted in installing the dSYM bundle twice.
Aside from waste of space, this is also against the Apple guidelines,
and leads to certain issues with code-signing.
Check the MACOSX_BUNDLE property to determine if the executable is a
bundle, in which case treat it the same way we treat framework
bundles, by placing the dSYM bundle next to the app bundle.
Change-Id: I7fb8fe49e0b26d0df8a32fc82530bbee32b51382
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a60d42d873e67281e5e30bcaa3daa2f8edffe7eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently the separate debug info handling is done inside the call of
qt_internal_add_executable. But there might be extra properties set
after the executable is created, which we might want to consider when
handling the separate debug info, like whether the executable is a
macOS bundle.
Introduce a new qt_internal_finalize_executable finalizer. Move the
separate debug info handler to be called in this finalizer.
To be consistent run the separate debug info handler in a finalizer
for qt tools as well.
Change-Id: I46412249aaab099628a50b11efff541f5719aff5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit aa06c8dbfa0fc4bf573ef7be7706a76d812bae55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This will allow merging the updated toolchain, otherwise qt5 fails
to find OpenGL and friends. The whole block will be removed once the
toolchain file is merged.
Task-number: QTBUG-128455
Change-Id: If355b1c6360dba7b3567023430785c6d109f9fe8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c0b9dc00145a6d2123b99ab8b1de692af5ead39a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously we ran some finalizer functions for tests and manual
tests, only for specific platforms, and via different code paths.
This change introduces a new unified way of running all finalizers for
all test-like executables, including benchmarks.
To ensure a smoother transition, the new way is opt-out, and the old
way can be enabled by setting the QT_INTERNAL_SKIP_TEST_FINALIZERS_V2
variable to true in case we encounter some issues in the CI.
The finalizers are only run for test-like executables, and not all
internal executables, because there are some unsolved issues there.
One particular case is in qtdeclarative where that will create a cycle
for qmlimportscanner to depend on itself.
A proper solution here would be to have some kind of mapping or
mechanism to exclude finalizers for targets where they would try to
run themselves.
Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I52b3a1c02c298c4a18ce2c75d7e491ae79d191a0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 25f575e8513a7e49ac73c7e1cb24dcaf3803358e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This will be used in a follow up patch to identify them.
Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I39d5eb9f79ac67af0808efeda4d7f4e0a6908cc9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit df040fb1115071fbea80213814b7dc34b17ba085)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The QT_ANDROID_DEPLOYMENT_SETTINGS_FILE was originally queried and
checked as part of the following commit
080f9ad160
because it was meant to be passed to the test runner executable.
The deployment file argument stopped being passed to the test runner
as part of 29b17fa335 whereas the
check was left in the code.
This check causes problems when trying to allow running deferred
android finalizers for tests, because the deployment file is set only
in the finalizer, but the check for the deployment file existence is
done earlier when trying to get the test runner arguments.
Remove the query and the check for QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
because they prevent the above use case, and also don't serve any
purpose in the given function scope.
Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I6e620e452359c94cc7896a98ac5872221f6bb9a2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 412e08106c050cd6b3f6bdf4d9303850c32f6232)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
CMake 3.31 introduced CMP0177 that warns if an install destination is a
not-normalized path. Fix this by normalizing the offending paths before
using them.
Change-Id: I1586bf192a4fd26108aa0448431f19e69df8aacd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 14fc7f0852903109fed8357e2df9edc851f31b65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CMake 3.31 introduced the policy CMP0174 that triggers a warning if a
single-value argument is passed to a function without a value.
We did this doing this when forwarding arguments in code that doesn't
use _qt_internal_forward_function_args yet, e.g. in qt_internal_add_app:
qt_internal_add_executable(...
TARGET_PRODUCT ${arg_TARGET_PRODUCT}
...)
Forward the warning-triggering arguments with
_qt_internal_forward_function_args now, because that only forwards used
arguments.
In the future, we can offload more forwarding work to the
_qt_internal_forward_function_args command and simplify the forwarding
code in qt_internal_add_app and qt_internal_add_tool. This patch only
fixes the worst offenders for now.
Change-Id: Ie786691e4b236decf4c62f4dd0751ed76b721177
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 18a217af4a50afd707ed2caed4880d0da19ee120)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those files are read by reuse to complement or override the copyright
and licensing information found in file.
The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.
[1]: https://reuse.software/spec-3.2/
Task-number: QTBUG-124453
Task-number: QTBUG-125211
Change-Id: I01023e862607777a5e710669ccd28bbf56091097
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4c83657448f66ac0ee46900aff2e5a230eda49b0)
Create a script that allows running an app or a test easily similar
to running on host. This improves development workflow and time by
allowing quick runs without having to manually call the various adb
commands to launch, get a pid of the app and then print the logcat,
let alone passing parameters or environment variables.
For normal apps, the app package name is retrieved by the script, run
and live logcat is printed as long as the app is still running.
For tests, the script calls androidtestrunner, allowing test parameters
to be passed to the test.
For CI debugging, this would save quite a lot of hussle and frustration
trying to run or debug a test app.
One other benefit for this is enabling running Android tests from Qt
Creator's testlib plugin without big changes to Qt Creator to support
androidtestrunner explicitly.
Because file(GENERATE) would fail if called twice for the same file,
I use file(WRITE). This is used because at the time of calling the
target executable finalizer, we don't know if the target is a test
or not, so we rely on writing the script first as a normal target,
then call it if the target is a test where it overrides the script.
For this also, parameters passed to the runner or androidtestrunner
can't handle generator expressions.
[ChangeLog][CMake][Android] Add wrapper scripts to run Android apps and
tests with ease from the host.
Task-number: QTBUG-129889
Change-Id: I84e85ce2bbf6944c8aa20bdc2c2b6d7b956bc748
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a905d26f14da1cf86b8490331c0cc41c2a45b283)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Add doc_tools and install_doc_tools custom targets.
These are meant to build and install documentation and code generation
tools that participate in documentation generation.
Such tools should be annotated with the IS_DOC_TOOL option to their
qt_internal_add_tool call.
In qtbase, such generator tools are qdbusxml2cpp and qvkgen.
Task-number: QTBUG-91243
Task-number: QTBUG-128730
Change-Id: Idebffc6f50d8547ce76c1102a20d60d436e44cfd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3066e9e38deada5f99a47449e4ef84eebc5219f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was duplicated across a few public API.
Splitting it will also allow it to be be reused in a future change
in another function.
Also add the ability to use the poor man finalizer approach for
CMake 3.16, but only via an opt-in that will be set by the qt build
process, so that the finalizers can be used for tests in a future
change.
Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I097faf5e3db98457acfdfb3ae2011efb6640f35e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2bbc0bda30e0c34ea63f0b6836c34c765a06e049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We offer a build target called 'host_tools' to build just host tools
and their dependencies within a Qt build, but it was not possible to
easily install the built tools.
Add convenience custom targets called 'install_tools' and
'install_tools_stripped' to install the host tools when building
a static Qt build.
The convenience targets will be useful for qdoc static builds, to
easily be able and install the tools, without having to specify each
tool's install target separately.
The current approach doesn't work for shared Qt builds because it
would necessitate tracking the libraries that the tools depend on, so
those are installed as well.
So for now, this is limited to static builds only, where there
are no shared library dependencies that have to be installed.
The implementation passes 'host_tools' as an installation component
for qt_internal_add_tool installed targets. The custom target then
just calls cmake --install with the component name.
Task-number: QTBUG-91243
Task-number: QTBUG-128730
Change-Id: Ic047ec3b8683043f496b4b2c3cf883a3e70440b3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c64190caa7d515e0efc60a3c435d9d779efd5ac3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a new QT_OPTIONAL_TOOLS_PATH cmake variable that can be set
to a path where some of the documentation generation host tools might
be located.
This allows using specific builds of qdoc, qvkgen, qdbusxml2cpp and
qtattributionsscanner for documentation generation.
QT_HOST_PATH wouldn't be sufficient in this case, because it requires
all host tools to be installed for the given path, otherwise
configuration will fail
In contrast with QT_OPTIONAL_TOOLS_PATH we can specify the paths only
for the tools listed above, while continuing using other build tools
from the usual locations, either built or found.
As a drive-by, fix the usage of CMAKE_EXECUTABLE_SUFFIX to be based
on the host platform.
Task-number: QTBUG-128730
Change-Id: I2796be3a9772b106788ce63a4aed890516e8b716
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit aab8b7727d8acff989dbdf9b01ca7fb2b12da541)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A new QtBuildStaticDocToolsScript.cmake script is added which:
- clones qt5.git
- initializes required submodules for building doc tools
- checks out qttools/dev/HEAD
- syncs the dependency SHA1s as specified in qttools'
dependencies.yaml file
- configures qt5 as a top-level static build
- builds qdoc and other tools required for documentation generation
- installs them into a custom prefix under a subdirectory of the
repo's root build dir.
The script is intended to be used as part of qtbase's CI build
instructions. See the follow-up coin change for reasons on why we want
to do that and how to configure optional ref pinning, instead of using
dev branch always.
Task-number: QTBUG-128730
Change-Id: I836fc2f1b47c07171d2a2bd54a85bc2145212e46
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f7f02c791bcbee44597f1fe24570ebdf352ec648)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The full set is needed, on all platforms, so that we can use them
during documentation builds.
Pick-to: 6.5
Change-Id: Ie555094a8e365fada7e43da6899e312d774eadb2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 179982a81a292bfe3f9dc16888f7c9777f1b2251)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allows us to pick up these defines when building documentation on
non-Apple platforms.
Pick-to: 6.5
Change-Id: Icd1029e87a56ecfa81875f024a7d959250cd9bbe
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 0c1c3dfad2cf435bde81c11545ad28b73956253c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Useful to base documentation on data known to the build system,
such as the macOS minimum deployment target.
Pick-to: 6.5
Change-Id: I280f3b34e935c878321c24936a52dce406fdf014
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit db9bd4ab3ba80d8bd31fcdb3fc6f93ed8332a9f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a manual cherry-pick from
5efbfcb032d801c7083d4a850d0279a075de7f1a
The function allows setting additional permission attributes like
minSdkVersion and maxSdkVersion. The function's implementation is such
that it should work alongside the older way of directly setting the
QT_ANDROID_PERMISSIONS target property.
Task-number: QTBUG-129944
Task-number: QTBUG-117358
Task-number: QTBUG-112164
Change-Id: I0f40692574848fccdf65f9baedd14351917ce4bf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5efbfcb032d801c7083d4a850d0279a075de7f1a)
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The _qt_internal_finalize_batch function had a bunch of problems,
style-wise and function-wise:
- it called find_package(Qt6) in its body, which broke when
configuring qtbase with in-tree tests
- it constantly rewrote the merged blacklist file on each
reconfiguration
- it used file(WRITE) to concatenate content
- it was in the public API file
The changes are:
- Move the function to the internal test helpers file.
- Change it to use qt_configure_file instead of file(WRITE).
- Call it at the end of the qt_build_tests for a repo, or at the end
of configuring a super build, instead of relying on a finalizer.
- Remove the find_package call. The reason this was added in the first
place, was to populate the __qt_core_macros_module_base_dir variable
so that qt_internal_add_resource configure_file call doesn't fail in
standalone tests build.
The variable was unset because the finalized function was called in
the top level directory scope, whereas the very first find_package
call was in the tests/ scope, meaning the variable was empty.
This is still a problem in the top-level build where the tests scope
and the top-level scope are different. Work around it by relying on
a global property to reset the value if it's empty.
Amends 6a9e89121d
Change-Id: Id6fe41ee86d09b8118bea52cac8a59965d7ecb9e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c997e3bb8b4a35a729f1c207b01385d1323cad2b)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It causes the SBOM to be non-reproducible, as the path is different on
each machine.
Embedding just the compiler id and version should be sufficient.
Task-number: QTBUG-122899
Task-number: QTBUG-130557
Change-Id: Iad66ac3f90c4969d27307c77bef46d2eba15c175
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d7fb9bfb800a3bae41a5f6a73c598f859848b98c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Filter out source files that are not actually sources, like pkg config
files and json.gen files.
To make the output more reproducible, replace the absolute source and
build directories with relative paths prepended with a marker like
/src_dir/ and /build_dir/.
Apply this to source file paths and to qt attribution json file paths.
Genex wrapped sources still need to be handled, but that will come in
a later change.
Amends 37a5e001277db9e1392a242171ab2b88cb6c3049
Task-number: QTBUG-122899
Task-number: QTBUG-130557
Change-Id: Ic38cd9df827c1da770c1f337bc4725748bed5560
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6e7f871edfd35174b40c7eb7386282bfe019f276)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It appears that the VxWorks linker behaves similarly to GNU ld, where
the order of link libraries on the command line matters.
Our plugin linking system is not ideal (due cycles like Gui -> plugin
-> Gui, or Qml -> qml plugin -> Qml), and can change the order of
the linked libraries on the command line.
Due to that, some of the qtdeclarative tests fail to link with
undefined symbols in Qml.
Apply the same workaround we did for Linux, which is to increase the
LINK_INTERFACE_MULTIPLICITY of Qt modules to 3, effectively ensuring
that each qt module static library appears at least 3 times on the
link line, given the linker more chances to find relevant symbols.
Amends 58a7e4f0bc
More in detail reasoning explained in commit message of
69b27e09f55e63a713ca8b14f162d4f449c8dfff in qtquick3d
Fixes: QTBUG-129113
Task-number: QTBUG-83498
Change-Id: I7ac5665d4dd2865584ba1c96d51fd311ef224d10
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8c49dc9bfc388f7a850d33201f0165949481a18f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It should be STATUS instead of NOTICE, otherwise in a non-developer
build where the default logging is quiet (log-level == NOTICE), the
output might confuse builders that those flags are used for the build
of Qt, rather than the architecture extraction project.
Fixes: QTBUG-130294
Change-Id: If2ee50b47d46b00dc55c5423700749ab142bbf7c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 674475887c6e4aeb82000e64657a69366cc9c7a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Our QtPluginConfig.cmake.in files have code to skip loading plugins
unless the repo is found in the QT_REPO_DEPENDENCIES variable
or when building standalone parts.
The problem is that QT_INTERNAL_BUILD_STANDALONE_PARTS is only
assigned a value after all the find_package calls have executed,
which is too late for the qtsvg standalone tests, because the svg icon
config file would already be loaded and skipped.
This code path checked for QT_BUILD_STANDALONE_TESTS, before the
introduction of the QT_INTERNAL_BUILD_STANDALONE_PARTS variable.
QT_BUILD_STANDALONE_TESTS is set by the qt-internal-configure-tests
script, so it is always available.
Restore the previous check for QT_BUILD_STANDALONE_TESTS, while
keeping the new variable as well.
This fixes the tst_qicon_svg test to pass in a static standalone tests
build.
Amends 62905163bf
Restores behavior of be1ee03a0f
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I19f620a39fe530bf7f96498cfad1c90621983eb6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit c0e07cc3e2817d158d05e69e1254471ff6b074e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Qt is configured using the configure script, rather than directly
via CMake, we can obtain the full list of configure arguments passed
from the config.opt file.
Add the configure line to the repo project SBOM package comment field
when it is available.
Task-number: QTBUG-122899
Change-Id: I0c5554dcda2f71ec4ba034b14c82a99757dc790c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b6ee361bc7540db36c334fea0b9d355fbed9a2a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously SBOM generation was opt-in.
This patch changes the generation of the plain-text tag:value SBOM
to be enabled by default, except for:
- developer builds
- no-prefix builds
- standalone tests or examples
- cmake build tests
The JSON SBOM generation and the verification steps have also been
changed to be enabled by default, but only if the Python dependencies
can be found. If the dependencies are not found, the build will
skip the generation and verification steps.
Four new configure options have been added to control these aspects:
-(no-)sbom-json: Allows explicitly enabling or disabling JSON SBOM
generation
-(no-)sbom-json-required: Fails the build if JSON SBOM generation
Python dependencies are not found
-(no-)sbom-verify: Allows explicitly enabling or disabling SBOM
verification
-(no-)sbom-verify-required: Fails the build if SBOM verification
Python dependencies are not found
There are corresponding CMake variables for each of the configure
options, see the cmake mapping document.
[ChangeLog][Build Systems] SBOM generation is now enabled by default,
when building Qt, except for developer builds and no-prefix builds.
JSON SBOM generation is enabled by default if the required Python
dependencies are available.
Task-number: QTBUG-122899
Change-Id: I6dbe1869f8342154a89ff2ab84ac53c9ef1b2eb7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 96c5e55c111d957bd7b5294d2c2eb1d919cce871)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This will allow us to run only the first, but not the second, if the
second won't have it's dependencies met.
Task-number: QTBUG-122899
Change-Id: I141b4bd3b76a71495c760a118bdf1397ee7e16b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f15b3c864ee47177d4f13cf7a047f245c11c4d00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a bunch of helper functions to split out the finding of a
specific python interpreter, a specific python dependency within a
given python interpreter, and the handling of dependencies for each of
the possible SBOM operations: GENERATE_JSON, VERIFY_SBOM, and
RUN_NTIA.
In a future change this will allow us to conditionally enable certain
operations, depending on which dependencies are available, without
failing the build outright.
One behavior change is better logging of what goes wrong if a
dependency is missing.
Another is the double look up of python on macOS, to account for the
system framework python not having the required dependencies.
These was previously an internal opt in, but now it is done
automatically.
Task-number: QTBUG-122899
Change-Id: I3054f2649c0092dc5f2d3e299065f0f62dc6c5fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 29a435faf84fbe9a80a3054c2dcce4d691b46e20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The DESTDIR env var needs to be evaluated at install time, not
configure time, so the $ENV{} needs to be escaped in the generated
script.
Also improve the error message a bit, to say which path exactly it
expected to read.
This fixes SBOM generation for the debian package builds.
Task-number: QTBUG-122899
Change-Id: I6869f0054601dcb35ae7ad7b55f808df4dc12311
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 08d5d9e9da8a4815be7dd2c952cb45a6597cc077)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise the spdx id recording function might fail when trying to
retrieve the spdx id from the non-existent target.
Task-number: QTBUG-122899
Change-Id: I1f6b3d7bc88ff4aa28de1468cd86152747cc3bdb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4e120f265cc5d96399b01402ed53568abecde3d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Due to various reasons, Qt WebEngine needs to be built with clang-cl,
while qtbase and other dependencies with MSVC.
clang-cl does not understand all MSVC-style options, which are
recorded and propagated through the PlatformCommonInternal target
which is configured in qtbase using MSVC.
Guard the flags that are not understood by clang-cl with a genex
condition that checks that the compiler is not clang (which implies
clang-cl, because afaik it's not possible to use gcc frontend of clang
against an MSVC-built qtbase).
Change-Id: Ibf2c96399a8322ce13814c9c6afa5b57fd8885be
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 515ad07a12c4bf190545ae38eff588f7b979d68e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The macro sets the Qt related PATHs and attempts to call
execute_proccess command in resulting environment. This command should
be used to reproduce the _qt_internal_generate_tool_command_wrapper
behavior for execute_process. Since we may control the environment
during the CMake execution, there is no need to use a proxy batch
script to configure it.
The use of tool command wrapper in execute_process has a potential
issue related to the invalid command line processing. cmd.exe is
unable to parse command line correctly if the first argument is batch
script containing spaces and the follow arguments contain spaces as
well. execute_process internals use API that has exact same behavior.
Task-number: QTBUG-128420
Pick-to: 6.7 6.5
Change-Id: I2339c85ed611da89176629878db550b7b7976367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b68b3e773c68b577c55db76ca5c211e919ae8136)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Can be useful for non-Makefile and Ninja generators, even if they
are unsupported for building Qt.
Change-Id: I02a622c89f725c3ae5b51ea345a530eaa5529976
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 08d1d113f140b1b4be5a387696a8a35934905d64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise the SBOM is not regenerated if the attribution files are
modified.
Task-number: QTBUG-122899
Change-Id: I5b3f62e254aa70021ed06fac73f881bcbb110c31
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e579b2884e68292e535bc773502f68ad083860cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After 4dce218ac400afcb54aa2a85a0b27947fec583cb got merged, we started
considering the INTERFACE_LINK_LIBRARIES property of UNKNOWN_LIBRARY
targets in addition to INTERFACE_LIBRARY targets, when collecting
dependencies for pri file generation.
These can contain genexes like $<LINK_ONLY:...> or
$<TARGET_OBJECTS:...>, which are not supported by file(GENERATE),
or special directory scope tokens like ::@, which are not valid
targets or library names.
One such case was in the downstream vcpkg build of Qt which adds
`$<LINK_ONLY:EXPAT::EXPAT>` to the INTERFACE_LINK_LIBRARIES of the
Fontconfig::Fontconfig target.
We strip or handle these cases for prl file generation as part of
calling __qt_internal_walk_libs.
Change the pri generation to handle them in a similar manner by copying
over the same logic.
Amends 4dce218ac400afcb54aa2a85a0b27947fec583cb
Fixes: QTBUG-129471
Change-Id: Id4a574ee2411f6d64179c419f352168fde1914d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 93df3de1f30b6f65b025b33e9cd73ad479295e59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Solaris requires the ssp library to be linked when
-fstack-protector-strong is passed to the compiler.
Fixes: QTBUG-129085
Change-Id: I55396fd9dc102ffd98bef54fc3dfc1aadf18a404
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 73875b8bb5faf9f6ec1064704efaae76e33b0e35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Even though we set foo_ROOT in the provisioning scripts and CMake is
picking it up as the base dir, we should also use it as CMake variable
so we can look in other directories below foo_ROOT.
Change-Id: I193d8ff1c216a669162569d71891c3eb7b9b030f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c68277c41b99d6791e3c1a5998b70c6cbbf6dc15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a user accidentally passes 'CMAKE_OSX_ARCHITECTURES=x86_64;arm64'
to configure on a Linux x86_64 platform, the build would fail when
compiling qdrawhelper_avx2.cpp.o either due to an architecture
mismatch, or due to not recognizing the -Xarch flag on older gcc
compilers.
Only add xarch flags to SIMD compilation on Apple platforms.
Change-Id: I322316979626b04cb0378f4dbf3cc26ec96183ac
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
(cherry picked from commit 3f3d8604e6ed5b6854301f4a3c4799cfa256d8b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We cannot use the fancy options in PlatformGraphics since user projects
lack of their evaluation in QtPlatformSupport.cmake. Use the explicit
CMAKE_SYSTEM_NAME-based conditions instead. Those should work if
respective CMAKE_SYSTEM_NAME is specified in the toolchain file.
Amends 3322f585eb5ad11acc1f93ecaafb42e30e37b197
Change-Id: Ifb6ced360e8cade7315b2b238837578bfc9a1bc3
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 43cac6eaa90897e50daf6105b19528b82bf776aa)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add the unified PlatformGraphics module, which looks for either Integrity
or VxWorks platform graphics.
The PlatformGraphics module creates the interface
PlatformGraphics::PlatformGraphics target which links the respective
platform graphics target. It's expected that from the platform graphics
targets to deliver the consistent subset of definitions, libraries,
include directories, compiler and linker flags and also the special
<platform>_REQUIRED_<LIBRARIES|INCLUDES|DEFINITIONS> variables.
The <platform>_REQUIRED_<LIBRARIES|INCLUDES|DEFINITIONS> variables are
consumed by the PlatformGraphics::PlatformGraphics and stored in the
respective _qt_internal_platform_graphics_required_<type> property, to
access the value without scope limitations. The property then is
checked by the EGL and GLESv2 modules(this can be done elsewhere too)
and is appended to the CMAKE_REQUIRED_<type> variable before running
the respective compiler checks.
Task-number: QTBUG-128455
Change-Id: Id1987c6294327509a14fbeeb7b8bf39aad6f486c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
(cherry picked from commit 3322f585eb5ad11acc1f93ecaafb42e30e37b197)