Skip to content

Commit 3add677

Browse files
committed
build: correct dependencies for a unified build
When not building with the standard library with the host compiler and building the check target for Swift from clean, we would mis-order the build for the BlocksRuntimeStubs which depends on the just built compiler. Ensure that CMake knows this dependency.
1 parent 040ac4b commit 3add677

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

stdlib/private/BlocksRuntimeStubs/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ foreach(SDK ${SWIFT_SDKS})
2525
LIBRARY_OUTPUT_DIRECTORY ${test_bin_dir}
2626
RUNTIME_OUTPUT_DIRECTORY ${test_bin_dir}
2727
OUTPUT_NAME BlocksRuntime)
28+
29+
# When built in a unified build, ensure that we add a dependency on the
30+
# compiler to serialize this behind the compiler. Otherwise, we would
31+
# attempt to build this before the compiler is ready, which breaks the
32+
# build.
33+
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER AND NOT BUILD_STANDALONE AND
34+
TARGET clang)
35+
add_dependencies(BlocksRuntimeStub${VARIANT_SUFFIX} clang)
36+
endif()
2837
endforeach()
2938
endforeach()
3039
endforeach()

0 commit comments

Comments
 (0)