From 6e3d401b415e831b1fbfd65e47fab4174ba3b95d Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Thu, 13 Feb 2025 00:17:29 +0000 Subject: [PATCH] [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]: https://github.com/ChromeDevTools/devtools-frontend/blob/9b4b9070790196d78489756c515c528a0fe7ac00/extensions/cxx_debugging/CMakeLists.txt#L105 --- cmake/modules/SwiftSharedCMakeConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/SwiftSharedCMakeConfig.cmake b/cmake/modules/SwiftSharedCMakeConfig.cmake index 925b09e1ba98f..ff552d65a90e2 100644 --- a/cmake/modules/SwiftSharedCMakeConfig.cmake +++ b/cmake/modules/SwiftSharedCMakeConfig.cmake @@ -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})