Commit Graph

2056 Commits

Author SHA1 Message Date
Amir Masoud Abdol
da2b0307f8 Replace STREQUAL cases with variable checks
As I was investigating the NO_UNITY_BUILD_SOURCES issue, I realized that
we don't need to pass these quoted, especially now that we have moved
to `cmake_parse_arguments(PARSE_ARGV`, and we can check their existence
just by checking the `arg_*`, and that should be sufficient.

I also left a warning that we are aware of this.

Pick-to: 6.5
Change-Id: I4d939e80dc4671ea3ae9dc61516279f69ba2c5a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-04 08:55:02 +02:00
Amir Masoud Abdol
936c3bd224 Add NO_UNITY_BUILD support to qt_internal_add_app
Task-number: QTBUG-109394
Pick-to: 6.5
Change-Id: Iefeb3b846cd889d6ae0aa786f9ae23fbfc811b64
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-03 12:41:14 +02:00
Amir Masoud Abdol
ed85df8008 Improvement to NO_UNITY_BUILD_SOURCES, and fix related bugs
The source of the problem was in `qt_set_target_info_properties` which
was not able to process the NO_UNITY_BUILD_SOURCES, and therefore
leaking it into the `TARGET_COPYRIGHT`, ie., the last argument. So, I
decided to pass Unity Build arguments before them, and closer to
SOURCES, which is nicer to read, and avoid similar situation. And
I reverted the work around in the amend commit, and passing the
arguments normally.

This happens because we pass an unfiltered ${ARGN} from
qt_internal_add_executable to qt_set_target_info_properties and that the
current change is merely a workaround that ensures they get
circumstantially filtered out, because the NO_UNITY_BUILD_SOURCES option
appears before any of the first TARGET_ props.

Amend cd12c1f332

Task-number: QTBUG-99238
Task-number: QTBUG-109394
Pick-to: 6.5
Change-Id: Idb37937cf53e708425402c90f55bda8816e27f29
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-03 10:41:13 +00:00
Alexey Edelev
4105ff809c Avoid syncing and installation of non-module headers
Add CMake rules to skip syncing and installation of header files
that are recognized as non-module. Previously these rules were in
syncqt.cpp only and CMake ignored them when creating the installation
rules. Now we skip any post processing for the header files that:
- are public and located in the '3rdparty' directory unless the module
  is the 3rdparty one
- are not a part of the module source tree unless they are generated
- have the _qt_non_module_header property set to TRUE

Pick-to: 6.5
Change-Id: I045cfc2b8074f0c086c975aae95f14845e3edfef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-03 12:41:13 +02:00
Alexey Edelev
f9594cefef Add the missing list of the generatedHeaders to syncqt_all_args
We need to pass the list of generated files to make the correct
filtering when generating the module master header. Otherwise
generated headers will endup in the module master header.

Pick-to: 6.5
Fixes: QTBUG-112458
Change-Id: Icd20fe5999db379d0eafbff7dad20765e1a96350
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-31 14:10:03 +02:00
Timur Pocheptsov
21a6c86979 iOS: request authorization before presenting image-picker
Right now, image picker view is shown first (it does
not require access to photos, since it's essentially
Photos app getting access to photos ...). Then, we use
AssetsLibrary to get asset for an url (using ALAssetsLibrarie's
-assetForURL method). This may trigger a permission-related alert, asking to:
   a. Select more photos or ...
   b. Allow access to all photos or ...
   c. Deny access.

Showing this alert _after_ picker has selected an image  makes little sense
(and probably was never intended this way anyway). Instead, we now use
Photos.framework to check the authorization and, if needed, we request
an authorization (when the current status is 'Nondetermined'). If authorization
is 'Granted' as a result, we show picker view and proceed as normal/before.

Pick-to: 6.5
Task-number: QTBUG-109120
Change-Id: I0acfd7b0476346360d75a5e37f5845aaf2d6e3e0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-28 18:37:36 +02:00
Ahmad Samir
396e6daea4 CMake: add some docs for qt_find_package
For -developer-buildS qt_find_package caches which packages were found
on the first configuration, to make the build system pick up a newly
added qt_find_package call one needs to follow one of the methods
that are now mentioned in the docs.

Hugely based on commit message from commit
6847a19e3e.

