1821 Commits

Author SHA1 Message Date
Thiago Macieira
9f9d022916 CMake: make qt_config_compile_test verbosely indicate missing deps
This alone isn't enough:
  Feature "xcb": Forcing to "ON" breaks its condition:

      QT_FEATURE_thread AND TARGET XCB::XCB AND TEST_xcb_syslibs AND QT_FEATURE_xkbcommon_x11

  Condition values dump:

      QT_FEATURE_thread = "ON"
      TARGET XCB::XCB found
      TEST_xcb_syslibs = "FALSE"
      QT_FEATURE_xkbcommon_x11 not evaluated

But when it says:

-- Performing Test XCB (extensions) - Failed because XCB::CURSOR not found

The user can know what to do.

Change-Id: I810d70e579eb4e2c8e45fffd1719c0abf608ed30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit caecb17248a88434faf533ceef81d3b5f5e79335)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-01-18 19:13:05 +00:00
Joerg Bornemann
b41b27352d CMake: Add switch for allowing missing Qt6*Tools packages
Consider a cross build of Qt with qtbase, qtshadertools and
qtdeclarative. If a user projects only links against QtQml without
creating an actual QtQuick module, no host tools from qtdeclarative are
needed.

Normally, find_package(Qt6Qml) pulls in Qt6QmlTools and errors out if
it's not found. By setting QT_ALLOW_MISSING_TOOLS_PACKAGES when
configuring Qt, one can disable the error and build a user project such
as the one outlined above.

Fixes: QTBUG-109547
Change-Id: I45e727713912d19e6007a7fbf3d61533f82b71d9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
(cherry picked from commit 94e474b48e9d3c6434339afe166c2329f8c36ea2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-01-12 16:46:38 +00:00
Amir Masoud Abdol
23475c7cf1 Disable PkgConfig for Android
We decided that it's better to disable PkgConfig for Android, as it is
unlikely that someone uses them.

Task-number: QTBUG-110007
Change-Id: I6ae1059ddd05feeec047fbb906c7dba1586e816b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e6693163e5e40668bc4cc5155003c173eea83273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-01-11 12:48:59 +00:00
Alexey Edelev
1f323d2167 Allow specifying CMakeLists.txt as the argument for qt-cmake-standalone-test
qt-cmake-standalone-test uses add_subdirectory call when evaluating the
project. This leads to an error if users try to use path to
CMakeLists.txt as an argument, instead of directory when configuring
standalone tests with qt-cmake-standalone-test. It makes sense to check
if the user-specified path points to CMakeLists.txt and cut the
filename part when calling add_subdirectory.

Change-Id: I6b9ac0ca8323eaf11f219eb1e6bed3057120a231
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 90806123e961d469c36ee3b19ac0960524abb9e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-01-06 08:06:57 +00:00
Marc Mutz
db9d604357 QT_INLINE_SINCE: never inline for static Qt builds
Static Qt builds are not covered by BC guarantees, but since all
'libraries' are linked into a single executable, we face in all users
of the library the same ODR violation that we faced within the
implementation DLL: we can't define the same symbol as inline in some
TUs and out-of-line in others.

In the past, we decided to always inline in static builds, but that
breaks users which, by Hyrum's Law, have come to depend on the
non-existent BC guarantees for static Qt builds.

By switching to never inline¹ in static builds, we restore BC for such
users. The performance issues should be minimal, since LTO will anyway
inline whatever it wants, independent on how it was declared.

¹ except when the deprecation point has passed over the Qt version the
  API was inlined (-disable-deprecated-up-to configure switch).

[ChangeLog][QtCore] Restored binary compatibility for static Qt
builds broken by the QT_INLINE_SINCE mechanism. Qt still does not
guarantee BC for static build configurations otherwise.

Fixes: QTBUG-109449
Change-Id: Ie3fa62621b74dc5e9dac301b9882c0e3c3999eaf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 8602a224b6ade5680329270d8d573b786a7a81a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-12-16 17:22:13 +00:00
Alexey Edelev
e85b0ad567 Remove CMake version check when adding _lib_pri to ALL
It looks like adding dependencies to interface libraries is either not
fixed or broken in CMake versions newer than 3.20. Remove the CMake
version check to ensure that 'lib_pri' targets are executed. This will
restore the initial behavior.

Amends cfcc4ef8edc4e8256ae738bbe8c23b4204021830

Fixes: QTBUG-109240
Fixes: QTBUG-109239
Change-Id: I8c5b317fcdd0a715a1a668b4e955df1acfe4be8b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 85b941f4251bb5207db65efc9ccdd1f5586c8d11)
2022-12-09 12:06:46 +01:00
Alexey Edelev
4f00d5d0b9 Add _lib_pri targets to all
In CMake versions older than 3.20 add_dependencies have no effect
when adding interface libraries. So need to add the '_lib_pri'
targets to ALL to make sure that the related rules executed.

