CMake: Fix framework headers not being copied after rm-ing build dir
If a build dir is removed using rm -r *, this still leaves dot files around, specifically the .ninja_log file. Because of a possibly unspecified behavior of listing directories as OUTPUTs in a add_custom_command call for the ${target}_copy_fw_sync_headers custom target, we end up with a situation where the custom command is not rerun by ninja because the directory OUTPUT was encountered in the .ninja_log file. Make sure to specify an additional file as an OUTPUT, to ensure the command does rerun, and thus copies all headers from the syncqt staging directory. Amends 103eca1070a75bfa97d0b72b94e0c759ef0bcd1c Pick-to: 6.5 6.7 6.8 Fixes: QTBUG-126056 Change-Id: I5664cf074158199e0c7fd5e312ecf739133d7f2e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
507f75d19e
commit
c561bcceed
@ -117,18 +117,31 @@ function(qt_copy_framework_headers target)
|
||||
"${output_dir}/${fw_versioned_header_dir}"
|
||||
)
|
||||
|
||||
set(copy_fw_sync_headers_marker_file
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${target}_fw_sync_headers_marker_file"
|
||||
)
|
||||
|
||||
set(copy_fw_sync_headers_marker_file_command
|
||||
"${CMAKE_COMMAND}" -E touch "${copy_fw_sync_headers_marker_file}"
|
||||
)
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "^Ninja")
|
||||
add_custom_command(
|
||||
OUTPUT "${output_dir}/${fw_versioned_header_dir}"
|
||||
OUTPUT
|
||||
"${output_dir}/${fw_versioned_header_dir}"
|
||||
"${copy_fw_sync_headers_marker_file}"
|
||||
DEPENDS ${target}_sync_headers
|
||||
COMMAND ${copy_fw_sync_headers_command}
|
||||
COMMAND ${copy_fw_sync_headers_marker_file_command}
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(${target}_copy_fw_sync_headers
|
||||
DEPENDS "${output_dir}/${fw_versioned_header_dir}")
|
||||
else()
|
||||
add_custom_target(${target}_copy_fw_sync_headers
|
||||
COMMAND ${copy_fw_sync_headers_command})
|
||||
COMMAND ${copy_fw_sync_headers_command}
|
||||
COMMAND ${copy_fw_sync_headers_marker_file_command}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(out_files)
|
||||
|
Loading…
x
Reference in New Issue
Block a user