Change-Id: I4a13d3c97a6172f504a57298c4b3edee30d21250
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-28 15:45:24 +02:00
Joerg Bornemann
bd7e304d48 CMake: Write target architecture into module info files
Store the target architecture in the module information files under the
key 'built_with.architecture'.

Task-number: QTBUG-111158
Change-Id: Ida4cde3b15103773824a8d9d78f082540b806736
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-21 17:11:09 +01:00
Antti Määttä
4a9696aa05 Trace: Make Q_TRACEPOINT public
Allows sharing tracepoints between modules so that they can share one
trace group.

Pick-to: 6.5
Change-Id: I8de6da6beef02b34700cc2ecb1fad0e72a00b7e0
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
2023-03-21 10:06:32 +02:00
Joerg Bornemann
656729c5b6 CMake: Write Qt's namespace into module info JSON files
If Qt was configure with QT_NAMESPACE set, store that in the module
information files under 'built_with.namespace'.

Task-number: QTBUG-111158
Change-Id: I273309cb263c64f801dbb7238440336d7afa635e
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-20 18:48:57 +01:00
Kai Köhne
003b084f38 Centralize copyright information for Qt
Maintain one central place - .cmake.conf - for information
about Qt's copyright.

Pick-to: 6.2 6.5
Change-Id: Ibcbce4313eba9660d459061b0ad00307e267b8f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-20 13:03:44 +01:00
Kai Köhne
70bc5dcb75 Update Copyright year to 2023
Pick-to: 5.15 6.2 6.5
Change-Id: I8812bf2523ccb715407181aec6aebf2034c8ff84
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-20 12:03:44 +00:00
Amir Masoud Abdol
cd12c1f332 Fix an issue with passing NO_UNITY_BUILD_SOURCES
Amend 31518f1a4e
Amend 3602936230

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ibb2fd881c02b6496f06b8b623fa6009358755a26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-15 18:18:01 +01:00
Amir Masoud Abdol
3602936230 Improve the internal handling of unity build
- Removed the NO_UNITY_BUILD argument from commands that disable it by
  default.
- Add a warning in case NO_UNITY_BUILD or NO_UNITY_BUILD_SOURCES is
  being used where it is already disabled, e.g., qt_internal_add_test
- Exclude all sources of a target from unity build if NO_UNITY_BUILD
  is set on the target. This sounds a bit harsh, but I have noticed that
  sometimes the same source file can be included somewhere else, and
  some unexpected collision may occur.
- qt_examples_build_end excludes all its examples from the unity build.
- qt_build_test now sets the CMAKE_UNITY_BUILD to OFF before configuring
  the tests, and restore its value when done.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia42e7dd5a5bfb151db241deb639325720fd91eec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-14 17:28:44 +01:00
Alexandru Croitor
595ac662ed CMake: Pass CMAKE_EXE_LINKER_FLAGS to project-based try_compile
CMake does it for non-project-based try_compile calls if the
CMP0056 policy is set to NEW. That was introduced in CMake 3.2,
thus set it unconditionally.

The use case is to pick up custom -rpath-link paths when
cross-compiling.

Pick-to: 6.4 6.5
Change-Id: I726b90267dd46de116052b5b7f19b9354a568200
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-14 15:55:47 +01:00
Mikolaj Boc
d7f0677368 Skip also QML tests in submodules when batching is on
This should be handled later ideally, for now we should skip and
QML tests targets are still being produced, which leads to errors
on WASM.

Task-number: QTBUG-109786
Change-Id: I3d0d1f3115e324c7a0cb036e972226310294b216
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-13 22:26:08 +01:00
Mikolaj Boc
bd68df0905 Adapt qt_process_qlalr for test batching
Calling qt_process_qlalr with a skipped/batched target name results
in an error. Do the same as for other helper functions and handle
these two cases.

Task-number: QTBUG-109786
Change-Id: I774b148989a25d01bdf724e69a722aae132389ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-13 16:49:37 +01:00
Mikolaj Boc
5947c07717 Do not batch standalone tests; add an option to batch them
Tests generated with qt-cmake-standalone-test will now not be
batched by default. Defining the QT_BATCH_STANDALONE_TESTS
environment variable will make the build system batch them.