Amends 190e58e1f4eb9e9bf12a9561cf32cdccdc0b22e0

Fixes: QTBUG-109240
Fixes: QTBUG-109239
Change-Id: I7c565ce3bc15e549569317454c2f7caac823cf66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cfcc4ef8edc4e8256ae738bbe8c23b4204021830)
2022-12-07 15:51:22 +01:00
Kai Köhne
8e2fbd5e24 CMake: Properly quote paths in FindPPS.cmake
PPS_LIBRARY and PPS_INCLUDE_DIR cannot be empty at this point (otherwise
PPS_FOUND would be FALSE). But it's arguably good practice to puth paths
in quotes.

Task-number: QTBUG-108930
Change-Id: I87128da50f37cd6aa1a66811261a05ceb8c3e790
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f5f5a29bbac86d31420be8058d4b96b210d8560e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-12-05 21:16:52 +00:00
Alexey Edelev
c47e857ac3 Link ${target}_lib_pri directly to INTERFACE_LIBRARY targets
There is no reason for adding dependency to the custom
'_pri_dep_timestamp' target instead of the INTERFACE_LIBRARY target
itself. This will close the chains of dependency between repo targets
and the HEADER_MODULE dependencies.

Fixes: QTBUG-108815
Change-Id: I0e170d3e0e42d342881beb8aca1cc5a764425826
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 190e58e1f4eb9e9bf12a9561cf32cdccdc0b22e0)
2022-12-05 16:01:55 +01:00
Joerg Bornemann
95811fba5e CMake: Make it possible to specify a debug MySQL client library
An MSVC debug-and-release build of Qt with the MySQL plugin requires
separate builds of the MySQL client library: a debug and a release
build. There was no way to specify the debug version of the library.

Now, it's possible to configure Qt like this:
cmake ... \
    -DMySQL_ROOT=D:\mysql-connector-c-6.1.11-winx64 \
    -DMySQL_LIBRARY_DIR=D:\mysql-connector-c-6.1.11-winx64\lib\vs14

This will automatically detect the include dir and the debug and release
library files. We expect that the debug build of the MySQL client
library resides in a "debug" subdirectory below MySQL_LIBRARY_DIR.

If the automatic detection doesn't work to due a different layout on the
build machine, one can set the variable MySQL_LIBRARY_DEBUG to specify
the debug variant of the MySQL client library.

[ChangeLog][CMake] If pkg-config is not used, a debug build of the MySQL
client library can be specified with
-DMySQL_LIBRARY_DEBUG=<path-to-library>. The debug and release variants
of the library are automatically detected. Setting MySQL_ROOT and
MySQL_LIBRARY_DIR is sufficient in most cases.

Task-number: QTQAINFRA-4999
Change-Id: I663fb8ac1dbd07bc73484791be9cc21bff2f4a9b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 84c76d6205c26e27a59bebcabb78d95a0891ce79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-12-03 16:46:37 +00:00
Alexey Edelev
210e036488 Add INTERFACE_LIBRARIES to dependencies of repo targets
Building repo targets may be incomplete as we skip adding
INTERFACE_LIBRARIES as dependencies. This leads to the missing
artifacts belonging to HEADER_MODULES. It seems reasonable and safe to
include INTERFACE_LIBRARIES in the list of dependencies of the repo targets.

