Commit Graph

1885 Commits

Author SHA1 Message Date
Yuhang Zhao
ade68c9949 MSVC: Disable buggy conformance check
/Zc:lambda seems buggy. Although in my experiments it works well
for 99% Qt repos, it seems some tests will trigger the bug and it
also blocks some new commits. So disable it for now, it's not stable
enough.

Now that this check is disabled, the workaround for tst_qstringapisymmetry
is also not needed anymore, so remove the workaround as well.

Partially reverts commit 8cb832090a

Change-Id: Icf0ecbbaa6262522470e5f5dea05705985ab18f1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-18 19:31:25 +08:00
Yuhang Zhao
8cb832090a MSVC: Enable all possible conformance checks
For the full list, please refer to [1].

Needed to change the qstringapisymmetry unit test:
In theory we don't need the array to be static and it did compile
without any problems so far, indeed. However, with this patch applied,
MSVC complains that the lambda function below can't access the array.
I don't understand why, because we use [&] in the lambda and it should
capture all the variables in theory, but in reality it failed to
capture this variable in the end. And making the variable static
solves this issue. Maybe it's a MSVC bug.

Already tested locally. Most Qt repos build without any issues,
only very few repos are not tested, as my local environment
can't build them.

[1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-conformance?view=msvc-170

Change-Id: I658427aa171ee1ae26610d0c68640b2f50789f15
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-15 13:34:20 +00:00
Amir Masoud Abdol
d159767318 Clarify a Point for Building Locally on Apple Silicon
On Apple Silicon, Homebrew is installed under `/opt/homebrew` instead of
`/usr/local`, so I made a minor change clarifying this.

Change-Id: Ifccb51325339f80f8ed3c2a4f8acab485686af7e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-14 19:16:28 +02:00
Morten Sørvig
69033876c6 wasm: use standard clang optimization options
These were mostly identical. Use the base clang config
and then specialize for Emscripten in a separate section.

Behavior changes: QT_CFLAGS_OPTIMIZE_SIZE is now -Oz instead
of -Os. Emscripten does not allow -Og, replace that flag
with -O2 -g.

Change-Id: I08163551ad6b84377b99f287983cc1191521055c
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2022-10-14 11:17:32 +00:00
David Skoland
20144aab0b wasm: Make Chrome default testing browser
Currently, emrun will pick the browser to run tests on somewhat
arbitrarily. For predictability and stability, we should use one
browser as a basis, and Chrome seems to be a good fit as wasm features
are generally in good shape on it and it has good support for launching
from command-line.

Change-Id: I1d06a5916ad24ab9df9b0826c0773c652e6d3fcd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-11 16:10:58 +02:00
Alexandru Croitor
f7a34630a1 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 a9d2c5b6d7.

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>
2022-10-07 18:18:23 +02:00
Ivan Solovev
9d1e928512 Do not include qglobal.h into the new headers
Several new headers were extracted from qglobal.h in scope of
QTBUG-99313. This commit makes sure that none of them actually includes
qglobal.h.
As those files are new, it should be safe to introduce this change, as
it shouldn't have any impact on the user code.

This patch also modifies the autogenerated module exports header to
include qglobal.h before the include guard. This is needed to prevent
circular dependencies which result in Q_<MODULE>_EXPORT being
undefined.

Task-number: QTBUG-107046
Change-Id: I8d998792fd8129173d9ec811557e7d7604282813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-06 14:26:25 +02:00
Alexey Edelev
658c166f96 Add 'warnings are errors' functionality to syncqt.cpp
Add the -warningsAreErrors command line argument to syncqt.cpp that
causes a fail at build step if any of header files doesn't fit the
syncqt standards. The argument reflects the WARNIGS_ARE_ERRORS CMake
variable state.

Output the syncqt.cpp warnings at configure time.

Fix the faulty positive IncludeChecks failure flag.

Task-number: QTBUG-107088
Change-Id: Id30af4c7b78fd44c1c99c7e9306965d03a0f992d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-01 16:24:01 +02:00
Joerg Bornemann
5818dd3cad 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.

Pick-to: 6.4
Task-number: QTBUG-106712
Change-Id: I436103efc21f245cc220f4706adcab369feba836
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-29 06:45:32 +00:00
Alexey Edelev
bcd08f86da Check if configure-time executable need to be recompiled
Respect source files that belong to configure-time executable when
reconfiguring Qt.

Amends: ac74b60c9c

Task-number: QTBUG-87480
Change-Id: I7e42ffe8b1b79686c0cf93a02101f0b8e6be0bea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-28 21:47:14 +02:00
Joerg Bornemann
ea92137e76 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.

Pick-to: 6.4
Task-number: QTBUG-106712
Change-Id: Id8c9de925f5ff51901677b7218621747169a5cec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-28 09:48:20 +02:00
David Skoland
c3730ffa92 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.

Pick-to: 6.4
Change-Id: I5a66a932449c8934d88b94e419aae5ddcc89ee78
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-28 09:48:06 +02:00
Lucie Gérard
38f8d531a2 Apply fixes for SPDX compliance and easier parsing
Task-number: QTBUG-106233
Change-Id: Ic636bcfc7d5efcf23c67482beebe2fff1f184073
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-27 20:38:14 +02:00
Alexey Edelev
b89d63515b Replace the syncqt.pl script with syncqt tool
syncqt.pl adds an extra dependency on perl when building Qt. Modern C++
provides the convenient cross-platform way to access a filesystem and
to use regular expressions, so we may replace the perl script with C++
application. The syncqt executable is built at configure time and
installed as QtCore tool. It's running at configure time to deliver the
required header files for IDE to build a consistent code model and at
the build time to keep tracking changes in header files and generate
the missing aliases without reconfiguring. 'syncqt' only parses header
files from a CMake build tree, so the resulting Qt installation only
contains interfacing headers that belong to the platform that Qt is
built for. 'sync.profile' files are not used as the 'source of truth'
for sync qt procedure anymore, all the necessary information is taken
from either CMake files at configure time or from the module header
files while parsing them.

syncqt.pl is still in place since it's required as fallback solution
for a smooth transition to the new syncqt implementation for all qt
repositories.

This patchset only enables the C++ based syncqt for 'qtbase'
repository.

From the performance perspective C++ version works faster then perl
script, also the configure time is reduced significally on subsequent
reconfigurations - up x2 times faster when re-configuring repository,
but it also takes time to compile the tool itself the first time.
Numbers for qtbase:
           syncqt.pl  syncqt.cpp
 initial:  0m16,035s  0m20,413s
 reconfig: 0m6,819s   0m3,725s

The syncing procedure can be run separately for each module using
<ModuleName>_sync_headers targets. The 'sync_headers' target can be
used to sync all the modules at once.

Task-number: QTBUG-87480
Task-number: QTBUG-103196
Change-Id: I8c938bcaf88a8713b39bbfd66d9e7ef12b2c3523
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-27 13:12:11 +02:00
Alexey Edelev
0a4761522b Avoid the 'file' command shadowing
Avoid the 'file' command shadowing by a variable and use file name when
filtering header files by type.

Amends 8539e641f6

Task-number: QTBUG-103196
Change-Id: If012975efafaf119cffbd89baf84df334bc057ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-21 20:41:43 +02:00
Alexey Edelev
6f12603cb1 Use PARSE_ARGV signature to process arguments instead of escaping
Use PARSE_ARGV signature of the cmake_parse_arguments function to avoid
escaping of semicolons when passing arguments to the
qt_internal_add_configure_time_tool and
qt_internal_add_configure_time_executable function.

Amends ac74b60c9c

Task-number: QTBUG-87480
Change-Id: I343abbd75107e56aaccab6e388db8dbda0525af3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-21 14:00:37 +02:00
Alexey Edelev
0b59c204a4 Add qt_configure_file_v2 function
The function does the same as the original one but respects semicolons
in CONTENT argument due to the use of the cmake_parse_arguments variant
with PARSE_ARGV.

Change-Id: I263662dc18e411a735b586995b82791fc6b888ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-21 14:00:37 +02:00
Ulf Hermann
00b9409843 Android: Disable androidtestrunner extra timeout
We already have:

a, a timeout as part of QtTest. By default it lets each test function
   run for 5 minutes. This timeout can be configured using
   QTEST_FUNCTION_TIMEOUT.
b, maxTimeBetweenOutput in the CI. The CI will kill the process if too
   much time passes between individual output lines of a test.
c, maxTimeInSeconds in the CI. This does exactly the same as the
   androidtestrunner timeout.

The CI timeouts can be centrally tuned per platform and Qt module. This
is preferable over a special timeout just for android.

As other people may be using androidtestrunner for unrelated projects,
don't delete the timeout, but simply disable it from CMake by setting
it to -1.

Task-number: QTBUG-106479
Task-number: QTBUG-101596
Task-number: QTBUG-100242
Change-Id: If4ce00948e204182bb12ac4859d3b0dd193de7ad
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-09-21 14:00:37 +02:00
Mikolaj Boc
a5205d983b Set NO_EXCEPTIONS on executables on wasm
This reflects the true state of exceptions on WASM, which are always
disabled (DISABLE_EXCEPTION_CATCHING is always set with 1).

Change-Id: I7b681846159caf61f291f78a7b4ddf5260dc341f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-19 12:44:21 +02:00
Mikolaj Boc
bb582f7fd5 Use the js test runner for all tests on wasm
Make cmake changes that have ctest run the emrun test runner for
all tests that are build for wasm.

Change-Id: I8c07068d79cfd0d745dbcc3d3f025c7c48fe1069
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-19 08:54:02 +02:00
Alexandru Croitor
469dbe5c6d CMake: Fix _qt_is_test_executable assignment for tests
_qt_is_test_executable can only be set on a test that is backed by a
real target. QMLTESTs might not backed by an executable target, if
they are missing cpp SOURCES.

Which led to errors like

 CMake Error at
  cmake/QtTestHelpers.cmake:510
 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  textedit
 Call Stack (most recent call first):
  tests/auto/qmltest/textedit/CMakeLists.txt:10 (qt_internal_add_test)

Amends 62c681a599

Change-Id: Ie66fd3e94484562061f851c0a034629959d091da
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-09-17 00:30:39 +02:00
Alexandru Croitor
865b1721bd 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 d5580aa719

Pick-to: 6.4 6.4.0
Fixes: QTBUG-106652
Change-Id: Idbc9c84557a8f17b1302e6969f6eb317e3ef225d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-16 14:32:51 +00:00
Mikolaj Boc
62c681a599 Set target property _qt_is_test_executable on all tests
This is needed to later determine what kind of runner should be
selected on WASM for the executable. Tests use the test runner,
whereas other executables use qtLoader.

Change-Id: I75aa361403b72f8e82a288967b8a81b8232d68dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-16 16:32:51 +02:00
Alexandru Croitor
59e08d2105 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.

Pick-to: 6.4
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>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
74083599f8 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.

Pick-to: 6.4
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I4d76fbbc275ca961379971054f87991adac36539
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
828e402a19 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.

Pick-to: 6.4
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I88127fe0439ae26af1d125eb584244d315574a48
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
59f0f25f71 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.

Pick-to: 6.4
Change-Id: I772a0cca35d5c03cd688c3f1de34984484444105
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Joerg Bornemann
c9c04291f5 CMake: Add Linux support to qt_deploy_runtime_dependencies
Before this change, qt_deploy_runtime_dependencies supported Windows and
macOS only.  We add a generic deployment method implemented in
cmake-language with file(GET_RUNTIME_DEPENDENCIES).  This deployment
method is now enabled for shared builds on Linux.

The file(GRD) command requires that the EXECUTABLE argument points to
the executable in the build directory.

Only libraries in Qt's installation directory are considered for
deployment.  This includes Qt's own libraries and also things like
libicu*.so we're shipping with the installer.

Unlike macdeployqt and windeployqt, the generic
qt_deploy_runtime_dependencies does not yet support deploying
translations.  We will catch up on this in a later commit.

Change-Id: Iea23abcdba774d4c1885c8d2c243eb3e48fb7fae
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-15 12:55:23 +02:00
David Skoland
3bd54f285d wasm: Replace QT6_INSTALL_PREFIX with WASM_BUILD_DIR in cmake helper
The change b515fa56a3
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.

Pick-to: 6.4
Change-Id: I3cf7e20d3d830f04e5b632fc51d8bf3b2758a717
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-13 18:13:00 +02:00
Alexey Edelev
ac74b60c9c Add function to add and compile executables at configure time
qt_internal_add_configure_time_executable compiles the executable
at configure time and exposes it to the CMake source tree. This is
useful when need to run a small C++ program at configure time.

Task-number: QTBUG-87480
Change-Id: I031efe797c8afa0721d75b46d4f36f67276bf46e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-13 00:50:47 +02:00
Alexey Edelev
553185e8c3 Skip AUTOGEN for config files
Amends c7d1d56b09

Task-number: QTBUG-103196
Change-Id: I319ca96bb54b9d0274270790d8c92151ea3398f0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-12 20:31:04 +02:00
Alexey Edelev
0c1368c7e4 Move the tool look-up functionality to a separate function
Change-Id: Ibe9ef9de981afac4b585068c62eef5af01989417
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-12 20:09:03 +02:00
Alexey Edelev
c7d1d56b09 Add <module>-config[-p].h files to the module sources
<module>-config[-p].h files need to be added to the CMake source tree

Amends 8539e641f6

Task-number: QTBUG-103196
Change-Id: I8baaa672ad869da8a030d890da8bdea5bd8c7794
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-09 17:04:16 +02:00
Morten Sørvig
8c959a3609 wasm: don't set GL_DEBUG
This spams the console with "writeStackCookie"/"checkStackCookie"
messages, which makes finding relevant debug output harder.

Pick-to: 6.4
Change-Id: I352b633f02f9ecc1333d1d91f5ffc21a4a937e53
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2022-09-08 12:15:24 +00:00
Alexey Edelev
5d38e1f295 Suppress the PUBLIC/PRIVATE_HEADER related warning
Avoid adding module header files to a PUBLIC/PRIVATE_HEADER for the
modules. All header files are installed using install(FILES call, but
not as a part of install(TARGET

Amends 8539e641f6

Task-number: QTBUG-103196
Change-Id: Ib95295112c74f74f237e3738d2532f9049d26ce6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-07 21:15:49 +02:00
Ivan Solovev
b83fc9f41a CMake: propagate deprecations definitions to tools and apps
If Qt itself is built without the deprecated APIs, so should be the
tools and apps.

This patch makes sure that the specified QT_DISABLE_DEPRECATED_UP_TO
and QT_WARN_DEPRECATED_UP_TO values are correctly used in the internal
tools and apps.

Fixes: QTBUG-105102
Change-Id: I7a51bddbd839c7b71efa0bff8ec959df64c53b82
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-07 19:51:38 +02:00
Alexey Edelev
8539e641f6 Respect CMake source tree when installing header files
Use CMake source tree when installing header files instead installing
all header files that syncqt.pl produces. This avoid adding header
files which cannot be used because of platform or feature
incompatibility with Qt version. Since syncqt.pl doesn't respect CMake
build tree when generating master header and CaMeL case header files,
these header files still will be installed regardless platform or
feature limitations. This will not be the case once we switch to
syncqt.cpp, which will install only headers that are relevant to the
selected platform and enabled features.

Task-number: QTBUG-103196
Change-Id: I7d64754648747bee700d96f2fd6228fe7248512e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-07 14:39:25 +02:00
Ivan Solovev
734e0a2fbe CMake: propagate deprecation definitions to unit-tests
If Qt itself is built without the deprecated APIs, but the tests are
not, tests will fail to compile and/or link.

This patch makes sure that the specified QT_DISABLE_DEPRECATED_UP_TO
and QT_WARN_DEPRECATED_UP_TO values are correctly used in the tests.

The definitions are propagated to tests, batched tests, manual tests
and benchmarks.

Fixes: QTBUG-104858
Change-Id: Idf15accaf96c47599084426ba625b985f507ca8b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-06 16:57:58 +02:00
Morten Sørvig
b4f31336e3 wasm: suppress pthreads-mem-growth warning
Suppress the pthreads-mem-growth warning for developer builds.
We (the Qt developers) are aware of the issue, so we don't
need the reminder.

Change-Id: Ib924a4dd87b8647d5f1052ab40c0ddf4b9f42108
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-09-06 10:48:10 +02:00
Rolf Eike Beer
60829b0b25 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
Pick-to: 6.4 6.3 6.2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-05 06:49:34 +02:00
Mikolaj Boc
1e00ddc2cb Do not query for the nonexistent QT_FEATURE_exceptions feature
The feature does not exist. Do not query for it and assume it's always
off for the purpose of WASM build.

Change-Id: I7e76242c9b3423bfe16872f668c60dae2e74fabe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-02 21:02:27 +02:00
Mikolaj Boc
aeb33b7d61 Add NO_EXCEPTIONS on WASM unconditionally
DISABLE_EXCEPTION_CATCHING is added unconditionally on WASM. Add
NO_EXCEPTIONS for all WASM tests since those are never supported.

Change-Id: I2ee10779e7ae0d285494ad650be52dee3099915a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-02 21:02:27 +02:00
Mikolaj Boc
e38807996f Add wasm target helpers in a finalizer when adding executable
This way it is able to pick up all of the properties assigned to it
before finalization.

Change-Id: I9da635f8620859a669c4e4d589fff56a3ce42ab9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-02 11:35:51 +02:00
Alexey Edelev
0255cce4de Use the INSTALL_CMAKE_NAMESPACE to locate module tools target
Replace hardcoded Qt6 prefix of module tools target when setting
the name of tools package.

Change-Id: Icb6f38cce766c9d32216a65a8a5ce9552d622b72
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-01 21:37:11 +02:00
Mikolaj Boc
67deefbaaa Build in test data on WASM
Local file system files are difficult to reach on WASM. Build the test
data in so that it's reachable to WASM tests nevertheless.

Change-Id: I65022db7645248d040434759fb60c3076fd65bd8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-01 19:44:20 +02:00
Morten Sørvig
df76a0585f wasm: set ALLOW_MEMORY_GROWTH for multi-threaded builds
Unify the settings for single-threaded and multi-threaded builds;
Qt now always enables heap growth by default.

This means we don't have to reserve a large (1GB) fixed memory
size, but can instead set the smaller (50 MB) initial memory size,
like the single-threaded build does.

Enabling threads + memory growth can potentially cause
a performance regression when accessing heap memory from
JavaScript (https://github.com/WebAssembly/design/issues/1271).
We leave it for the application to decide if this applies,
and if the switch to fixed memory should be made.

Change-Id: I96988b072506456685086e55aca4007a146bd70f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-09-01 15:42:28 +02:00
Lorn Potter
b515fa56a3 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.

Pick-to: 6.4
Fixes: QTBUG-105922
Change-Id: Ic5c4549d5637182dce380e415f131e33a4da416f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-09-01 11:17:30 +10:00
Mikolaj Boc
619cb795b2 Plug the WASM batched test runner into the build system
The new batched test runner is now used for running the tests instead
of the wasm shell, which runs for single test cases.

Change-Id: I7b7e6dd7993ba7937124c5843356b6891301b893
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-31 16:53:52 +02:00
Alexandru Croitor
51f8eaa328 CMake: Move Apple specific functions into a separate file
Pick-to: 6.4
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>
2022-08-30 20:36:13 +02:00
Morten Sørvig
be44827240 wasm: add support for building Qt as shared libraries
This implements the build system bits required to build Qt
as as separate wasm modules a.k.a Emscripten side modules.

Enable by configuring with the "-shared" flag.

This is the first step towards shared library support and gets
us as far as being able to load QtCore and instantiate a
QCoreApplication.

Task-number: QTBUG-63925
Change-Id: Ib8f07f80fb5b13c8dbba65c7db735dc557b70d0e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-30 22:11:01 +10:00