1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[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.
This commit is contained in:
Louis Dionne 2020-06-26 01:23:43 -04:00
parent 4bfbd85d51
commit 24be817507

View File

@ -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})