Task-number: QTBUG-108815
Change-Id: I83f44018f42dcf2fb1e3299461e17ef53e79c2e5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ada76ac8b6ef6f4e8e6b60569c3d424aab335c3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-12-01 01:24:07 +00:00
Tor Arne Vestbø
c3fd2da7fb Apple: Add CFBundleAllowMixedLocalizations=YES to Info.plist files
We currently don't have any machinery for qmake or CMake to map
translations declared via TRANSLATIONS += or qt_add_translations
to the Info.plist CFBundleLocalizations key.

This results in macOS and iOS falling back to the development region,
CFBundleDevelopmentRegion, as the only supported localization of the
app, which is in most cases set to 'en'.

Unfortunately this doesn't work well with the behavior of iOS 11+
and macOS 10.13+ where the OS will set the locale of the app to
the best match between the app's supported localizations and the
user's preferred language.

https://developer.apple.com/library/archive/qa/qa1828/

Since we only support a single localization, the development region,
the locale always ends up as 'en_<REGION>', which after QTBUG-104930
is also reflected in the QLocale's uiLanguages(), resulting in the
QTranslator machinery always picking English translation for the app.

As long as we don't explicitly declare CFBundleLocalizations we need
to opt out of the system's behavior of finding the best match between
the app's declared localizations and the user's preferences, which we
can do via the CFBundleAllowMixedLocalizations key.

Fixes: QTBUG-63324
Change-Id: If7586d342148cbbb1d2a152cef039aad4448b13c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 4709c938dba72b69a91b584bfe34010fec9e2d43)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-11-04 09:09:57 +00:00
Tor Arne Vestbø
688eee2821 Apple: Use 'en' instead of 'English' as development region
This is consistent with what $(DEVELOPMENT_LANGUAGE) reports, as well as
the Apple Locales Programming Guide which states that "Locale names such
as “English”, “French”, and “Japanese” are deprecated in OS X and are
supported solely for backward compatibility."

Change-Id: I99779d678ef9d4ea90249572f2f977e9b4df6c62
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d84ddf5905ce9f68612519b72cdd077077bd0419)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-28 12:38:37 +00:00
Amir Masoud Abdol
b6eabe613f Fix a bug in detecting system
Since QtAutoDetect is called before the project, we still don't have
access to our IOS, WATCHOS, TVOS variables, and we must use
CMAKE_SYSTEM_NAME variable instead.

Change-Id: I61afe216baec85b3fcd489957f4b6774134f8078
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 626ebf4738ca0df93d0b9e5ccdb305cb1dfa0839)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-28 11:10:16 +02:00
Amir Masoud Abdol
54e855b0f2 Cleanup the watchOS and tvOS References from CMake files
In addition, I simplified some of the routines as we don't need the
extra check for them.

Task-number: QTBUG-107903
Change-Id: Idaf6ab1338a54bc1a9f242fcc8400ae200174beb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f157e223c21c79ebaf7e5e1a23dbdb3d8da1a59e)
2022-10-27 11:26:23 +00:00
Amir Masoud Abdol
5797796a9c Remove the Unnecessary CMake Module, include(CMakeParseArguments)
From CMake 3.7 both flavors of `cmake_parse_arguments` are natively
available in CMake, and loading the
`CMakeParseArguments` module is not needed anymore.

Fixes: QTBUG-107574
Change-Id: I7c8a6c5871cdb2f92a4aa43932b6f2ee99e1f57f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 10d5c0adafb7989c44794caef14a192cce9673a7)
2022-10-26 12:48:52 +00:00
Alexandru Croitor
4060a2ee93 CMake: Use unix paths in android xml files
We aim to allow building Qt for Android on one host, and make it
usable on any host.

