From bc09bb17bd90c6bcf2468cfd549c720d5cbc9ab7 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 21 Jan 2022 09:53:15 +0100 Subject: 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 Reviewed-by: Ulf Hermann (cherry picked from commit 839dc73831eb8c4a65702c66b8c42015644cc4a5) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtDeclarativeSetup.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmake') 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) -- cgit v1.2.3