206 Commits

Author SHA1 Message Date
Alexandru Croitor
5220685a11 CMake: Fix capturing of x86intrin compile test output
TEST_x86intrin_OUTPUT is not set anymore since we lazily evaluate
compile tests after 605913f9d7a60461939c1a8fb8dac05054cade2d .

Use the new qt_configure_add_report_entry
COMPILE_TESTS_TO_SHOW_ON_ERROR option to dump the test values in case
of an error.

Amends 9e9099865a0881ac5bb6035237e0a0c86962c45f

Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-122596
Change-Id: I48d1c57145ad5d9418631025927581c4eb5ec93c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-04 19:08:14 +02:00
Joerg Bornemann
dc2a73cef5 CMake: Mention "Force assertions" in config.summary
...but only if the feature has been turned on explicitly.

Fixes: QTBUG-135026
Change-Id: I4125d26b00ec14511ada5c973ffe7616a24e673c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-03-25 00:29:48 +01:00
Joerg Bornemann
9f86517cce CMake: Remove superfluous precompile_header feature and config test
Whether precompiled headers are used during the Qt build is controlled
by the CMake variable BUILD_WITH_PCH and the qt_auto_detect_pch
function.

The precompiled_header feature wasn't actually used. Remove it and the
corresponding configure test.

Fixes: QTBUG-134425
Change-Id: I9b2ff9cbcf4888899b6a39d22d260388a9375c5c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-03-07 12:02:47 +01:00
Joerg Bornemann
9df20860de CMake: Fix -no-prefix build with CMake < 3.26 on macOS
On macOS, Core has plugins that link against CorePrivate. In a
non-prefix build, user projects failed on find_package(Qt6 REQUIRED
COMPONENTS Core), because CorePrivate is required for these plugins in
a non-prefix build, but it's not automatically pulled in.

This is only an issue for CMake < 3.26, because these older CMake
versions lack the BUILD_LOCAL_INTERFACE generator expression.

Fix this by pulling in the private modules for non-prefix builds when
using CMake < 3.26. Also, issue a warning in this situation.

Fixes: QTBUG-134407
Change-Id: I7f182c9518686390e657663b452cad8101d870a2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-03-07 12:02:47 +01:00
Cristian Le
2d27183567 Make FEATURE_static and FEATURE_shared aliased features
Fixes: QTBUG-133407
Change-Id: Ic17315b0229a829689b77e272cd9bbd331c3b0d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-02-28 17:49:24 +01:00
Cristian Le
f654519c7b Add _qt_internal_set_source_file_generated function
Create a function `_qt_internal_set_source_file_generated` that sets the
source file property `GENERATED` along with Qt relevant properties:
- `SKIP_LINTING` if CMake>=3.27 and `QT_FEATURE_lint_generated_code`

Task-number: QTBUG-125077
Pick-to: 6.9
Change-Id: I0ef5f7901f502366aaf2d020554c72e4845101b6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-02-17 16:44:30 +01:00
Lorn Potter
44b513f192 wasm: remove unsupported libraries from wasm build
We do not support printing and sql, so best not to build and
shipping them.

Change-Id: Ibc929b127fd8416aa3d3b784a6ed0c2ce86db80d
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-22 12:24:45 +10:00
Piotr Wierciński
6359793541 wasm: Fix warning message for Emscripten version mismatch
Change-Id: I3ebecc5bae1eb5ed102705e41fa024f7caab7650
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-12-10 19:45:16 +01:00
Morten Sørvig
92ad0f1f01 wasm: add configure option for asyncify JSPI
Make this a proper Qt configure feature: 

 -feature-wasm-jspi

Using the JSPI name matches the updated Emscripten naming
as well, which as moved from "asyncify 2".

Task-number: QTBUG-129748
Change-Id: Idfc372f831d1db5c79109c97a00e30e58713f9f6
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-12-02 19:45:19 +01:00
Lorn Potter
fd6182246a wasm: Add warning and error when using not recommended emscripten
This will produce an error when configuring Qt with Emscripten
version less than what is recommended version.
It will produce only a warning when configuring using
Emscripten version greater than recommended.

Change-Id: I62016394e8e52657a5e1d78c4288866e83af2d28
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2024-11-25 03:50:15 +00:00
Kai Köhne
abe3eed548 CMake: Disable doc_snippets feature for static builds
Now that we have a separate feature, we can fix QTBUG-99063 by disabling
the doc_snippets feature globally.

