diff options
author | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-09-28 10:57:15 +0000 |
---|---|---|
committer | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-09-28 10:57:15 +0000 |
commit | 6779d926d729118624d195cba5725d07ebc6f372 (patch) | |
tree | 799eabd882c943f4fbcdb00cb5aa6bd2beb4abd6 /libunwind/CMakeLists.txt | |
parent | b15d41b308cb9f2b662d413cba673956ba20bb8f (diff) |
[libunwind] Add support for a single-threaded libunwind build
The EHABI unwinder is thread-agnostic, SJLJ unwinder and the DWARF unwinder have
a couple of pthread dependencies.
This patch makes it possible to build the whole of libunwind for a
single-threaded environment.
Reviewers: compnerd
Differential revision: https://reviews.llvm.org/D24984
Diffstat (limited to 'libunwind/CMakeLists.txt')
-rw-r--r-- | libunwind/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index bebf4adb5df..1048156202d 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -107,6 +107,7 @@ option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON) option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." ON) option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding support." OFF) option(LIBUNWIND_ENABLE_ARM_WMMX "Enable unwinding support for ARM WMMX registers." OFF) +option(LIBUNWIND_ENABLE_THREADS "Build libunwind with threading support." ON) set(LIBUNWIND_TARGET_TRIPLE "" CACHE STRING "Target triple for cross compiling.") set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.") @@ -242,6 +243,11 @@ if (NOT LIBUNWIND_ENABLE_CROSS_UNWINDING) list(APPEND LIBUNWIND_COMPILE_FLAGS -D_LIBUNWIND_IS_NATIVE_ONLY) endif() +# Threading-support +if (NOT LIBUNWIND_ENABLE_THREADS) + list(APPEND LIBUNWIND_COMPILE_FLAGS -D_LIBUNWIND_HAS_NO_THREADS) +endif() + # ARM WMMX register support if (LIBUNWIND_ENABLE_ARM_WMMX) # __ARM_WMMX is a compiler pre-define (as per the ACLE 2.0). Clang does not |