Skip to content

Commit 449ef8a

Browse files
authored
[CMake] Replicate what ClangConfig does for unified builds (#70890)
ClangConfig sets `CLANG_INCLUDE_DIRS` and Swift build system uses that variable in a couple of places. Without this, several of the include directories for Clang might not be added to different parts of the compiler, like when using SwiftSourceSupport files. Before these changes, headers like `clang/CAS/CASOptions.h` were not being found.
1 parent c5fe028 commit 449ef8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ macro(swift_common_unified_build_config product)
272272
set(${product}_NATIVE_CLANG_TOOLS_PATH "${CMAKE_BINARY_DIR}/bin")
273273
set(LLVM_PACKAGE_VERSION ${PACKAGE_VERSION})
274274
set(LLVM_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake/modules")
275+
set(CLANG_INCLUDE_DIRS
276+
"${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include"
277+
"${CMAKE_BINARY_DIR}/tools/clang/include")
275278

276-
include_directories(${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include
277-
${CMAKE_BINARY_DIR}/tools/clang/include)
279+
include_directories(${CLANG_INCLUDE_DIRS})
278280

279281
# If cmark was checked out into tools/cmark, expect to build it as
280282
# part of the unified build.

0 commit comments

Comments
 (0)