Task-number: QTBUG-99063
Change-Id: I77ba875633ed89fdd8b8481ea0fddc7e91cbb9ca
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-11-21 16:39:14 +01:00
Kai Köhne
ef12478f49 CMake: Add doc_snippets feature
We'd like to compile-test doc_snippets on some configurations. So far,
we enable this by checking the private_tests feature, that is in turn
enabled by default by developer_build.

Let's rather have a separate doc_snippets feature, as we might turn
this on and off independently from private tests. In fact, private API
shouldn't be used by any of the snippets.

Change-Id: Icba8f6af610d7951e65783d8b1700be57584cc4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-11-19 16:26:55 +01:00
Joerg Bornemann
f663a08f20 CMake: Report success for 'separate_debug_info' where applicable
Don't disable the separate_debug_info test but mark it as successful on
Apple platforms and MSVC. This enables us to simplify the condition of
the separate_debug_info feature. Also, we fix the error on MSVC when
passing -separate-debug-info to configure.

Fixes: QTBUG-108015
Pick-to: 6.8
Change-Id: Ifb1f18b2be8a0b5693a3448c1b8198f773f94ffb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-10-30 17:51:19 +01:00
Alexandru Croitor
649caf962f CMake: Improve the message for WASM thread support note wording
Seeing just "Enable thread support" sounds like an imperative, which
is strange to see because it is only shown if thread support was
explicitly enabled.

Reword it slightly.

Pick-to: 6.8
Change-Id: I37596118dfc66204aa3ff81397caa818a5a91e66
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
2024-10-29 16:09:57 +01:00
Alexandru Croitor
d7ea0ea95f CMake: Warn that not all WASM tests might build without threads
Pick-to: 6.8
Change-Id: I89971db45f30cebcfb122909ab2434a55b75e2a0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-10-29 16:09:56 +01:00
Chen Zhanwang
73ce5a940a Add LSX and LASX configure detection
Adds loongarch simd extension(LSX LASX) configure test and
-feature-lsx and -feature-lasx configure options.
Add detection of LSX and LASX at run-time in qsimd.cpp.

Change-Id: I63eab2f4f45c306b672a89b376e0cbc01da0df83
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-10-22 18:12:15 +02:00
Axel Spoerl
3c495f9b93 Add compile flag for QtGuiTest namespace
Add a feature to build QtGuiTest namespace.
Enabled by default, in order to provide access to Squish UI tests.

Fixes: QTBUG-125594
Change-Id: I0188dceb0d966c1837263756ffe7337b69f935f3
Reviewed-by: Stefan Gehn <stefan.gehn@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-10-19 12:23:37 +02:00
Allan Sandfeld Jensen
70738cf726 Fix runtime CPU feature detection for ARM
We had no routines for checking compiler support instead only compiler
currently enabled.

Change-Id: I5543e4cff2b0bab494e11abf257061147baaf0d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-10-17 01:43:02 +02:00
Allan Sandfeld Jensen
3de914eef5 Add ARM SVE detection
Limited to ARM64 and little-endian to keep our code simple.

Change-Id: Ie65f71a31ca98d6929561d4b2ee1e9332b3a82d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-10-02 08:33:13 +02:00
Allan Sandfeld Jensen
bbdd20da04 Fix compile-time CRYPTO detection, and detection on MSVC ARM64
We had a mismatch of the naming of the Qt and compiler defines. Matched
the qt defines to the compiler define, and added detection support for
MSVC (ARM64).

