summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxxabi/cmake/config-ix.cmake1
-rw-r--r--libcxxabi/src/CMakeLists.txt11
2 files changed, 9 insertions, 3 deletions
diff --git a/libcxxabi/cmake/config-ix.cmake b/libcxxabi/cmake/config-ix.cmake
index 94f89bedd97..496ed346375 100644
--- a/libcxxabi/cmake/config-ix.cmake
+++ b/libcxxabi/cmake/config-ix.cmake
@@ -75,3 +75,4 @@ check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB)
check_library_exists(pthread pthread_once "" LIBCXXABI_HAS_PTHREAD_LIB)
check_library_exists(c __cxa_thread_atexit_impl ""
LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
+check_library_exists(System write "" LIBCXXABI_HAS_SYSTEM_LIB)
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 6cfcb9cb3df..cbf4b21c31f 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -60,11 +60,16 @@ if (LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
add_definitions(-DHAVE___CXA_THREAD_ATEXIT_IMPL)
endif()
-if (LIBCXXABI_ENABLE_THREADS)
- add_library_flags_if(LIBCXXABI_HAS_PTHREAD_LIB pthread)
+if (APPLE)
+ add_library_flags_if(LIBCXXABI_HAS_SYSTEM_LIB System)
+else()
+ if (LIBCXXABI_ENABLE_THREADS)
+ add_library_flags_if(LIBCXXABI_HAS_PTHREAD_LIB pthread)
+ endif()
+
+ add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
endif()
-add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
if (LIBCXXABI_USE_LLVM_UNWINDER)
# Prefer using the in-tree version of libunwind, either shared or static. If
# none are found fall back to using -lunwind.
OpenPOWER on IntegriCloud