Fixes: QTBUG-111226
Change-Id: I9f01c662e22f8ffdd33e1c4d82619db0689fecc7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-13 16:12:28 +01:00
Mikolaj Boc
d87ba73d48 Avoid error with test helper when test batch is missing
qt_internal_add_test_helper will fail if a test batch is missing and
batching is enabled. It will now copy to the parent binary directory
as without batching for simplicity, as this happens when batched tests
are skipped.

One consequence could be that when the first test specified has
the NO_BATCH argument, this will incorrectly install the helper, but
helpers still need extra work to function properly, so for now we just
make it compile.

Task-number: QTBUG-109786
Change-Id: Ib307ae79799422c2a4102885aa007ef043835e50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-13 16:12:28 +01:00
Alexey Edelev
5e4f4816a8 Make sure that all dependencies are found before creating tool targets
The result of dependency lookup is not taken into account when
evaluating tool packages. Check for <ToolPackage>_FOUND before creating
the tool targets that belong to the tool package. Adjust the tool package
lookup that the dependencies always affect the lookup result even if
we avoided creating targets by setting QT_NO_CREATE_TARGETS.

Pick-to: 6.5 6.5.0
Change-Id: Ia95c9c71370becc639ed8a9db026aed2f93959b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-13 16:12:28 +01:00
Christian Ehrlicher
813b4cc2ea SQL/IBASE: also search in firebird subdir
Firebird has it's include files in <include>/firebird so we should also
search there.

Pick-to: 6.5 6.2
Change-Id: Ief57abbfd6973ab9077abc1a1a2791a62ce4102a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-12 11:36:53 +00:00
Lisandro Damián Nicanor Pérez Meyer
3f45905953 Prefer the shared version of libzstd over the static one
This is related to QTBUG-110978, but not a complete fix.

Task-number: QTBUG-110978
Change-Id: I91b757addde8213ba3d356a590f6e4cf68187c31
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-08 18:16:29 -03:00
Mikolaj Boc
c6183cfc7b Make manual tests use the usual wasm_shell.html
Manual tests are supposed to display UI and be assessed manually, but
currently they use the auto test runner by mistake.
Use the normal wasm shell to fix this and make them work like usual
applications.

Fixes: QTBUG-111753
Change-Id: I9d3c0ad56e913b73737c5b72087e82980989d8b8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-07 11:46:36 +01:00
Kuntal Majumder
05a7cbef5b Allow building with llvm-clang in macOS
Supressing the linking warnings on macOS are relevant when we are
using AppleClang and not upstream Clang.

The provided arguments do not apply to llvm-ar and llvm-ranlib.

Change-Id: I8b664c01802b47077eb0ab80dab7681ee0bfcaa9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-06 21:54:43 +01:00
Alexandru Croitor
a804ac3d88 CMake: Relax example dependencies to be per-repo
When doing a top-level build with ExternalProject examples, it doesn't
make sense to make qtbase examples depend on e.g. qtdeclarative
plugins. Instead the qtbase example should only depend on plugins
built in qtbase.

Create per-repo custom targets that depend on all plugins built within
that particular repo.

Create an additional per-repo target which depends on all
plugins built in that repo, as well as plugins from dependent repos.
Use the latter as a dependency for examples built as part of the
current repo.

Repo dependencies are parsed from dependencies.yaml.

Pick-to: 6.5
Fixes: QTBUG-110913
Change-Id: I149860cc549caf53271c9ea296eb7bac2a663715
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-06 18:54:00 +01:00
Morten Sørvig
ba724a2ded wasm: set stack size to 5MB again
Recent Emscripten 3.1.27 reduces the stack size to 64KB,
which is way to small for Qt-based applications.

Restore the previous stack size (5 MB) by setting STACK_SIZE.

Change-Id: I6c25e31b32dc1d551fa423655fcef4891830bcd1
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-03-06 14:06:07 +00:00
Amir Masoud Abdol
b6bc4199ec Align qt_internal_add_manual_test with qt_internal_add_test
They now share their implementation. Manual tests can be created by
passing the MANUAL arguments to the qt_internal_add_test as well.

Pick-to: 6.5
Fixes: QTBUG-111382
Change-Id: I1c207b7e4a67526554df1ee43fe032bb20fc92fa
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-28 17:53:10 +01:00
Mikolaj Boc
6c12ea1d45 Skip non-qtbase tests on Coin
The previous attempt failed as target coin configuration doesn't
use superbuild. Skip the tests based on the TESTED_MODULE_COIN
environment variable

