diff options
author | Orkun Tokdemir <orkun.tokdemir@qt.io> | 2023-09-13 18:02:48 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-09-30 13:55:04 +0000 |
commit | 33f5e985e480283bb0ca9dea5f82643e825ba87c (patch) | |
tree | 892b31907e67a5b16d1673877f7a1748e3689283 | |
parent | ce09de5809fc22ca7e0c8114fbde3577cac668de (diff) |
Since https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8564 is
merged, the timestamp file for {target}_json_file.txt should be updated
for `Cross-Config` builds.
The actual error message before this commit when CMake 3.28 is used:
```
ninja: error: 'src/corelib/Core_autogen/timestamp', needed by 'src/corelib/meta_types/Core_json_file_list.txt', missing and no known rule to make it
```
Change-Id: Ib544b18b67d2d4722f3801b1f46a0e0e18e59d48
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8041bfba47305352627d910930e52da496904c17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5c9e77298583d9955c139765783e403314799f42)
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 5bc313a276..349bb4b419 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1061,9 +1061,23 @@ function(qt6_extract_metatypes target) add_dependencies(${target}_automoc_json_extraction ${target}_autogen) _qt_internal_assign_to_internal_targets_folder(${target}_automoc_json_extraction) else() - set(cmake_autogen_timestamp_file - "${target_autogen_build_dir}/timestamp" - ) + set(use_better_automoc_graph FALSE) + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.28.0" + AND CMAKE_CROSS_CONFIGS) + if(DEFINED QT_USE_BETTER_AUTOMOC_GRAPH) + set(use_better_automoc_graph ${QT_USE_BETTER_AUTOMOC_GRAPH}) + else() + set(use_better_automoc_graph TRUE) + endif() + endif() + + if(use_better_automoc_graph) + set(cmake_autogen_timestamp_file + "${target_autogen_build_dir}/timestamp_$<CONFIG>") + else() + set(cmake_autogen_timestamp_file + "${target_autogen_build_dir}/timestamp") + endif() add_custom_command(OUTPUT ${type_list_file} DEPENDS ${QT_CMAKE_EXPORT_NAMESPACE}::cmake_automoc_parser |