diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2022-08-15 18:29:41 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2022-09-27 13:12:11 +0200 |
commit | b89d63515bb352cecfd87e709320a2db5b6a1906 (patch) | |
tree | 4f6e40d6e14991af1c9082ab7508a49a6360f25a /tests | |
parent | 458ec4cb5442315c2c923ba78faf45fdd729a109 (diff) |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cmake/CMakeLists.txt | 46 | ||||
-rw-r--r-- | tests/auto/cmake/mockplugins/.cmake.conf | 2 | ||||
-rw-r--r-- | tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt | 1 |
4 files changed, 32 insertions, 18 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 5153350eb6..30cd340f16 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -145,6 +145,12 @@ if(IOS) return() endif() +set(is_qt_build_platform TRUE) +# macOS versions less than 10.15 are not supported for building Qt. +if(CMAKE_HOST_APPLE AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS "19.0.0") + set(is_qt_build_platform FALSE) +endif() + _qt_internal_test_expect_pass(test_umbrella_config) _qt_internal_test_expect_pass(test_wrap_cpp_and_resources) if (NOT NO_WIDGETS) @@ -274,21 +280,23 @@ elseif(QT6_INSTALL_BINS) endif() # Test building and installing a few dummy Qt modules and plugins. -set(mockplugins_test_args "") -if(NOT QT_FEATURE_no_prefix) - list(APPEND mockplugins_test_args - BINARY "${CMAKE_COMMAND}" - BINARY_ARGS - "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins" - -P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake" - ) -endif() -_qt_internal_test_expect_pass(mockplugins ${mockplugins_test_args}) -set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins) +if(is_qt_build_platform) + set(mockplugins_test_args "") + if(NOT QT_FEATURE_no_prefix) + list(APPEND mockplugins_test_args + BINARY "${CMAKE_COMMAND}" + BINARY_ARGS + "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins" + -P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake" + ) + endif() + _qt_internal_test_expect_pass(mockplugins ${mockplugins_test_args}) + set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins) -# Test importing the plugins built in the project above. -_qt_internal_test_expect_pass(test_import_plugins BINARY ${CMAKE_CTEST_COMMAND} BINARY_ARGS -V) -set_tests_properties(test_import_plugins PROPERTIES FIXTURES_REQUIRED build_mockplugins) + # Test importing the plugins built in the project above. + _qt_internal_test_expect_pass(test_import_plugins BINARY ${CMAKE_CTEST_COMMAND} BINARY_ARGS -V) + set_tests_properties(test_import_plugins PROPERTIES FIXTURES_REQUIRED build_mockplugins) +endif() _qt_internal_test_expect_pass(test_versionless_targets) @@ -307,11 +315,13 @@ include(test_plugin_shared_static_flavor.cmake) _qt_internal_test_expect_pass(tst_qaddpreroutine BINARY tst_qaddpreroutine) -_qt_internal_test_expect_pass(test_static_resources - BINARY "${CMAKE_CTEST_COMMAND}" - BINARY_ARGS "-V") +if(is_qt_build_platform) + _qt_internal_test_expect_pass(test_static_resources + BINARY "${CMAKE_CTEST_COMMAND}" + BINARY_ARGS "-V") -_qt_internal_test_expect_pass(test_generating_cpp_exports) + _qt_internal_test_expect_pass(test_generating_cpp_exports) +endif() _qt_internal_test_expect_pass(test_qt_extract_metatypes) diff --git a/tests/auto/cmake/mockplugins/.cmake.conf b/tests/auto/cmake/mockplugins/.cmake.conf index 377be0059e..edb49ceeb2 100644 --- a/tests/auto/cmake/mockplugins/.cmake.conf +++ b/tests/auto/cmake/mockplugins/.cmake.conf @@ -1 +1,3 @@ set(QT_REPO_MODULE_VERSION "6.5.0") + +set(QT_USE_SYNCQT_CPP TRUE) diff --git a/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt index 1d672c231f..933f6dde5d 100644 --- a/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt @@ -4,6 +4,7 @@ qt_internal_add_module(MockPlugins1 PLUGIN_TYPES mockplugin SOURCES + qmockplugin.h fake.cpp LIBRARIES Qt::CorePrivate diff --git a/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt index ead4800798..5df9c1b685 100644 --- a/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt @@ -4,6 +4,7 @@ qt_internal_add_module(MockPlugins3 PLUGIN_TYPES mockauxplugin SOURCES + qmockauxplugin.h fake.cpp LIBRARIES Qt::CorePrivate |