summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-01-26 14:53:13 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-01-27 08:24:34 +0000
commit54980200c79b466a276a4d3054390e4b3162e9ed (patch)
treebfc40df296e3fe439db538f1d0b89bef4deed42c
parent9b43d8a98aed87da9fb366cd916cd2e7747090db (diff)
Fix output files of the *_header_check targets
Header files of a Qt module are usually found in subdirectories. Avoid creating object file paths like "header_foo/bar.h.o". When building with conan, the "header_foo" subdirectory was not created for whatever reason. Now, we make sure we have clean object file paths, e.g. "header_check/foo/bar.h.o", and we create the directory upfront before invoking the compiler. Pick-to: dev Fixes: QTBUG-90529 Change-Id: Ifa5d6b97e07fc4e249c58cda5128439d60b14f5f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r--cmake/QtHeadersClean.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/QtHeadersClean.cmake b/cmake/QtHeadersClean.cmake
index 9cb11dddd1..8abb34ff9e 100644
--- a/cmake/QtHeadersClean.cmake
+++ b/cmake/QtHeadersClean.cmake
@@ -162,13 +162,15 @@ function(qt_internal_add_headers_clean_target
foreach(header ${hclean_headers})
get_filename_component(input_path "${header}" ABSOLUTE)
- set(artifact_path "header_${header}.o")
+ set(artifact_path "header_check/${header}.o")
+ get_filename_component(artifact_directory "${artifact_path}" DIRECTORY)
set(comment_header_path "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
file(RELATIVE_PATH comment_header_path "${PROJECT_SOURCE_DIR}" "${comment_header_path}")
add_custom_command(
OUTPUT "${artifact_path}"
COMMENT "headersclean: Checking header ${comment_header_path}"
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${artifact_directory}"
COMMAND
${compiler_to_run} -c ${cxx_flags}
"${target_compile_flags_joined_genex}"