summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-07-15 00:49:42 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-07-15 00:49:42 +0000
commitf0a26203e7ce856ccf7c12c2c1c9d13e5c3ad939 (patch)
treeedf440ad25d43ee69b47bf6c9fc8c7345e5869df /CMakeLists.txt
parent5328c6b635a145efc1204ad25341706fb705e346 (diff)
libc++abi: add a top level option for using CompilerRT
Add an option to opt into compiler-rt instead of libgcc. This option defaults to OFF to avoid a behaviour change. It is not possible to mix and match different runtime libraries. Disabling this requires that libc++ is built accordingly. This knob is particularly useful for targets that are GCC by default (i.e. Linux). git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@275505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00ebdcf..54650eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,7 @@ option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode.
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_USE_COMPILER_RT "Use compiler-rt instead of libgcc" 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)
option(LIBCXXABI_BUILD_32_BITS "Build 32 bit libc++abi." ${LLVM_BUILD_32_BITS})
@@ -243,6 +244,9 @@ if (LIBCXXABI_HAS_NOSTDINCXX_FLAG)
string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
+if (LIBCXXABI_USE_COMPILER_RT)
+ list(APPEND LIBCXXABI_LINK_FLAGS "-rtlib=compiler-rt")
+endif ()
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WERROR_FLAG -Werror=return-type)