Commit Graph

219 Commits

Author SHA1 Message Date
Tim Blechmann 1beb09f781 CMake: x86intrin - prevent re-configure failure with UBs
When configuring a build folder the first time for universal binaries,
it works fine. When reconfiguring the build folder, we run into:

```
CMake Error at qtbase/cmake/QtBuildInformation.cmake:554 (message):
  Feature "x86intrin": Forcing to "ON" breaks its condition:

      ( ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) ) AND ( QT_FORCE_FEATURE_x86intrin OR TEST_x86intrin ) )

  Condition values dump:

      TEST_architecture_arch = "arm64"
      TEST_architecture_arch = "arm64"
      QT_FORCE_FEATURE_x86intrin = "ON"
      TEST_x86intrin = "ON"

Call Stack (most recent call first):
  qtbase/cmake/QtFeature.cmake:786 (qt_configure_add_report_error)
  qtbase/cmake/QtFeature.cmake:923 (qt_feature_check_and_save_internal_value)
  qtbase/cmake/QtFeature.cmake:1192 (qt_evaluate_feature)
  qtbase/cmake/QtBaseGlobalTargets.cmake:136 (qt_feature_module_end)
  qtbase/cmake/QtBaseHelpers.cmake:254 (include)
  qtbase/CMakeLists.txt:36 (qt_internal_qtbase_build_repo)
```

Can prevent this by adding a special case to detect universal macos
builds with x86_64 among the targets

Change-Id: If905e21f3cd87609188c6bc71bf69e9595279140
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-08 04:05:34 +00:00
Rami Potinkara 48dcf5cec1 Android: NDK28 and later 16KB page size support for user projects
This patch amends 6f3a9c7a6c54010f601870dd31066f3500f6acd0

This amends it by adding linker options to newer NDK's than version
27. NDK 28 and later versions apparently build system shared
libraries (.so), like the ones for Qt for Android, with 16KB page
sizes by default, but leave Qt user projects to be configured
separately by the Qt application author.

This patch mitigates the need for Qt application authors to add
separate link options into their applications CMakeList.txt.

Task-number: QTBUG-131514
Task-number: QTBUG-134093
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Idddeb2bb8c519db7a3ec87eb5e50b9e2030e2815
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-08-22 14:45:44 +03:00
Thiago Macieira 79a50b92d9 CMake: detect an ELF-based system using the feature support
That way, we can remove hardcoded "LINUX" checks which should apply to
all ELF-based systems (BSDs other than Darwin, QNX, etc., even Solaris
if someone still has that).

Pick-to: 6.10
Change-Id: I9f61e1912e5da705c96cfffd019880d57307b2ee
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-08-14 11:37:55 -07:00
Rami Potinkara d7e0a033c0 Android: 16KB page size support for building Qt for Android
This patch introduces android_16kb_pages feature.

Feature is needed for Qt versions supporting Android 15 or newer
which use NDK 25 or later.

Feature adds linker options to build shared libraries (.so)
with 16KB page size instead of 4KB page size. The 16KB page size
is compatible with 4KB page size.

Adding the linker flag is applicable only for 64-bit target
architectures: x86_64 and arm64-v8a when using NDK 25, 26 or 27.
NDK 28 and later will have the feature built-in so the linker flags
and note are not needed to be used with those versions.

It is applied to both Qt build and Qt Application builds.

Task-number: QTBUG-131514
Task-number: QTBUG-134093
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I8af9c3b392a661995c2eb46b568a40b94ee62aaa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-08-14 08:51:27 +03:00
Thiago Macieira 1f49b5076a CMake: fix the reduce_relocations test
This test was apparently never properly ported from qmake, because it
forgot to check that the linker supports the flag that it meant to use.
Fix it by checking for both flags that we need to support the feature,
-Bsymbolic-functions and --dynamic-list.

This also fixes the incorrect GCC checks, since this is not a compiler
feature, but a linker one.

Pick-to: 6.10
Change-Id: I92f6bb1e213e335b5c94fffd3ea509c53b847ee6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
2025-08-13 14:52:37 -07:00
Morten Sørvig 415967b7fa wasm: require wasm-exceptions for jspi
JSPI is not compatible with emscripten exceptions, but
instead requires native wasm exceptions.

Pick-to: 6.10
Change-Id: I2f032104b72fab01740588b8d22afd1ba5500ab4
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2025-07-17 13:57:57 +02:00
Morten Sørvig 825d842021 Revert "wasm: remove unsupported libraries from wasm build"
This reverts commit 44b513f192.

Enable SQL and PrintSupport again; we support sqlite and print to pdf.

In addition we don't want to wasm to diverge from the standard
module set if possible, in order to avoid build system issues.
For example, disabling Qt::PrintSupport removes QT_FEATURE_printer,
which breaks cmake code which tests for it.