Previously when built on a Windows host, we embedded windows style
paths into the android -dependencies.xml files, which caused
androideployqt to fail deployment when building a project on a unix
host.

In Qt 5, the dependencies xml files for Windows Android packages had
unix style paths. Thus switch to always using unix styles paths on
all platforms.

Amends a9d2c5b6d7fa6b7365db8690f57aa78002c8bc4b.

Fixes: QTBUG-107249
Change-Id: I851d3e0b08415b4c7f0d22baf43c10c715879ee7
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f7a34630a1c13c054cf06199bbb907ddc718e48c)
2022-10-19 11:35:09 +00:00
David Skoland
0e8f2fac5a wasm: enable QT_BUILD_MINIMAL_STATIC_TESTS by default
Wasm doesn't play well with these baseline tests in general,
so we can disable them for now.

Change-Id: I5a66a932449c8934d88b94e419aae5ddcc89ee78
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit c3730ffa9228ba43f4b7c7ec518a7a47e981ff2e)
Reviewed-by: David Skoland <david.skoland@qt.io>
2022-09-30 11:26:20 +02:00
Joerg Bornemann
42acd3514b CMake: Write all Host* properties to target_qt.conf
Otherwise, qmake won't work if the host Qt was built with custom
INSTALL_BINDIR and friends.

Task-number: QTBUG-106712
Change-Id: I436103efc21f245cc220f4706adcab369feba836
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5818dd3cadfe8184ed37a5d3d8363a1204a90aac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-30 06:13:56 +00:00
Joerg Bornemann
e609a00aae CMake: Fix HostData qmake property for cross builds
The target_qt.conf file contained a wrong HostData value if the
effective data dirs were set to paths of different levels in the host
and target Qt builds.  Fix this by computing the relative path from the
mkspec dir's parent to the ext prefix' data dir.

Note that qmake's HostData dir is the root directory of the mkspecs
directory.

Task-number: QTBUG-106712
Change-Id: Id8c9de925f5ff51901677b7218621747169a5cec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ea92137e7624d4abd544d79be8faf99471bfd87b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-28 13:19:11 +00:00
Alexandru Croitor
7bb095f09c CMake: Fix return value of applicationName() on macOS
QCore::applicationName() is influenced by what values we insert into
the Info.plist file of an application bundle.

We accidentally inserted tokens like ${PRODUCT_NAME} that are meant to
be expanded by xcodebuild, even when using a generator like Ninja.

This caused the applicationName() to report "${PRODUCT_NAME}".

Make sure to only call relevant finalizers for macOS applications
when using a generator other than Xcode.

Amends d5580aa7194b84306da52efb189cf126dbaee1f7

Fixes: QTBUG-106652
Change-Id: Idbc9c84557a8f17b1302e6969f6eb317e3ef225d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 865b1721bd284fac6c68eadb335507ea6cffb676)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-16 16:52:02 +00:00
Alexandru Croitor
f1fe9ae895 CMake: Add function to get tool wrapper shell script path
The _qt_internal_wrap_tool_command function has a limitation
that it is not possible to use it when a command needs to be wrapper
in a generator expression.

Provide a lower level API called
_qt_internal_get_tool_wrapper_script_path
to just get the path to the wrapper script, ensuring that the script
is created if needed.

Deprecate _qt_internal_wrap_tool_command, in favor of replacing it
with the new API.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ie4a4a17178bf2061ae01ee2b03b052d84560abf9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 59e08d21058661d9972da4840a82e2bc80d02741)
2022-09-16 13:21:15 +02:00
Alexandru Croitor
af165e9704 CMake: Rework tool wrapper shell script creation
Instead of creating the tool wrapper shell script only
during a Qt build in QtBuild.cmake,
ensure it is created any time _qt_internal_wrap_tool_command is
called, regardless if we're building Qt or a user project.

