Skip to content

Fix the clang dependency of sourcekit libraries. #78073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/5.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/modules/SwiftWindowsSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ macro(swift_swap_compiler_if_needed target)
endif()
set(CMAKE_C_COMPILER_ID Clang)
set(CMAKE_CXX_COMPILER_ID Clang)
set(SOURCEKIT_SWIFT_SWAP_COMPILER TRUE)
message(STATUS "C/C++ compiler for ${target} is set to: ${CMAKE_C_COMPILER}")
else()
message(SEND_ERROR "${target} requires a clang based compiler. Please set SWIFT_CLANG_LOCATION.")
Expand Down
1 change: 1 addition & 0 deletions tools/SourceKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
message(SEND_ERROR "SourceKit cannot be built standalone")
endif()

set(SOURCEKIT_SWIFT_SWAP_COMPILER FALSE)
include(SwiftWindowsSupport)
swift_swap_compiler_if_needed("SourceKit")

Expand Down
4 changes: 2 additions & 2 deletions tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ 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)
if(NOT SWIFT_BUILT_STANDALONE AND SOURCEKIT_SWIFT_SWAP_COMPILER)
add_dependencies(${name} clang)
endif()
llvm_update_compile_flags(${name})
Expand Down Expand Up @@ -325,7 +325,7 @@ macro(add_sourcekit_executable name)
"${SOURCEKIT_EXECUTABLE_multiple_parameter_options}" ${ARGN})

add_executable(${name} ${SOURCEKITEXE_UNPARSED_ARGUMENTS})
if(NOT SWIFT_BUILT_STANDALONE AND NOT CMAKE_C_COMPILER_ID MATCHES Clang)
if(NOT SWIFT_BUILT_STANDALONE AND SOURCEKIT_SWIFT_SWAP_COMPILER)
add_dependencies(${name} clang)
endif()
llvm_update_compile_flags(${name})
Expand Down