Pick-to: 6.10
Change-Id: Ibfe0fef41c76a04de8a2989869475224eccc2658
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
2025-07-07 17:07:37 +00:00
Marc Mutz 1685ee36eb Build system: support C++2c
CMake supports it since 3.25 (and we ship Qt with 3.30), so allow the
selection of to-be-C++26.

This patch merely continues the status quo. It does not attempt to
change policy.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I6e1e7d76f787d619ad16551114ca92423159917a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-07-03 11:49:20 +00:00
Marc Mutz 54797309dd Build system: support C++23 for C++2b
Adjust user-visible labels and comments from "C++2b" to "C++23" and
alias the machine-readable cmake and qmake features c++/cxx2b to
c++/cxx23.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Iea721ea2cb72b9e1d284d84569169fffe21afc10
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-24 18:39:21 +02:00
Alexandru Croitor 5e40506043 Reland: CMake: Annotate some qt_find_package calls with MODULE
A qt_find_package call first tries to find a Config package
with the CONFIG mode option, and if not found, falls back to an
arg-less mode which searches both Config and Find modules.

For some packages, we know we want to find the Find module because
there can't be a Config package, e.g our FindWrap modules or any of
the other Find modules we carry in our cmake directory.
So we should annotate these calls with MODULE.

Aside from slightly faster configuration, there is another reason to
do so.
Future versions of CMake will automatically log find_package
calls that have a state change (e.g. Not Found -> Found) into
CMakeConfigureLog.yaml.
Due to the Config-first logic in qt_find_package, we always unset the
Foo_DIR variable if the Config package is not found.
This means that there will be a constant build up of not-found
messages in the log.

Explicitly annotating the calls with MODULE will prevent this. Do
that.

This commit relands f1a59e974f
This reverts commit 0ce82b78a3.

Pick-to: 6.10
Change-Id: I5d37579d2f4957215ce1475b5c0ec8509d77c83d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-06-24 15:29:50 +02:00
Morten Sørvig 776abdeb39 no-thread: enable using QFuture
Enable using QFuture for handling async tasks, which
is a use case which can work also for the no-thread
configuration.

Add implementation files and headers for the QFuture
dependencies to the no-thread build. These files build,
but as with no-thread QThread there is no guarantee that
they will do anything useful.

Stub out some more functions in QThread, and also add
stubs for no-op QSemaphore.

Enable the tst_qfuture test and skip tests which require
threads. tst_qfuture now runs with:

   Totals: 70 passed, 0 failed, 13 skipped, 0 blacklisted, 6373ms

Pick-to: 6.10
Change-Id: Icd82590915d6034ae7829ead3fb4ebaf1e9c2aad
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
2025-06-24 00:07:21 +00:00
Alexandru Croitor 0ce82b78a3 Revert "CMake: Annotate some qt_find_package calls with MODULE"
This breaks reconfiguring Qt in various ways, one of which is

CMake Error at cmake/QtTargetHelpers.cmake:1557 (message):
  PkgConfig::ATSPI2 is not a valid target.

This happens because pkg_check_modules sets ATSPI2_FOUND to 1, so
qt_find_package thinks it shouldn't find the FindATSPI2.cmake module,
which ends up not creating the ATSPI2 target.

This reverts commit f1a59e974f.

Pick-to: 6.10
Fixes: QTBUG-137870
Change-Id: Ica74a236c6b1bb9d7ca9af29175cb2e84a93251b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-06-19 17:46:13 +02:00
Alexandru Croitor f1a59e974f CMake: Annotate some qt_find_package calls with MODULE
A qt_find_package call first tries to find a Config package
with the CONFIG mode option, and if not found, falls back to an
arg-less mode which searches both Config and Find modules.

For some packages, we know we want to find the Find module because
there can't be a Config package, e.g our FindWrap modules or any of
the other Find modules we carry in our cmake directory.
So we should annotate these calls with MODULE.

Aside from slightly faster configuration, there is another reason to
do so.
Future versions of CMake will automatically log find_package
calls that have a state change (e.g. Not Found -> Found) into
CMakeConfigureLog.yaml.
Due to the Config-first logic in qt_find_package, we always unset the
Foo_DIR variable if the Config package is not found.
This means that there will be a constant build up of not-found
messages in the log.

Explicitly annotating the calls with MODULE will prevent this. Do
that.

Pick-to: 6.10
Change-Id: I465b015ac18f8a09b9a5c86cec7b6312a0bfbdf1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-06-17 16:47:16 +02:00
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 605913f9d7 .

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 9e9099865a

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 fee1518294 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 7d9d1220f3

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
45fd36f148 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