Skip to content

Commit 6f3c744

Browse files
authored
Merge pull request swiftlang#27900 from compnerd/just-in-time-compiler-compiler
build: add a dependency on the just built clang (NFC)
2 parents 1a45ef2 + 2dbb7fa commit 6f3c744

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ macro(add_sourcekit_library name)
132132
set(libkind)
133133
endif()
134134
add_library(${name} ${libkind} ${srcs})
135+
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang)
136+
add_dependencies(${name} clang)
137+
endif()
135138
llvm_update_compile_flags(${name})
136139

137140
set_output_directory(${name}
@@ -228,6 +231,9 @@ macro(add_sourcekit_executable name)
228231
else()
229232
add_executable(${name} ${SOURCEKITEXE_UNPARSED_ARGUMENTS})
230233
endif()
234+
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang)
235+
add_dependencies(${name} clang)
236+
endif()
231237
llvm_update_compile_flags(${name})
232238
set_output_directory(${name}
233239
BINARY_DIR ${SOURCEKIT_RUNTIME_OUTPUT_INTDIR}

tools/libSwiftSyntaxParser/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ set(LLVM_EXPORTED_SYMBOL_FILE
1010
add_swift_host_library(libSwiftSyntaxParser SHARED
1111
c-include-check.c
1212
libSwiftSyntaxParser.cpp)
13+
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang)
14+
add_dependencies(libSwiftSyntaxParser clang)
15+
endif()
1316
target_link_libraries(libSwiftSyntaxParser PRIVATE
1417
swiftParse)
1518
set_target_properties(libSwiftSyntaxParser

tools/swift-syntax-parser-test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ add_swift_host_tool(swift-syntax-parser-test
77
Support
88
SWIFT_COMPONENT tools
99
)
10+
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang)
11+
add_dependencies(swift-syntax-parser-test clang)
12+
endif()
1013
target_link_libraries(swift-syntax-parser-test
1114
PRIVATE
1215
libSwiftSyntaxParser

unittests/SyntaxParser/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ swift_swap_compiler_if_needed("SyntaxParserUnitTests")
44
add_swift_unittest(SwiftSyntaxParserTests
55
SyntaxParserTests.cpp
66
)
7+
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID STREQUAL Clang)
8+
add_dependencies(SwiftSyntaxParserTests clang)
9+
endif()
710

811
target_link_libraries(SwiftSyntaxParserTests
912
PRIVATE

0 commit comments

Comments
 (0)