Skip to content

Commit 1e5df70

Browse files
committed
build: add a workaround for CMake[>=3.22] and SourceKit
The switch between compilers causes problems due to new flags being used for building. This adds a workaround to avoid the search path re-ordering which breaks the build with a newer CMake.
1 parent adf712e commit 1e5df70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ function(add_sourcekit_default_compiler_flags target)
1111
if(${SWIFT_HOST_VARIANT_SDK} STREQUAL WINDOWS)
1212
swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH}
1313
${SWIFT_HOST_VARIANT_ARCH}_INCLUDE)
14+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
15+
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
16+
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
17+
endif()
1418
target_include_directories(${target} SYSTEM PRIVATE
1519
${${SWIFT_HOST_VARIANT_ARCH}_INCLUDE})
1620
endif()

0 commit comments

Comments
 (0)