diff --git a/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake b/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake index a544e07e8a7df..93a59786c57f7 100644 --- a/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake +++ b/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake @@ -132,6 +132,9 @@ macro(add_sourcekit_library name) set(libkind) endif() add_library(${name} ${libkind} ${srcs}) + if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang) + add_dependencies(${name} clang) + endif() llvm_update_compile_flags(${name}) set_output_directory(${name} @@ -228,6 +231,9 @@ macro(add_sourcekit_executable name) else() add_executable(${name} ${SOURCEKITEXE_UNPARSED_ARGUMENTS}) endif() + if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang) + add_dependencies(${name} clang) + endif() llvm_update_compile_flags(${name}) set_output_directory(${name} BINARY_DIR ${SOURCEKIT_RUNTIME_OUTPUT_INTDIR} diff --git a/tools/libSwiftSyntaxParser/CMakeLists.txt b/tools/libSwiftSyntaxParser/CMakeLists.txt index a068cd36fd69f..86818279b9f77 100644 --- a/tools/libSwiftSyntaxParser/CMakeLists.txt +++ b/tools/libSwiftSyntaxParser/CMakeLists.txt @@ -10,6 +10,9 @@ set(LLVM_EXPORTED_SYMBOL_FILE add_swift_host_library(libSwiftSyntaxParser SHARED c-include-check.c libSwiftSyntaxParser.cpp) +if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang) + add_dependencies(libSwiftSyntaxParser clang) +endif() target_link_libraries(libSwiftSyntaxParser PRIVATE swiftParse) set_target_properties(libSwiftSyntaxParser diff --git a/tools/swift-syntax-parser-test/CMakeLists.txt b/tools/swift-syntax-parser-test/CMakeLists.txt index 65dadfde5ea90..259f60211fd5c 100644 --- a/tools/swift-syntax-parser-test/CMakeLists.txt +++ b/tools/swift-syntax-parser-test/CMakeLists.txt @@ -7,6 +7,9 @@ add_swift_host_tool(swift-syntax-parser-test Support SWIFT_COMPONENT tools ) +if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang) + add_dependencies(swift-syntax-parser-test clang) +endif() target_link_libraries(swift-syntax-parser-test PRIVATE libSwiftSyntaxParser diff --git a/unittests/SyntaxParser/CMakeLists.txt b/unittests/SyntaxParser/CMakeLists.txt index 6082cbed76a87..bfb9e46ba9fd2 100644 --- a/unittests/SyntaxParser/CMakeLists.txt +++ b/unittests/SyntaxParser/CMakeLists.txt @@ -4,6 +4,9 @@ swift_swap_compiler_if_needed("SyntaxParserUnitTests") add_swift_unittest(SwiftSyntaxParserTests SyntaxParserTests.cpp ) +if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID STREQUAL Clang) + add_dependencies(SwiftSyntaxParserTests clang) +endif() target_link_libraries(SwiftSyntaxParserTests PRIVATE