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

Mikhail Maltsev via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 1 04:44:30 PDT 2020


Author: David Nicuesa
Date: 2020-09-01T12:43:44+01:00
New Revision: 722db5c0b4e8dffabbd97265e5ea9edac05548ae

URL: https://github.com/llvm/llvm-project/commit/722db5c0b4e8dffabbd97265e5ea9edac05548ae
DIFF: https://github.com/llvm/llvm-project/commit/722db5c0b4e8dffabbd97265e5ea9edac05548ae.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 2001c09761d9..dcd53c8a302a 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -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)


        


More information about the libcxx-commits mailing list