Skip to content

Commit 064cb34

Browse files
committed
[CMake] Use add_custom_command_target for copying std.apinotes
`COMMAND` for `add_custom_target` are "always considered out of date" and executed everytime. Because of that, targets depends on that were alway marked "dirty". Use `add_custom_command_target` instead.
1 parent 79cdadf commit 064cb34

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stdlib/public/Cxx/std/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# API Notes for the C++ Standard Library
33
#
44
set(output_dir "${SWIFTLIB_DIR}/apinotes")
5-
add_custom_target(CxxStdlib-apinotes
5+
add_custom_command_target(unused_var
6+
CUSTOM_TARGET_NAME CxxStdlib-apinotes
67
COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${output_dir}"
78
COMMAND ${CMAKE_COMMAND} "-E" "copy_if_different" "${CMAKE_CURRENT_SOURCE_DIR}/std.apinotes" "${output_dir}"
8-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/std.apinotes
9-
COMMENT "Copying CxxStdlib API Notes to ${output_dir}")
9+
COMMENT "Copying CxxStdlib API Notes to ${output_dir}"
10+
OUTPUT "${output_dir}/std.apinotes"
11+
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/std.apinotes")
1012

1113
swift_install_in_component(FILES std.apinotes
1214
DESTINATION "lib/swift/apinotes"

0 commit comments

Comments
 (0)