As a transitional period not to break compatibility, we also need
to create the script in QtBuild.cmake, until all usages of
QT_TOOL_COMMAND_WRAPPER_PATH are replaced with function calls.
Currently such usages are present in qtdeclarative.

When considering which bin dirs to add to the script's PATH
environment variable assignment, in addition to the build
internals relative bin dir, also add QT_BUILD_DIR,
QT_ADDITIONAL_PACKAGES_PREFIX_PATH and QT6_INSTALL_PREFIX.

QT_BUILD_DIR is important so we always pick up the just-built
but not installed libraries in a prefix build when running just-built
tools.

QT_ADDITIONAL_PACKAGES_PREFIX_PATH is important when building examples
as ExternalProjects in prefix builds, to ensure that the
not-yet-installed tools and libraries are picked up from the repo
build dir, which is passed via QT_ADDITIONAL_PACKAGES_PREFIX_PATH
to the external projects.

QT6_INSTALL_PREFIX is there in case if the build internals relative
dir is located in a different places than the Qt6 package.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I4d76fbbc275ca961379971054f87991adac36539
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 74083599f8b175e94789757e478a106ec03750d4)
2022-09-16 13:21:13 +02:00
Alexandru Croitor
3b5ba9e942 CMake: Move __qt_internal_prefix_paths_to_roots
Move it into QtPublicCMakeHelpers.cmake so it is available also when
configuring qtbase and the Qt6Config.cmake file is not yet loaded.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I88127fe0439ae26af1d125eb584244d315574a48
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 828e402a1904c25dc5ea9fa915a5da8559e08560)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-16 13:21:11 +02:00
Alexandru Croitor
08e7d943ef CMake: Move __qt_internal_collect_additional_prefix_paths
Move it out of QtConfig.cmake.in into QtPublicCMakeHelpers.cmake
so that the Qt6Config file is less cluttered.

Change-Id: I772a0cca35d5c03cd688c3f1de34984484444105
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 59f0f25f7161313988b2c40f3c26b8ee12a88877)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-16 13:21:09 +02:00
David Skoland
bf00ecb41b wasm: Replace QT6_INSTALL_PREFIX with WASM_BUILD_DIR in cmake helper
The change b515fa56a3144289023dc9588c5f73283599e4d4
introduced checking the emsdk version of a qt installation.
However, this checked for QT6_INSTALL_PREFIX where it may not be
defined. This fails when trying to build tests because
when configuring tests, it calls into add_target_helpers which
calls into this logic, and QT6_INSTALL_PREFIX is set after
this is called into, causing the qconfig.h lookup to fail.
To fix this so it works in all conditions,
we need to check if either install prefix or
build_dir is set and use whichever is set.

Change-Id: I3cf7e20d3d830f04e5b632fc51d8bf3b2758a717
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3bd54f285dd41f4c176ed54161b58ab5c85e14c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-13 16:13:12 +00:00
Michal Klocek
40e844918a Do not make extra copy of public headers for external headers module
Cmake install(TARGET) copies public and private headers even
if DESTINATION is unset, therefore add workaround and remove
public headers before the install call.

Note the reason we do not need this copy is that we install those
headers with install(DIRECTORY) to keep the directory structure as it
is required for example by freefont.

Fixes: QTBUG-104856
Pick-to: dev 6.4.0 6.3 6.2
Change-Id: I494935d01163cee4f2f19b95aec97f5fd7a12f84
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-12 11:21:32 +02:00
Rolf Eike Beer
9adc7c3a42 CMake: allow user specified boolean values to have any case
When running something like this:

    cmake -D FEATURE_xkbcommon=On qtbase

one would run into issues like:

    CMake Error at cmake/QtFeature.cmake:254 (message):
      Sanity check failed: FEATURE_xkbcommon has invalid value "On"!
    Call Stack (most recent call first):
      cmake/QtFeature.cmake:396 (qt_feature_check_and_save_user_provided_value)
      cmake/QtFeature.cmake:606 (qt_evaluate_feature)
      cmake/QtFeature.cmake:575 (qt_feature_module_end)
      src/CMakeLists.txt:12 (qt_feature_evaluate_features)

