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 103eca1070
Pick-to: 6.7 6.5
Fixes: QTBUG-126056
Change-Id: I5664cf074158199e0c7fd5e312ecf739133d7f2e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c561bcceed0300a14e2062958afce62776be4b6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
bb10
parent
3964d03f31
commit
92ffa3a7a5
|
|
@ -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…
Reference in New Issue