Skip to content

Commit 9c3d366

Browse files
committed
[Build] Don't create a separate target for the object file directory.
When building Swift sources, don't make a separate target for the object file directory, because it may end up with the same name as would be generated by another invocation of `handle_swift_sources`. Instead, add the command to make the directory to the custom target that actually does the build, which should have a unique name. rdar://115278959
1 parent eea804b commit 9c3d366

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -903,11 +903,6 @@ function(_compile_swift_files
903903

904904
# First generate the obj dirs
905905
list(REMOVE_DUPLICATES dirs_to_create)
906-
add_custom_command_target(
907-
create_dirs_dependency_target
908-
COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
909-
OUTPUT ${dirs_to_create}
910-
COMMENT "Generating dirs for ${first_output}")
911906

912907
# Then we can compile both the object files and the swiftmodule files
913908
# in parallel in this target for the object file, and ...
@@ -937,6 +932,7 @@ function(_compile_swift_files
937932

938933
add_custom_command_target(
939934
dependency_target
935+
COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
940936
COMMAND
941937
${set_environment_args}
942938
"$<TARGET_FILE:Python3::Interpreter>" "${line_directive_tool}" "@${file_path}" --

0 commit comments

Comments
 (0)