Change-Id: I33a921625b97aeb3c423cb7c1fb1bd3b05ce24a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 60829b0b257e62056aa32a7e58863b2c30bbdc89)
2022-09-07 11:53:23 +02:00
Lorn Potter
78a0203ffa wasm: add Emscripten version check for apps
This will tell developers if they are using the wrong version which may
not build or might cause other issues.

Fixes: QTBUG-105922
Change-Id: Ic5c4549d5637182dce380e415f131e33a4da416f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b515fa56a3144289023dc9588c5f73283599e4d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-09-01 03:48:16 +00:00
Alexandru Croitor
233b95f70a CMake: Move Apple specific functions into a separate file
Task-number: QTBUG-95838
Change-Id: Ib0ce53fe0e2068482b654921ecba3232efe656c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 51f8eaa3283daf78f32caa2f9db08860c3f7be9d)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-08-31 23:33:01 +02:00
Alexandru Croitor
22d453e104 CMake: Remove NSHumanReadableCopyright from iOS Info.plist
The key only applies to macOS bundles. Also, qmake doesn't have it.

Task-number: QTBUG-95838
Change-Id: I438f0079cc7b74672dfbe956769138a8bb006669
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c81da821c43a351578005737fcd21b5b903d728f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-31 08:53:50 +00:00
Lorn Potter
a09b9aaba9 wasm: update emsdk to 3.1.14
This fixes some threading bugs

Change-Id: I1a96dcc54d8338de09b551d52a166d073e85d752
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 83b75988964b70ec5d947bc38f9cc363232a2be8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-31 08:53:49 +00:00
Alexandru Croitor
0882148f5b CMake: Default CFBundleDevelopmentRegion to $(DEVELOPMENT_LANGUAGE)
That's what new projects in Xcode set.

Task-number: QTBUG-95838
Change-Id: Id07dca0f56c8849a93085c5d36910679e45381b4
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f16c7e15a2272673e99aee029808deccfe5d32f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-25 15:28:34 +00:00
Alexandru Croitor
0b072e4da2 CMake: Replace tabs with spaces in iOS Info.plist template
Change-Id: Ied8f31a22c14688fd250955bb54f161f07bea90b
Task-number: QTBUG-95838
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c0bb65ec022ba209aa0cf8d2615ba08922b3dccf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-25 15:28:26 +00:00
Alexandru Croitor
75b3f7ef55 CMake: Add COMMAND_ECHO option to _qt_internal_create_command_script
Change-Id: I7884855b7934c1f65d8699759408f5c89632ba11
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 459f71466267a8fb5ff05de21e9a3865796d4e06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-18 06:48:31 +00:00
Alexandru Croitor
0413d13f03 CMake: Move _qt_internal_create_command_script to a public file
It's needed for creating qmake build tests.

CMake / CTest has a limitation of not allowing to create single-config
tests when using a multi-config generator using the add_test(NAME)
signature.

Using add_test(NAME) forcefully creates per-config tests, which means
that it's not possible to just run ctest to execute tests, without
specifying a -C parameter, which we do in the CI.

qmake tests need to use the add_test(NAME) signature
to specify the WORKING_DIRECTORY option.

Because of the above limitation, a work around is to not use the
add_test(NAME) signature, but instead delegate the working directory
assignment to a generated cmake script, which
_qt_internal_create_command_script can already do.

Task-number: QTBUG-96058
Change-Id: I6f439165994671724157f0edb7a71e351271e329
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit edb88a3b2914bcce4a0a99b17ef14e3d4db0a220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-18 06:48:30 +00:00
Morten Sørvig
13bf20c8aa wasm: include asyncify support unconditionally
Emscripten's option for enabling asyncify (-sASYNCIFY) is a link-time
option, which means there is no requirement to have a separate asyncify
build, at least for static builds.

