[build] Stop assuming llvm is always the top-level in unified build

Even with unified build, llvm is not always the top-level project but it
can be a part of a larger build. (e.g. [^1]) In that case,
`CMAKE_BINARY_DIR` is not the binary directory of llvm but the binary
directory of the top-level project. This patch fixes the issue by using
`LLVM_BINARY_DIR` instead.

[^1]: 9b4b907079/extensions/cxx_debugging/CMakeLists.txt (L105)
This commit is contained in:
Yuta Saito
2025-02-13 00:17:29 +00:00
parent 772cff17d7
commit 6e3d401b41

View File

@@ -258,7 +258,7 @@ macro(swift_common_unified_build_config product)
set(LLVM_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake/modules")
set(CLANG_INCLUDE_DIRS
"${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include"
"${CMAKE_BINARY_DIR}/tools/clang/include")
"${LLVM_BINARY_DIR}/tools/clang/include")
include_directories(${CLANG_INCLUDE_DIRS})