aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-01-21 09:53:15 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-24 10:29:31 +0000
commitbc09bb17bd90c6bcf2468cfd549c720d5cbc9ab7 (patch)
tree00e7f57d842f81cdd70497add2bd1c650d4bdaa2 /cmake
parent4b387a2df10f2ee0b1cd3247c49d6e7b723dd9ae (diff)
Fall back to a cmake generated compile hash when git failed
Even if we have git, the source tree might not be a git repository, or git might fail for various reasons. So always fall back to the cmake- generated QML compile hash when it's empty after trying the .tag file and git. Amends a1bba5cd3d5f8a88cd79e6f56149ab88d1abe8b8. Change-Id: Ie9f5642bbfc0cead40138d1f92fe3d673f6dc372 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 839dc73831eb8c4a65702c66b8c42015644cc4a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtDeclarativeSetup.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/QtDeclarativeSetup.cmake b/cmake/QtDeclarativeSetup.cmake
index 98ea95dd58..e3125d528a 100644
--- a/cmake/QtDeclarativeSetup.cmake
+++ b/cmake/QtDeclarativeSetup.cmake
@@ -16,7 +16,9 @@ function(qt_declarative_write_tag_header target_name)
OUTPUT_VARIABLE QML_COMPILE_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
- else()
+ endif()
+ string(LENGTH "${QML_COMPILE_HASH}" QML_COMPILE_HASH_LENGTH)
+ if(QML_COMPILE_HASH_LENGTH EQUAL 0)
set(sources_hash "")
file(GLOB_RECURSE qtqml_source_files "${CMAKE_CURRENT_SOURCE_DIR}/*")
foreach(file IN LISTS qtqml_source_files)