Task-number: QTBUG-109786
Change-Id: I0dbe6ff64ca4a2e81fef377865ef4e99b58c5eb2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-24 10:10:14 +00:00
Amir Masoud Abdol
a1782c1492 Fix a typo
Pick-to: 6.5
Change-Id: I13c344113c2e924dbe43995affe9b1aa3647f2aa
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-23 16:28:37 +01:00
Joerg Bornemann
4183768d9b CMake: Fix position independent code linker flags not being set
We set CMAKE_POSITION_INDEPENDENT_CODE to ON and require CMake 3.16.
This sets CMP0083 to NEW and should pass -fPIE to linker calls as well.

However, the PIE-enabling flag is not passed to the linker unless we
call check_pie_supported(). This behavior is documented in CMake's
CMP0083 documentation page.

[ChangeLog][CMake] Qt tools are now built with position independent code
even with Unix toolchains where this is not the default, for example
clang.

Pick-to: 6.5 6.4 6.2
Change-Id: I1d98e0ea7063a76e3fddc94d6555c6eaf14c7885
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-23 08:50:39 +01:00
Alexey Edelev
d51d7d4d5c Add support for evaluating genexes when exporting custom target props
Properties specified in EXPORT_PROPERTIES have their values exported
verbatim, without evaluating generator expression they might contain.
This limitation is removed by the introduced functions. They collect
properties that needs to be exported and evaluate generator
expressions inside the properties using file(GENERATE) before
exporting them. The functions generate the ExtraProperties.cmake
file that contains set_property calls with exported properties
and corresponding values.

Change-Id: If32c30a82a62e8bd48bb91f3df21ff2ad8d07243
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-21 22:42:01 +01:00
Alexey Edelev
0a27f4030e Revert "Avoid mapping BUILD_TESTING to QT_BUILD_TESTS"
This reverts commit e3ecabad22.

Reason for revert: This breaks the CTest internal switches. So it's better to disable testing directly in submodule.

Change-Id: Ia93dc3bb0a3a34021c8e2d6c3d292e3a4909bef5
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-21 21:41:41 +00:00
Alexey Edelev
d1d80d7be5 Add the QT_INTERNAL_CONFIGURE_FROM_IDE option
This switch should help switch off some time consuming operations
that make sense only whe configuring Qt project from IDE.

The switch is INTERNAL and depends on environment variables defined
by IDE application when running cmake:
- Qt Creator, detected by QTC_RUN environment variable
- CLion, detected by CLION_IDE environment variable
- Visual Studio Code, detected by VSCODE_CLI environment variable

Pick-to: 6.5
Change-Id: I44086376109a8af8ebb7ecd8bf64dc34f0631527
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-21 22:41:08 +01:00
Amir Masoud Abdol
6d0c774c51 Set 32 as the default batch size for unity build
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I4497d1abc85578649f03fc8ae4916f56e4f1f351
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-02-21 13:04:44 +01:00
Fredrik Ålund
0efd8854c4 A QtSql driver for Mimer SQL
The QtSql for Mimer SQL sqldriver makes it possible to work with the
Mimer SQL database on different plattforms. There are drivers for
several other databases in QtSql and a driver for Mimer SQL will
benefit many users.
To build the Mimer SQL driver, download Mimer SQL from
https://developer.mimer.com

[ChangeLog][QtSql]
Added a QtSql plugin to work with the Mimer SQL database

Fixes: QTBUG-111219
Change-Id: Id6ba5de4de01189d0516ffbfa89efcb0d013115f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-20 14:18:18 +00:00
Alexey Edelev
8d99866f17 Revert "Add the NO_CMAKE_PACKAGE_REGISTRY option forwarding to qt_find_package"
This reverts commit 545400addd.

Reason for revert: Adding NO_CMAKE_PACKAGE_REGISTRY doesn't resolve the initial issue. So reverting this change as redundant.

Change-Id: I284600d6f0e0f2408a7a8b31827251dad4c73eba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-17 16:59:59 +00:00
Joerg Bornemann
2af494c930 Revert "CMake: Fix configure -no-rpath"
This reverts commit 854986836a.
This reverts commit 392d9a5419.

