diff options
author | Ben Craig <ben.craig@codeaurora.org> | 2016-05-25 17:37:38 +0000 |
---|---|---|
committer | Ben Craig <ben.craig@codeaurora.org> | 2016-05-25 17:37:38 +0000 |
commit | 24a986108f3240802da990206bd8aafa2f2c638b (patch) | |
tree | 8fdaa03ce791411151f942c294d31e905cddb806 | |
parent | 1cc499141266633240cb6090a29bc7d040e069bf (diff) | |
download | bcm5719-llvm-24a986108f3240802da990206bd8aafa2f2c638b.tar.gz bcm5719-llvm-24a986108f3240802da990206bd8aafa2f2c638b.zip |
Allow explicit pthread opt-in
When building libcxxabi in tree (i.e. in llvm/projects/libcxxabi,
along with llvm/projects/libcxx), libcxx's config_site.in doesn't
get created in a timely manner. This means that any configuration
that is normally set in libcxx's config_site.in needs to be
duplicated in libcxxabi to successfully build libcxxabi. This patch
does exactly that for the _LIBCPP_HAS_THREAD_API_PTHREAD
preprocessor define.
http://reviews.llvm.org/D20574
llvm-svn: 270732
-rw-r--r-- | libcxxabi/CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 50d1fd78c5a..37cc56095f6 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -113,6 +113,7 @@ option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF) option(LIBCXXABI_ENABLE_THREADS "Build with threads enabled" ON) +option(LIBCXXABI_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF) set(LIBCXXABI_GCC_TOOLCHAIN "" CACHE STRING "GCC toolchain for cross compiling.") set(LIBCXXABI_SYSROOT "" CACHE STRING "Sysroot for cross compiling.") set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE STRING "The path to libc++ library.") @@ -272,9 +273,18 @@ if (NOT LIBCXXABI_ENABLE_SHARED) endif() if (NOT LIBCXXABI_ENABLE_THREADS) + if (LIBCXXABI_HAS_PTHREAD_API) + message(FATAL_ERROR "LIBCXXABI_HAS_PTHREAD_API can only" + " be set to ON when LIBCXXABI_ENABLE_THREADS" + " is also set to ON.") + endif() add_definitions(-DLIBCXXABI_HAS_NO_THREADS=1) endif() +if (LIBCXXABI_HAS_PTHREAD_API) + add_definitions(-D_LIBCPP_HAS_THREAD_API_PTHREAD) +endif() + # This is the _ONLY_ place where add_definitions is called. if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) |