Skip to content

Commit e91f914

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 b122d8a commit e91f914

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
@@ -905,11 +905,6 @@ function(_compile_swift_files
905905

906906
# First generate the obj dirs
907907
list(REMOVE_DUPLICATES dirs_to_create)
908-
add_custom_command_target(
909-
create_dirs_dependency_target
910-
COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
911-
OUTPUT ${dirs_to_create}
912-
COMMENT "Generating dirs for ${first_output}")
913908

914909
# Then we can compile both the object files and the swiftmodule files
915910
# in parallel in this target for the object file, and ...
@@ -939,6 +934,7 @@ function(_compile_swift_files
939934

940935
add_custom_command_target(
941936
dependency_target
937+
COMMAND "${CMAKE_COMMAND}" -E make_directory ${dirs_to_create}
942938
COMMAND
943939
${set_environment_args}
944940
"$<TARGET_FILE:Python3::Interpreter>" "${line_directive_tool}" "@${file_path}" --

0 commit comments

Comments
 (0)