Commit Graph

2019 Commits

Author SHA1 Message Date
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
Timur Pocheptsov
f932be58d5 qnetworkproxy_mac: use API available both on iOS and macOS
To extract system proxies, the one we used previously, was not available
on iOS and thus we could not obtain system proxies there. Support is
limited - no such things, as SOCKS/FTP/etc. proxies, only PAC (auto
configuration), and HTTP/HTTPS. There are no keys to extract info
about HTTPS, so instead we'll use CFNetworkCopyProxiesForURL (
looks like this enables exclusion lists (which are hidden)
functionality and apparently from the system point of view HTTP/HTTPS
are the same.

Fixes: QTBUG-39869
Change-Id: I73af719a2e2b5cded706e6b3faa4b8eaa879352b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-30 20:10:25 +01:00
Fab Stz
979a21dc4e Add support for MultiABI with custom install dir of the android-build
Right now, "multi abi builds" of android projects works only if the
android-build installation doesn't use custom install dirs
(INSTALL_PREFIX, INSTALL_BINDIR...)

At the same time, it fixes QTBUG-106533. The patches are the same as the
ones in that bugreport.

Add new items to android-*-deployment-settings.json:

    qtDataDirectory
    qtLibsDirectory
    qtLibExecsDirectory
    qtPluginsDirectory
    qtQmlDirectory

Update androiddeployqt to be able to get files from their install location

BTW (fixes QTBUG-106533):
    Install src/android/templates into INSTALL_DATADIR
    Install src/3rdparty/gradle into INSTALL_DATADIR
    Install src/android/java files into INSTALL_DATADIR
    Install all jars into INSTALL_DATADIR

Add missing path to target_qt.conf
    Update target_qt.conf to have all path. Otherwise qmake wouldn't have
    the path when installing the android-build with custom install dirs
    like INSTALL_LIBDIR & friends

Add support for a new cmake variable that can be set at build time of the
android projects: QT_ANDROID_PATH_CMAKE_DIR_${abi} (Name chosen as
brother of QT_HOST_PATH_CMAKE_DIR)

Pick-to: 6.5
Fixes: QTBUG-106533
Fixes: QTBUG-107207
Change-Id: Ia3751362ab1b5f877ecafbe02f263feac167119c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-30 14:08:14 +01:00
Fabian Kosmale
6854d35393 headersclean: Check fno-operator-names
KDE Frameworks tests this in one build configuration. Verify that we
do not break it in public Qt headers.

Task-number: QTBUG-110585
Change-Id: I5c976d00d7b1aba026e99acb9bad176103e23b0b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-26 14:19:33 +00:00
Joerg Bornemann
854986836a Fix configure -no-rpath for CMake < 3.18
We must not set rpath-related properties on INTERFACE libraries. Move
the code that sets the properties below the bail out for INTERFACE
libraries.

This amends commit 392d9a5419.