Pick-to: 6.8
Change-Id: I9abfbe8a96bc8c800e86dac3ab9a7abf9c1f7f9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-09-17 15:47:43 +02:00
Thiago Macieira
afe50b1cf3 CMake: remove test for alloca for the global config
We don't test for this anywhere in qtbase except for the qmake check
(and qmake doesn't use alloca() anywhere). There are a couple of uses of
alloca() itself in qtbase, but they are all in platform-specific code
(android and qnx platform plugins) or third-party content (sqlite and
imgui).

The uses of this alloca() test in qtdeclarative have been removed too
(it still uses alloca() but has local tests).

Change-Id: If3345151ddf84c43a4f1fffd17d1f1519f5d3e39
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-08-16 03:57:32 +00:00
Alexey Edelev
f98fd70529 Add the 'exceptions' feature
The feature allows enabling/disabling exceptions for the Qt builds.
The feature is disabled by default.

This commit reworks the way the exception flags are set for Qt targets.
Instead of setting them per-target, flags now are set for the
QtPlatformCommonInternal target, which transitively propagates the flag
to other Qt targets. To disable/enable exception flags the newly
introduced property _qt_internal_use_exceptions can be used. The flags
enabling/disabling now can happen any time, but not only at target
creation time. The property has 3 states: TRUE, FALSE, DEFAULT(or
empty). If the property is not set or is set to DEFAULT, the exceptions
feature value is used to set the required exceptions flags. Otherwise
the flags are set according to the property value.

The logic of EXCEPTION argument of the various qt_internal_add_
functions was also updated. If the argument is not provided, the
_qt_internal_use_exceptions property value is set to DEFAULT, which
gives the control on the exception flags to the feature. If the
argument is provided, the exceptions are enabled by setting the
_qt_internal_use_exceptions property to TRUE.

Task-number: QTBUG-118901
Change-Id: I83e3bf52d48a3d16977cce849c9b0765c34f1f21
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-12 14:56:16 +02:00
Łukasz Matysiak
a578a09a41 Prevent -feature-c++20 on VxWorks
The way that Qt checks if C++20 is supported by the platform does not
work properly on VxWorks.
Their toolchain accepts the C++20 switch, because they use clang with a
wrapper around it, that (for the time being) does not reject it.
The compiler itself claims that it does support C++20.
The problem is that the standard library available on VxWorks only
supports C++17.
This leads to Qt falsely believing that C++20 is supported.
This is being discussed as a defect in support case 00152044.

Prevent weird compilation errors by failing early if the user passes
-feature-c++20 to the configure call.

Task-number: QTBUG-115777
Pick-to: 6.7 6.8
Change-Id: Ica6686428b01a0638117f853586313be63e5fe99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-05 19:33:13 +02:00
Giuseppe D'Angelo
6c11f40701 Disable -ftrivial-auto-var-init=pattern on GCC < 14.2
GCC generates broken code with that option enabled, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527 .

For simplicity I'm not building a comprehensive set of GCC versions
which do have the fix applied; I'll just exclude old ones.

Change-Id: Ia2f128cac633f8d72d5aedc5efe4e64e1c40c51b
Pick-to: 6.8
Fixes: QTBUG-127507
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-07-25 19:58:48 +02:00
Christian Ehrlicher
bcfa0102e5 SQL/SQLite: add check for localtime_r/localtime_s
Add a check for localtime_r/localtime_s to avoid the usage of a sqlite
mutex when a time needs to be converted.

Pick-to: 6.8
Change-Id: I536497da1938131298c1198db85dab74d6157e35
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-07-01 22:50:42 +02:00
Tor Arne Vestbø
d3be87ff1d Apple: Don't _debug-suffix libraries in single config framework builds
As part of fee15182949e88682131399c50b679be83a75385 we enabled framework
debug builds, which left us with an inconsistent library naming. The
framework libraries are always unsuffixed, e.g. QtGui.framework/QtGui,
while we were adding _debug suffixes to the plugins and static libs.

This was confusing macdeployqt, as it uses simple string matching logic
for "_debug_" to detect that a Qt build is a debug build, and since
the framework library didn't have a suffix it then failed to deploy
the suffixed plugins.

We now follow the requirement from the framework naming and skip the
suffixing for all libraries in this configuration.

Pick-to: 6.8
Change-Id: I982253fc46c65aa3fab52f8658f62ef63cdac49f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-07-01 22:50:42 +02:00
Joerg Bornemann
08c6de0c5d CMake: Add a way to use system/bundled 3rdparty libs in bulk
[ChangeLog][CMake] Added the configure feature 'force-system-libs'.
Enabling this feature enables every 'system-foolib' feature, and the
system-provided 3rdparty library foo will be used. If the library is not
found, an error is yielded. Also added the analogous
'force-bundled-libs' feature that enforces the usage of bundled 3rdparty
libs.

[ChangeLog][CMake] The configure script gained the options
-force-system-libs and -force-bundled-libs that control the same-named
configure features.

Since we now need a way to mark a feature as "controlling the usage of a
system 3rdparty library", we added the SYSTEM_LIBRARY feature to the
qt_feature command. Patches that add this argument to qt_feature calls
in other repositories follow.

Fixes: QTBUG-96910
Change-Id: I5c411409ea5f3f6425b6bed6fa00d10eddbc366c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-06-18 07:05:30 +02:00
Joerg Bornemann
433411934c CMake: Emit the 'msvc_obj_debug_info' feature only when MSVC is used
In non-MSVC configurations this feature is meaningless.
Restrict it to MSVC.

Pick-to: 6.8
Change-Id: Ib5111e8adf49a862d8ca0f191837d8c28aab6890
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-11 00:25:21 +02:00
Alexey Edelev
3073b9c4de Ensure that libzstd targets are promoted to global if they were found
Promote all internal zstd targets if they were found by WrapZSTD to
global using PROVIDED_TARGETS mechanism.

Amends 7d9d1220f367d9275dfaa7ce12e89b0a9f4c1978

Task-numer: QTBUG-119469
Change-Id: I15ec484304f7bf2b3ee2a533d2badb3bb7797863
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-29 00:18:06 +02:00
Alexey Edelev
e820ff8301 Make version_tagging the full-functional feature
This feature allows to explicitly disable the version tagging for Qt
libraries and have the precise feature-based guarding in C++ code.

Task-number: QTBUG-124346
Change-Id: If109adb2f6a998c58825a2449cfb936ea278b2ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-07 12:10:22 +02:00
Ulf Hermann
175839695d configure: Add define on whether QT_COORD_TYPE is float or double
This way we can identify whether the type is float or double or
something else in the preprocessor. This is helpful for identifying the
primitive types available to QML.

Change-Id: I635f01cb888b9a6a5b35c3f1cbd6e66ff8a65beb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-24 17:13:12 +02:00
Tor Arne Vestbø
2342fa5fe2 Enable framework builds for all Apple platforms, including static builds
Static frameworks are now a supported by Apple, so we switch the default
for all Apple platforms, including Qt for iOS and visionOS.

 https://developer.apple.com/documentation/xcode/creating-a-static-framework

This allows us to bundle resources with our libraries, such as the
privacy manifest.

Xcode 15 and later will ensure that the linked and embedded framework
is not copied into the application bundle, as it's already linked into
the app as a static library.

Change-Id: Iaf64e7df2d6969d9562fb31ba65f05767e14506e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-23 16:44:26 +02:00
Tor Arne Vestbø
d5bf42f75b Add preliminary support for Qt for visionOS
Qt already runs on Vision Pro as "Designed for iPad", using Qt
for iOS. This change enables building Qt for visionOS directly,
which opens the door to visionOS specific APIs and use-cases
such as volumes and immersive spaces.

The platform removes some APIs we depend on, notably UIScreen,
so some code paths have been disabled or mocked to get something
up and running.

As our current window management approach on UIKit platforms
depends on UIWindow and UIScreen there is currently no way to
bring up QWindows. This will improve once we refactor our
window management to use window scenes.

To configure for visionOS, pass -platform macx-visionos-clang,
and optionally add -sdk xrsimulator to build for the simulator.

Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-18 05:00:57 +02:00
Alexey Edelev
0075672da3 Remove the headersclean feature
'headersclean' shoudn't be a feature. The respective flag should behave
like command-line switch that affects the only repo that it was passed
for. This also avoids propagating of the headersclean feature between
the different repos when qtbase was built with the headerclean enabled.

Fixes: QTBUG-121722
Change-Id: I304cbc980b06030513c015a2016678a6a0965fed
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-04-17 20:41:35 +02:00
Joerg Bornemann
52c7357fce CMake: Bail out on configuration with FEATURE_cxx20 and MSVC 2019
45fd36f1480a6229879a4e59236ffa1d1d22dfbf triggers internal
compiler errors in MSVC2019 when configuring Qt with -c++std c++20. Bail
out early when trying to configure a C++20 build with MSVC 2019.

Change-Id: Ic0a49c43e08d3d46221c5c060c0b92628898e26e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-27 06:55:35 +01:00
Fabian Kosmale
def07f6306 VxWorks: Skip fstack-protector-strong
We do not know yet why it fails exactly to link, and what a proper fix
would be. For now, unconditionally disable it so that we can get
submodule updates in again.

Task-number: QTBUG-123715
Change-Id: I832cc8801c7fcb4b0a755aa4ff0bc65d15bf8230
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-25 17:09:11 +01:00
Thiago Macieira
e0940081bc CMake/ELF: allow using Qt's full version number in the private tags
We added the feature to tag private symbols using the Qt major version
only, because us developers often move between versions and need to keep
compiled code working, even when using private API (we're supposed to
know what we're doing). Linux distributions, however, want to be told
that something used private API and therefore needs to be rebuilt. See
[1][2][3].

Distributors will learn about this feature when updating Qt causes the
existing patch to fail to apply.

[1] https://build.opensuse.org/projects/openSUSE:Factory/packages/qt6-base/files/0001-Tell-the-truth-about-private-API.patch?expand=1
[2] https://src.fedoraproject.org/rpms/qt6-qtbase/blob/rawhide/f/qtbase-tell-the-truth-about-private-API.patch
[3] https://github.com/clearlinux-pkgs/qtbase/blob/main/tell-the-truth-about-private-api.patch

Pick-to: 6.7
Change-Id: I5f663c2f9f4149af84fefffd17bed69026f4038d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-21 21:13:57 -07:00
Giuseppe D'Angelo
9ff1e6d80b 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-19 02:52:43 +01:00
Tor Arne Vestbø
d04cf2c58b cmake: Rename QT_UIKIT_SDK to QT_APPLE_SDK
The SDK is relevant for all Apple systems, including macOS, iOS, tvOS,
watchOS, and visionOS.

We still pick up -DQT_UIKIT_SDK for iOS for compatibility.

[ChangeLog][CMake] The -sdk configure argument now maps
to the QT_APPLE_SDK CMake variable. QT_UIKIT_SDK is still
supported for iOS builds for compatibility.

Change-Id: I983a2f23c2414eb73cd35bb83738088defb45cbd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-18 19:04:14 +01:00
Giuseppe D'Angelo
918ac58a89 CMake: remove a duplicate check for C++2b
Change-Id: Ie617fa277fc3a36b5e2f34ae1b79099193ae1b17
Pick-to: 6.7 6.6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-02-29 14:02:32 +01:00
Alexandru Croitor
9e9099865a CMake: Fix missing output of TEST_x86intrin_OUTPUT config test
When the intrinsics test failed, we never showed the failing build
output due to two reasons:
- TEST_x86intrin_OUTPUT was empty
- bracket arguments don't do variable expansion

Use the newly introduced feature in qt_config_compile_test to get
the output.
Replace the usage of a bracket argument with a concatenation of
regular strings.

Amends db342f42a4b00f858cb43328c9fdaff5fe2b5788

Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-122596
Change-Id: I7cdef9a145ac64c8fced8add4879fa19b8bcd19d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-21 18:21:41 +01:00
Kai Köhne
6ea922b584 Remove year from generic Qt copyright information
While at it, also add the missing dot in Ltd. (as
it's an abbreviation). Also, prefer https:// over
http://.

Fixes: QTBUG-121906
Task-number: QTBUG-121928
Pick-to: 6.7 6.6
Change-Id: I4e1f1563376ae36b3c260359d830f00969ab9351
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-14 09:30:07 +00:00
Tor Arne Vestbø
291817b0bf cmake: Allow static library framework builds for macOS and iOS
Frameworks on Apple systems have traditionally been wrappers around
dynamic libraries (with headers and other resources bundled alongside
the library), but nowadays it's fully supported to have frameworks
with static libraries inside them.

Enabling this allows us to build Qt for iOS statically, but as
frameworks, which allows us to include privacy manifests for the
Qt libraries in the frameworks.

At build time Xcode will link the static library into the application,
as normal, so nothing changes there. If the user then chooses to
embed the Qt frameworks via the Xcode UI, the build system will
not copy the static libraries inside the frameworks, but will
copy the privacy manifest and other resources, which in turn
allows Xcode to generate a privacy report for the application
as a whole.

Task-number: QTBUG-114319
Change-Id: Ibc8c70a97d288e27811eaedd242613fa206617e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-13 21:53:33 +01:00
Tor Arne Vestbø
fee1518294 Enable frameworks by default for shared library builds on Apple platforms
Many modern features of the Apple application build and packaging pipeline
require that the libraries are shipped as frameworks, so that they can
embed resources (privacy manifest e.g.), be signed, and have their own
Info.plist.

We build and ship our binary packages already as frameworks, and it has
been the default for release builds for a while. Let's enable it for
debug builds as well, so that developers are testing what we ship
(debug is the default for -developer-build).

The error about debug builds not being compatible with frameworks has
been removed, as this works fine in practice. With CMake we don't add
a '_debug' suffix to the libraries unconditionally for debug builds.

Change-Id: I373b982affd8cf70b215d4a92225467ff1037fe8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-13 00:53:25 +01:00
Alexandru Croitor
85c462855b CMake: Fix Threads global promotion issue when using static openssl
and an older CMake 3.22, which is shipped by default on Ubuntu 22.04.

If for some reason there's a static openssl library lying around in
the default sysroot (or any ssl search path), like in
 /usr/lib/libssl.a,
then CMake's _OpenSSL_test_and_find_dependencies
will try to find_package(Threads) because it assumes it has a
dependency on the Threads package.

Because we do qt_find_package(WrapOpenSSLHeaders) in
qtbase/configure.cmake
and we do qt_find_package(Threads) in
src/corelib/CMakeLists.txt,
we would create the Threads target in the root directory scope, and
then try to promote it to global in the corelib subdirectory,
which fails with

CMake Error at qtbase/cmake/QtPublicTargetHelpers.cmake:260
  (set_property):
  Attempt to promote imported target "Threads::Threads" to global scope
  (by setting IMPORTED_GLOBAL) which is not built in this directory.
Call Stack (most recent call first):
  qtbase/cmake/QtFindPackageHelpers.cmake:211
  (__qt_internal_promote_target_to_global)
  qtbase/src/corelib/CMakeLists.txt:4 (qt_find_package)

Newer versions of CMake's FindOpenSSL actually try to determine if
the Threads package is really needed.

To avoid the issue entirely, just look up Threads before we look up
the OpenSSL package.

Pick-to: 6.5 6.6 6.7
Change-Id: Ia3cde93e26ba004f64105a5b457098e1b9870885
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-22 14:18:09 +01:00
Lucie Gérard
0ba15348cf Add qtbase modules to ./configure -list-features
Task-number: QTBUG-64984
Pick-to: 6.6 6.7
Change-Id: I78964581118b258fb1cf5ddea8097fd3b9a5df02
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-12-21 14:13:01 +01:00
Marianne Yrjänä
65081c67f3 Revert "OpenSSL: remove support for 1.1"
This reverts commit d201c0a2184881a226bce76528047707e9062856.

Reason for revert: QNX have support only for OpenSSL1.1.
QNX will start supporting OpenSSL3 with upcoming QNX8.0 but as long as we want to support QNX7.1 (and even QNX7.0) removing OpenSSL1.1 support from Qt is not an option.

Change-Id: Ia2083eda318779968eb6ee84fff2f56ebe3dadf7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-12-08 06:10:51 +00:00
Giuseppe D'Angelo
d201c0a218 OpenSSL: remove support for 1.1
OpenSSL 1.1 reached EOL last September [1]. We will only support
OpenSSL 3.

Cherry-picking aggressively, as there's no purpose at keeping maintained
Qt versions work with an unmaintained library given the security
implications.

[1] https://www.openssl.org/blog/blog/2023/09/11/eol-111/

[ChangeLog][QtNetwork][SSL] Support for OpenSSL 1.1 has been dropped. Qt
now only supports OpenSSL 3.

Change-Id: I51a231a9ca17804739acbd2f22c478d2a8ff9b3b
Fixes: QTBUG-119330
Pick-to: 6.6 6.5 6.2 5.15
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-24 19:00:06 +01:00
Jacek Poplawski
2da43b563e Disable dbus on VxWorks
dbus is not supported on VxWorks

Task-number: QTBUG-115777
Change-Id: Ia594ddca819ade2d5004dde3da59717e4735b823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-23 08:18:15 +01:00
Alexey Edelev
e38eef345e Replace the specific gcov compile and link options with generic --coverage
Follow up commit fixing review comments.

Amends 42d29441914da263a160d631f56c6d95f85eac70

Task-number: QTBUG-86223
Change-Id: Ia1353fd9855d6811e58ae8b706e932f01fdeec28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-02 19:49:34 +01:00