Replace the current QT_HAVE_EMSCRIPTEN_ASYNCIFY compile-time option
with a run-time option which checks if the asyncify API is available.

Keep support for configuring with "-device-option QT_EMSCRIPTEN_ASYNCIFY=1"
for backwards compatibility and for the use case where want asyncify
support to be on by default for a given Qt build.

Enable asyncify for the asyncify_exec example.

Change-Id: I301fd7e2d3c0367532c886f4e34b23e1093646ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f347682fd52fd8e94f15a06cda9f1a64ebc4d552)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-17 03:04:42 +00:00
Tor Arne Vestbø
49edec3888 CMake: Override simulator architecture to x86_64 for Xcode generator
The simulator build of Qt for iOS is currently x86_64 only, instead
of universal builds with an arm64 slice as well, since we don't
support xcframeworks. This means we can't rely on Xcode's default
simulator arch settings, which on an Apple Silicon Mac will be
arm64.

Instead we override the simulator arch, like we do for qmake.

Change-Id: I8b52389db1b83f4f9679c724bcde53b44dbc76f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6ec21881dd68dfd88dee03b11036c3c862ccbbab)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-15 23:45:22 +02:00
Mikolaj Boc
649b1774a1 Make wasm finalizers work for standalone tests and other repos
The wasm helpers file is not included in QtBuild and is thus not visible
when standalone tests or other repos are being built. This fixes it.

Amends 1f9c1f032c5d8af2c6758081eb8de076fe678b53

Fixes: QTBUG-105615
Change-Id: I6c9229e1f259fa5043d7d11b8ee0293e26077f3e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 644ae42e12feb0056385ddb28f444e72107c9dc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-15 19:05:28 +00:00
Alexandru Croitor
0fac2ae499 CMake: Enable public executable finalizers for iOS tests
This ensures that tests can be executed on the simulator or device, by
doing the necessary steps like setting a bundle identifier, Info.plist
file, launch screen, etc.

This is done by calling _qt_internal_finalize_executable in the
implementation of all internal test adding functions.

The finalizers are limited only to iOS for now, as an incremental
step, and to ensure we don't accidentally break tests on other
platforms.

At least WebAssembly uses its own finalizers which would likely cause
duplicate calls if the _qt_internal_finalize_executable was
unconditional.

Fixes: QTBUG-104754
Change-Id: I729d56385dd206b22c975fc2ce4e2c683e6e4e2c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6c9f4f5ebcd35dc1a68c442d9fbf3ec48f30baca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-15 16:19:15 +00:00
Alexandru Croitor
d5eae411bc CMake: Tests on iOS must be app bundles to be runnable
Task-number: QTBUG-104754
Change-Id: I05053d0f242f45e56e7a95ac75f5ef63ca8a5e0e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c76bf583504091f91f119135befdef0e02a5ddf5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-15 16:19:15 +00:00
Alexandru Croitor
807fd5684a CMake: Use the Xcode generator for qt-cmake-standalone-test on iOS
Task-number: QTBUG-104754
Change-Id: I43aae05f7e101a619d2c1b97d9a96c74d8498bfa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3608bb543d4a862a185ffba55043f736c42c9ace)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-15 16:19:15 +00:00
Alexandru Croitor
fe6f7de8ce CMake: Improve tool not found error message
Change-Id: I7f04e4af80c4d23b855c8c9d5f5017f8afb112ea
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e671b852e70b5ed960ab2a4286aabb458e39df40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-12 16:18:35 +00:00
Lorn Potter
6b2af05f27 wasm: allow apps to override EXPORT_RUNTIME_METHODS
Developers can add to Emscripten's EXPORT_RUNTIME_METHODS
by defining their own using:
QT_WASM_EXTRA_EXPORTED_METHODS

Which will add on to Qt's default exported runtime methods
of UTF16ToString,stringToUTF16

