From 24be817507d3b1af07cccdf3fead065116b65bc9 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 26 Jun 2020 01:23:43 -0400 Subject: [PATCH] [libc++] Fix the runtimes build after making __config_site mandatory The runtimes build includes libcxx/include/CMakeLists.txt directly instead of going through the top-level CMake file. This not-very-hygienic inclusion caused some variables like LIBCXX_BINARY_DIR not to be defined properly, and the config_site generation logic to fail after landing 53623d4aa710. This patch works around this issue by defining the missing variables. However, the proper fix for this would be for the runtimes build to always go through libc++'s top-level CMakeLists.txt. Doing otherwise is unsupported. --- runtimes/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index ea73cec050e..d56f7af583e 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -222,6 +222,8 @@ else() # if this is included from LLVM's CMake if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES) # This looks wrong, but libcxx's build actually wants the header dir to be # the root build dir, not the include directory. + set(LIBCXX_BINARY_DIR ${LLVM_BINARY_DIR}) + set(LIBCXX_SOURCE_DIR ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}) set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) set(CXX_HEADER_TARGET runtime-libcxx-headers) add_subdirectory(${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include ${CXX_HEADER_TARGET})