[libcxx] Link target `cxx_external_threads` to `cxx-headers` for BUILD_EXTERNAL_THREAD_LIBRARY

Fix compilation of libcxx when using -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY. Target `cxx_external_threads` gets linked to `cxx-headers` to include all needed headers and flags.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D86773
This commit is contained in:
David Nicuesa 2020-09-01 12:41:21 +01:00 committed by Mikhail Maltsev
parent ca233be2f0
commit 722db5c0b4
1 changed files with 4 additions and 1 deletions

View File

@ -323,7 +323,8 @@ endif()
if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)
set(LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/../test/support/external_threads.cpp")
if (LIBCXX_ENABLE_SHARED)
add_library(cxx_external_threads SHARED ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
@ -337,6 +338,8 @@ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
OUTPUT_NAME "c++external_threads"
)
target_link_libraries(cxx_external_threads PRIVATE cxx-headers)
endif()
if (LIBCXX_INSTALL_LIBRARY)