for cmake:
set_target_properties(<target> PROPERTIES QT_WASM_EXTRA_EXPORTED_METHODS "ccall,cwrap")
or
set(QT_WASM_EXTRA_EXPORTED_METHODS "ccall,cwrap")

for qmake:
QT_WASM_EXTRA_EXPORTED_METHODS = ccall,cwrap

Done-with: Mikolaj Boc
Fixes: QTBUG-104882
Change-Id: I9678bdb7b077aaa8527057212ea4e161c0be0b60
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1f9c1f032c5d8af2c6758081eb8de076fe678b53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-12 00:14:00 +00:00
Joerg Bornemann
25ba921d50 CMake: Fix detection of system double-conversion
...if the double-conversion CMake package cannot be loaded.

The find_path call must specify the header exactly as it is included.

The select_library_configurations call always failed, because the
command expects the presence of DOUBLE_CONVERSIONS_LIBRARY_DEBUG,
DOUBLE_CONVERSIONS_LIBRARY_RELEASE, or both.

Upstream double-conversion's MSVC build system does not specify a naming
scheme for the debug build, and there are no debug/release binaries to
download that suggest a naming scheme.  Therefore we assume the usual
'd' suffix for the debug library like we do everywhere else.

Lastly, we need to set DOUBLE_CONVERSION_INCLUDE_DIRS.

Fixes: QTBUG-105501
Change-Id: I71ff5238f353541b8bf5ac6792b86134deba20d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a29af6656f1c33355c4cbfe8587b8f6eae691a21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-10 21:17:06 +00:00
Alexandru Croitor
db169494bd CMake: Bail when configuring multiple configurations and plain Ninja
Previously configuration would not error out if you configured Qt
with -DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug -GNinja
instead you would get an error like

 CMake Error at cmake/QtBaseConfigureTests.cmake:51 (message):
 Failed to find compiled architecture detection executable at
 qtbase/build/config.tests/arch/RelWithDebInfo/architecture_test.exe

Note that Qt code tries to find the arch test in a RelWithDebInfo
directory but due to using single-config Ninja,
CMAKE_CONFIGURATION_TYPES is ignored, and the executable is placed
in a non-config specific folder.

Error out early in such a case, and mention that for multi-config
builds, the Ninja Multi-Config generator should be used.

Change-Id: I0192185123be563671cbe154f968a03b7458e327
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0ce5c0a9969bc8c763ab50b6271e203c2bcb90de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-10 21:17:06 +00:00
Tor Arne Vestbø
a3c6755566 cmake: Don't reference global data in qt_internal_get_title_case
The only place the function was used was to generate the title case of
a target, so the issue wasn't spotted until now.

Change-Id: Iee66ecea569e7411c6b5a5e5312cde910a48fa01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3ad0f755f56eae4e8d94459f7cc17671e51e95da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-10 09:41:25 +00:00
Tor Arne Vestbø
1d8e144b6a Disable bitcode for iOS
It's deprecated as of Xcode 14, and generates a warning message if a
project explicitly enables bitcode. The App Store no longer accepts
bitcode submissions from Xcode 14.

Change-Id: Ib1f9d5114ca4d8b1845ecc7a9de0473ee015db33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e27a0d5a0f8818653ff125409db8187454409749)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-10 09:41:24 +00:00
Joerg Bornemann
628d2c8108 Remove cmake/FindCups.cmake
All supported CMake versions provide this file, and we did not modify
it.

Change-Id: I4b21a99159ba8315491dc64ab737b7e5a28a6966
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d405713647da23b8d218c097fb4f2457d853c669)
2022-08-10 11:41:24 +02:00
Alexandru Croitor
53cdf7525e CMake: Fix examples to build as external projects when cross-compiling
We forwarded the compiler path to the EP but not the flags that might
have been set via the CXX environment variable.

Make sure to also forward the flags.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I0fbf9b595f7885014b1f09d158db52e56a3d5243
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7fb25609a41ab9cc20ddd62e90f30c0536502aef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-05 16:18:03 +00:00