Turns out that enabling this option is now breaking the Qt build,
because tools that are called by the Qt build cannot run anymore due to
the lack of rpaths.

Before, QT_DISABLE_RPATH was simply turning off Qt's additional rpaths
but left CMake's rpath defaults intact.

To implement a working -no-rpath switch we must add Linux and macOS code
paths to _qt_internal_generate_tool_command_wrapper and set
LD_LIBRARY_PATH/DYLD_LIBRARY_PATH and friends.

Pick-to: 6.5
Fixes: QTBUG-110816
Change-Id: I021d5e6cd775cbe5b2411d6771ab2545cb04f799
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-15 16:24:03 +01:00
Alexey Edelev
545400addd Add the NO_CMAKE_PACKAGE_REGISTRY option forwarding to qt_find_package
Allow forwarding the NO_CMAKE_PACKAGE_REGISTRY option to the
find_package call from qt_find_package.

When we look for host tool packages the package dependencies are
recorded in the cmake package registry. This leads to the situation
when the lookup retry will use the package that is already found in
host path instead of looking the right one in target paths.
Adding the 'NO_CMAKE_PACKAGE_REGISTRY' to the qt_find_package calls
suppresses records in cmake package registry and starts a clean search
using target paths.

Task-number: QTBUG-111140
Pick-to: 6.5
Change-Id: I97ce1755b2f8e3413f1b0276fe26568b2f5efe33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-15 15:12:12 +01:00
Alexey Edelev
e3ecabad22 Avoid mapping BUILD_TESTING to QT_BUILD_TESTS
This leads to unwanted side issues such as building and running third
party component tests. The option should be enabled explicitly by
user instead.

Fixes: QTBUG-111091
Change-Id: I8942db2bd089ad2a39a70627bfce8314b101ecb8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-02-10 23:36:51 +01:00
Amir Masoud Abdol
bb42e8e2c6 Remove "Configuration summary shown below" statement when it is not true
Cleanup the generated message regarding the configuration summary. Also
moved the flushing into the helper function.

Pick-to: 6.5
Change-Id: I45728ac5b43613f002b6d5b07b9ad037416c4fff
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-10 23:31:37 +01:00
Amir Masoud Abdol
75ca710370 Improve FindWrapRt, and SHM detection
Apparently, more and more librt functionality are being moved to glibc
these days, e.g., clock_gettime, clock_getres, clock_settime,
clock_getcpuclockid, clock_nanosleep. As Thiago mentioned, in face,
all librt functions are moving into glibc, but unlike the clock_*
functions that I can see are ported from 2.17+, I cannot find out when
and what functions are already ported. So, here, I added a second test
which tries to explicitly look for shm_* functions, if they are there,
as well as the clock_* function, then we are more confident that we
actually have a useful the libRt in the system.

Also, making the FEATURE_posix_SHM depends on UNIX.

Pick-to: 6.5
Fixes: QTBUG-111049
Change-Id: I08b7f4656ecd9313b552fb05ca7096f5b987b95a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-10 22:44:11 +01:00
Antti Määttä
59aa9e86c6 Tracepointgen: Parse metadata from include files
The tracepointgen tool needs to know the enumeration/flag names
and values in order to generate metadata for the tracepoints
in order to pass this information when tracing.

Currently the metadata needs to be provided to the tracepointgen by
hand. This implements metadata parsing from header files.

Task-number: QTBUG-110598
Pick-to: 6.5
Change-Id: Ibb2cc6e724fd2defca4e301af2285b0fdbe8e7f7
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-02-10 12:39:47 +02:00
Joerg Bornemann
6c28528e40 CMake: Fix directory scoping issue for qt6_generate_deploy_script
Consider a Qt target created in a subdirectory and a call to
qt6_generate_deploy_app_script(target) in the parent directory.

Once qt6_generate_deploy_script (called by
qt6_generate_deploy_app_script) is run, the target has already been
finalized. However, qt6_generate_deploy_script needs to run before
finalization, because:
- qt6_generate_deploy_script marks the target as to be deployed
- the finalizer generates plugins information only if the target was
  marked to be deployed

Fix this in qt6_generate_deploy_script by checking whether the target
was already finalized. In that case, generate the plugin deployment
information right away.