Pick-to: 6.5
Fixes: QTBUG-110513
Change-Id: Ie395f1482245c4522917f982d2f3bc745c0b2abc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-24 18:54:58 +01:00
Amir Masoud Abdol
897579edab Remove the extra quote, now that we use cmake_parse_arguments(PARSE_ARGV
The extra quote enforces the arguments to be string, and stops the
COMMAND_EXPAND_LISTS within
QtDbusHelpers.cmake::qt_create_qdbusxml2cpp_command from expanding it
as a list.

Fixes: QTBUG-110459
Fixes: QTBUG-110450
Task-number: QTBUG-99238
Change-Id: Ifddd6570c7bf8f2d1757f275d9445ce2924a93f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-23 20:21:10 +01:00
Assam Boudjelthia
63f9da73b5 Android: bump minimum sdk build version QT_ANDROID_API_VERSION to 33
To allow using Android 13 APIs.

Pick-to: 6.5
Change-Id: Ic805f1e0500ce9dee25ba28fb4ef65c7afacad65
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-23 15:39:16 +00:00
Mikolaj Boc
11891ae9c9 Skip tests outside of qtbase on batching+superbuild
The batcher does not currently work properly with non-qtbase
submodules. Disable them temporarily so that at least the
tests in qtbase are batched. Do this from qtbase so that changes
to each and every submodule are not necessary.

Also, maintain a list of tests that were thus skipped. On any
qt cmake internal function call that refers to such a target,
identify the target as skipped and make the call a no-op.

Fixes: QTBUG-109785
Change-Id: Ib0aa5d39eee8315ffd4ac62f6d1f44fe9bbf7a2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-23 15:23:10 +01:00
Alexandru Croitor
4e70ab5eeb CMake: Work around AUTOUIC Ninja Multi-Config issue with EP examples
AUTOUIC doesn't handle relative paths to .ui files in parent
directories when using Ninja Multi-Config.

The designer tool in qttools has such a ui file. This leads to the
following error when trying to build qttools together with examples as
ExternalProjects and Ninja Multi-Config:

  ninja: error: 'src/designer/src/designer/designer_autogen/
    include_Debug/ui_preferencesdialog.h', needed by
    'src/designer/src/designer/designer_autogen:Debug',
    missing and no known rule to make it

Until cmake is fixed, we can work around the issue by not adding
designer as a dependency when building EP examples, because no example
tries to use the app.

We can't exclude all apps from example dependencies because some
modules use qt_internal_add_app for tools as well, which are called
from public CMake API and also examples.
An example of this is qtapplicationmanager.

Given that we can't exclude all apps, introduce a function to
allow skipping single targets when building EP examples.

This will allow excluding designer specifically.

The examples will now depend on a new ${repo}_src_for_examples target
rather than ${repo}_src, which will exclude skipped targets.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-110369
Change-Id: I2f900253bbf7bac917f2293ef604ab3ea8f298e1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-01-20 18:21:46 +01:00
Amir Masoud Abdol
5c40cb0f1a Fix a bug in -redo where -redo was not considering new options
In addition to the fix, I've removed some legacy codes in the
`configure` file and delegated most of the work to
the `QtWriteArgsFile.cmake` which was being used by `configure.bat`. I
am not sure how this was supposed to work before since it was not really
working, but now, `config.opt` lives in the build directory, together
with `config.opt.in` (a template file), and the `config.redo` (and
`config.redo.in`) which holds the full redo command. The template files
are being used to preserve the quoted variables and to help
QtWriteArgFiles process the opt files more consistency.

Also fixed an issue on Unix, where ./configure was failing to run if
its path contained spaces, e.g., `Qt Src/qt5/configure`.

Fixes: QTBUG-108287
Change-Id: I9843b690a1fd3177a93e55e08a3484a4c85ba2e8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-19 13:19:20 +01:00
Thiago Macieira
caecb17248 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.

Pick-to: 6.4
Change-Id: I810d70e579eb4e2c8e45fffd1719c0abf608ed30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-18 09:21:20 -07:00
Amir Masoud Abdol
b171abe695 Remove GENERATE_METATYPES
It doesn't seem like that it is being used anymore, except an instance
in pro2cmake which I replaced by NO_GENERATE_METATYPES.

Pick-to: 6.5
Change-Id: I135cf47e6041e98b354fb684f0079dad30689dea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-18 14:47:12 +01:00
Amir Masoud Abdol
7e82577680 Retire the qt_parse_all_arguments
This replaces the qt_parse_all_arguments macro with the built-in
`cmake_parse_arguments(PARSE_ARGV`. In addition, a new function,
_qt_internal_validate_all_args_are_parsed, can be used to check whether
any _UNPARSED_ARGUMENTS have been passed to the function.

Fixes: QTBUG-99238
Change-Id: I8cee83dc92dc6acdaaf747ea6ff9084c11dc649b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-18 14:47:12 +01:00
Amir Masoud Abdol
b711690059 Replace $<CONFIGURATION> with $<CONFIG>
$<CONFIGURATION> is deprecated from CMake 3.0

Pick-to: 6.5
Change-Id: I1b19507a8cb3325095440e0a22fc54f9fde77e9b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-18 12:20:32 +01:00
Joerg Bornemann
a707ae094d Fix macOS build for CMake < 3.18
We must explicitly set the GENERATED property on source files we
generate.

This amends commit f0a7d74e1d.

Change-Id: Ifab405cd98deece49a1566ae04220e2b5d576429
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-17 21:28:06 +01:00
Joerg Bornemann
392d9a5419 CMake: Fix configure -no-rpath
The -no-rpath configure switch had no effect.

Pick-to: 6.5
Change-Id: I306ec33249a219066ce94d18da5f1ca3d92905e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-17 21:28:06 +01:00
Amir Masoud Abdol
20821877bb Remove an obsolete TODO item
__GlobalConfig_install_dir translates to lib/cmake/Qt6/ and 3rdparty
modules will be in lib/cmake/Qt6/3rdparty which seems to be a logical
place for them.

Pick-to: 6.5
Change-Id: I90c715b9502b0dfc666bb3202a838f20ba6110cf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-17 21:28:06 +01:00
Amir Masoud Abdol
9c90cd7fb9 Add the ltcg flag to .pri files
QT_FEATURE_ltcg is TRUE if either of
CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON or
CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>=ON are passed to the
configure, or the cmake command.

Pick-to: 6.5
Change-Id: Ibaece67de6cc6f89e505038fd02fb50008c47d48
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-17 21:28:06 +01:00
Amir Masoud Abdol
1b4aba0a59 Remove an obsolete TODO
There was a plan to invert the API, but since the TODO, we are settled
on the non-inverted name, ie., GENERATE_CPP_EXPORTS.

Pick-to: 6.5
Change-Id: I84f531d870965e0b7d0d821d1ff08606ab8054ab
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-17 16:15:11 +01:00
Tor Arne Vestbø
c8839448cc CMake: Tweak qt_internal_get_framework_info to match documentation
<out_var>_private_header_dir and <out_var>_private_module_header_dir are
documented to point to "the specific framework version and framework
bundle version".

Pick-to: 6.5
Change-Id: I00053f106ec9be88f7892c842ca75549cfc54124
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-17 16:15:11 +01:00
Mikolaj Boc
6a9e89121d Concatenate blacklist files for test batch
This works by collecting the paths of all blacklist files
and deferring a call which ultimately reads all of the files and
glues them together to form a master blacklist file for the batch.

There might be conflicting function names inside the batch. For now
we ignore the problem, while keeping in mind that it exists.

Fixes: QTBUG-110016
Change-Id: I9c8412097418c6e93297ab89af718d7466e2e451
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-17 13:45:39 +00:00
Amir Masoud Abdol
d4121dd876 Remove an unnecessary call to _qt_internal_generate_tool_command_wrapper
Alexandru mentioned that at the time qtdeclarative was still using the
variable, but from then, he replaced those as well, and I couldn't find
any usage anymore either.

Change-Id: I6a1893c2dfaa483dc8cb865f7bacf08cadca985b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-16 19:18:28 +01:00
Mikolaj Boc
cb20cbd3c8 Make qt cmake functions react properly to batch dummy targets
Stub targets introduced in 65b7aacb make the old batch target detecting
measure in qt_internal_extend_target,
qt_internal_undefine_global_definition, qt_internal_add_resource
obsolete, since now the targets actually exist in the build system.
Unconditionally fail if the target does not exist and if it does, query
for its inclusion in the batch

Change-Id: I1cd1d8cc7fbf4bdbd2289a1b38ecbea1e93a06c8
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-16 13:46:57 +01:00
Alexey Edelev
2bf54da75a Use the existing imported location for syncqt in developer builds
In developer builds we don't install tools, so syncqt executable is
located in its RUNTIME_OUTPUT_DIRECTORY but not by install path. This
works fine in general case, but in multi-config builds the
RUNTIME_OUTPUT_DIRECTORY path doesn't match the install path. So syncqt
target points to wrong location in this case. It makes sense to use the
existing IMPORTED_LOCATION of syncqt executable directly if Qt is not
supposed to be installed. Also check if the syncqt executable exists at
the expected location before creating the imported target.

Pick-to: 6.5
Fixes: QTBUG-109864
Change-Id: I0de647b2a73169a0d48bd88edeb7ff00975fa774
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-13 15:08:26 +01:00
Alexey Edelev
4e4cd7416a Add the 'QT_INTERNAL_AVOID_OVERRIDING_SYNCQT_CONFIG' flag
The flag avoids overriding of the default CMake build config when
building syncqt.

Add extra checks to the make sure that configure-time tools use the
correct build type.

Fixes: QTBUG-109792
Pick-to: 6.5
Change-Id: I572fed60c58e59297fa559aea6eb86af94b979b7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-13 14:38:16 +01:00
Antti Määttä
e3458aac64 Add CTF tracing backend
Implement platform independent tracing backend in Common trace format.
This allows tracing in platforms without own/existing backend and
analysing all platforms with the same tooling. The backend is the basis
for further work in application level profiling area.

The backend is implemented as a plugin that is loaded immediately when
the application starts in order to process all trace events. The backend
avoids using Qt classes so that it doesn't generate trace events
itself. Adds plumbing to configure the new backend.

Modifies the tracegen and tracepointgen tools to support the new
backend.

Task-number: QTBUG-106399
Pick-to: 6.5
Change-Id: I80711be52d4d48e1acbc72edffbdf3f379fce52a
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
2023-01-13 12:43:46 +02:00
Antti Määttä
bab65d70dc Add find package for lttng library so that it gets added to target
Add it globally so that each module using tracepoints don't have to
add it themselves to each modules configure.cmake.

Pick-to: 6.5
Change-Id: Id58cfaff5cd715b2667da2470001d646117f9f28
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-13 12:43:45 +02:00
Antti Määttä
9bdf74a4f2 Add tracepointgen tool and convert qtgui to use it
Allows automatically generating tracepoint files by scanning source
files for instrumentation macros.

This makes it easier to add tracepoint support to modules and also
ensures that the tracepoint files do not get out of sync with the
functions they are tracing.

Q_TRACE_INSTRUMENT generates entry/exit tracespoints for a function
it is set. Q_TRACE_PARAM_REPLACE is used to change a function parameter
for these functions to convert it to supported parameter type.
Q_TRACE_POINT can be used to create a standalone tracepoint.
Q_TRACE_PREFIX can be used to add prefix for generated tracing backend
for example to add includes for types used in the trace points..

Task-number: QTBUG-107238
Pick-to: 6.5
Change-Id: Ib395b80838434ceb72683dac0545ca20c4d09455
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
2023-01-13 12:43:44 +02:00
Joerg Bornemann
94e474b48e 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.

Pick-to: 6.4 6.5
Fixes: QTBUG-109547
Change-Id: I45e727713912d19e6007a7fbf3d61533f82b71d9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
2023-01-12 16:33:55 +01:00
Mikolaj Boc
1558153360 Kill the browser that CI on wasm opens for testing
Otherwise CI hangs if no existing browser can be reused (typical
case)

Fixes: QTBUG-109876
Change-Id: I63436a23c23c4b74c27c18effafde53bb6a4a34e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-01-12 04:34:34 +01:00
Amir Masoud Abdol
59d5a52c22 Clean up an outdated TODO
This doesn't seem to be relevant anymore, and the
`from_lib_location_to_prefix` seems to be set correctly.

Change-Id: I368da226ed33a303662856b0bc3ccbf6c328250a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-11 22:58:59 +00:00
Amir Masoud Abdol
dc00369c56 Replace the impl of qt_configure_file with qt_configure_file_v2
The new version uses PARSE_ARGV which deals with semicolons better.

Task-number: QTBUG-99238
Change-Id: Ie9276219400326a67ffa9cf5fc456ae7de0bbcd2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-11 22:24:47 +01:00
Amir Masoud Abdol
e6693163e5 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
Pick-to: 6.5 6.4 6.3 6.2
Change-Id: I6ae1059ddd05feeec047fbb906c7dba1586e816b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-11 13:48:48 +01:00
Joerg Bornemann
85d235877d CMake: Store whether a module is internal in module json files
Pick-to: 6.5
Change-Id: Ic7e5e3b69a41a7723643332bebbde76854966b89
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-01-11 13:02:58 +01:00
Mikolaj Boc
d8d1049ff8 Add Qt::Gui to batches unconditionally
This is needed for static plugins to work correctly as currently
the only place where plugin logic is handled for non-standalone
builds is in qt_internal_add_executable - adding the library later
when encountered in one tests that get batched does not trigger
plugin handling logic.

Fixes: QTBUG-109812
Change-Id: Idcc2bc6b42b2b7ad6afb9796f554b0529de3de5f
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-10 13:26:22 +01:00
Tor Arne Vestbø
adb91d6afb Enable shared library build of Qt for iOS
As of f68e2c92cc, and its follow up
changes, we can now link individual plugins statically, even if the
Qt build is generally a shared build.

This allows us to build Qt for iOS as shared libraries, while still
keeping the platform plugin as a static library, since this is
harder to port over to a shared library.

This gives the benefit of faster turnaround during development, as
well as binary compatibility promises for the main Qt libraries,
without having to go fully shared for all of Qt.

Static builds are still the default, due to the downsides of larger
application bundles and slower load times for shared builds.

For now the user has to manually tick the "Embed & Sign" check
box in Xcode for each Qt library, which is only available with
Xcode projects generated by the qmake Xcode generator.

Task-number: QTBUG-85974
Change-Id: Id2b7bd2823c8e7c79068dda95295b574ada8d7f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-10 13:16:04 +01:00
Joerg Bornemann
0b92502de2 CMake: Store the plugin types in the module json files
This will be read by windeployqt.

Pick-to: 6.5
Change-Id: I8dfebae755ef61967e924db3c5631af5cc4e2440
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-06 22:05:57 +01:00
Johannes Kauffmann
029e118a4e CMake: Unify usage of pkg_check_modules
According to the CMake documentation, IMPORTED_TARGET should be
specified before the moduleSpec, and after QUIET.

Additionally, double-quote the moduleSpec everywhere, since before, it
was only quoted in some cases.

While this is not required for pkg_check_modules to work, it unifies the
coding style.

Pick-to: 6.5
Change-Id: Ic8ad708a8146f9b39ee40e9a719412441e231452
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-06 17:57:17 +01:00