Pick-to: 6.5
Fixes: QTBUG-109741
Change-Id: Idf60f9e21f038c1a33843177d9299230857ee70b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-09 11:27:29 +01:00
Amir Masoud Abdol
ed26352a10 Add -unity-build, and -unity-build-batch-size to configure
If -unity-build-batch-size is not given, we default to CMake's default
which is 8. In QtSetup.cmake, we explicitly set the default to avoid
having it set to OFF in case it is missing, just to make sure that we
don't get any unintended behavior.

Task-number: QTBUG-109394
Change-Id: I19849e9baa507b64fb23847c740e20a7adc61b8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-09 04:23:06 +01:00
Amir Masoud Abdol
31518f1a4e Add some utilities for UNITY_BUILD
- The following commands accepts NO_UNITY_BUILD, and
  NO_UNITY_BUILD_SOURCES arguments to opt out of the unity build, and
  to exclude some source files from unity build, respectively.
  - qt_internal_add_executable
  - qt_internal_add_module
  - qt_internal_add_plugin
  - qt_internal_add_tool
  - qt_internal_extend_target
  - qt_internal_add_common_qt_library_helper
  - qt_internal_add_cmake_library
  - qt_internal_add_simd_part
- Unity build is disabled by default in these:
  - qt_internal_add_test
  - qt_internal_add_test_helper
  - qt_internal_add_benchmark
  - qt_internal_add_3rdparty_library
- qt_update_ignore_pch_source also excludes the files from unity_build

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I5d0e7df633738310a015142a6c73fbb78b6c3467
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-08 23:47:07 +01:00
Alexey Edelev
214c3a033a Add simple project generation based on existing source files
Introduce the qt-cmake-create script. The script generates the simple
CMakeLists.txt based on the source files located in the current or
specified directory. The initial version can generate a CMake code for
the following file types:
  - .c .cc .cpp .cxx .h .hh .hxx .hpp - generates the qt_add_executable
    call with prerequisites.
  - .qml .js .mjs - generates the qt_add_qml_module call with
    prerequisites.
  - .ui - adds the found ui files to the existing executable. Requires
    C++ files be present in the directory too.
  - .qrc - generates the qt_add_resources call and adds the resources
    to the existing executable. Requires C++ files be present in the
    directory too.
  - .proto - generates qt_add_protobuf call with prerequisites.

The QtInitProject.cmake script contains the 'handle_type' function that
allows extending the script capabilities and establish simple relation
chains between the file types.

Note: The initial implementation doesn't deal with sub-directories, so
all files from sub-directories will be added to and handled in the
top-level CMakeLists.txt file. This can be extended by user request.

Task-number: QTBUG-104388
Change-Id: I5abd9e07da109e867ff95986572ed2bf02ef9d3d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-08 12:59:19 +01:00
Alexandru Croitor
4a4c329687 CMake: Show a message when configuring examples
This somewhat indicates the progress of configuring a specific
repo and the slower period of time when configuring examples
in-tree.

Pick-to: 6.5
Change-Id: I643536c4ebc865933730b7af2a1d0c56bbbf2912
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-07 18:27:11 +01:00
Alexey Edelev
871f7a05db Revert "Revert "Add support for MultiABI with custom install dir of the android-build""
This reverts commit d7e8d5bb1b.

Reason for revert: Found a working solution for the issue.

Change-Id: Ia720cc63ece9dfb1a24067cdd9c3d79d4edbe3be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-02-02 19:03:36 +01:00
Alexandru Croitor
d7e8d5bb1b Revert "Add support for MultiABI with custom install dir of the android-build"
This reverts commit 979a21dc4e.

Reason for revert: Caused QTBUG-110836

Task-number: QTBUG-110836
Change-Id: I4f31018954e6bb0f4e7b6db0df76d04c0a56d9b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-01 16:18:55 +00:00
Amir Masoud Abdol
95ba368806 Update qt_policy and add documentation
- If no version specified, policy version is set to 6.0.0, therefore
  warnings will be shown, encouraging users to set a policy.
- Update qt_policy() documentation
- Update qt_standard_project_setup() documentation
- Update the policy warning message
- Added the missing comment to clarify the extra_code region

Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I8358fdeb880a34c96f13fc2a6cbef6afe048c4d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-30 20:45:11 +01:00