summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2016-08-22 18:31:37 +0000
committerFrancis Ricci <francisjricci@gmail.com>2016-08-22 18:31:37 +0000
commit37a8f4803fc176a001f0f2d70250a7e99b5dfea5 (patch)
treed1664216434ba2d5bf30acac56276fd82435c3b0 /CMakeLists.txt
parente0c295a416d1906af4137cddec1a34a91bae0a40 (diff)
[compiler-rt] Make cxxabi availability configurable in cmake
Summary: Allow for use of cxxabi to be disabled from cmake. This will make sanitizers usable when c++ abi is unavailable. Reviewers: pcc, rnk, samsonov, beanz, compnerd Subscribers: llvm-commits, compnerd, dberris Differential Revision: https://reviews.llvm.org/D23639 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 13 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92eab598f..05bd8c0bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,6 +85,19 @@ option(COMPILER_RT_EXTERNALIZE_DEBUGINFO
# COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in.
pythonize_bool(COMPILER_RT_DEBUG)
+if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9")
+ # Mac OS X prior to 10.9 had problems with exporting symbols from
+ # libc++/libc++abi.
+ set(use_cxxabi_default OFF)
+elseif(MSVC)
+ set(use_cxxabi_default OFF)
+else()
+ set(use_cxxabi_default ON)
+endif()
+
+option(SANITIZER_CAN_USE_CXXABI "Sanitizers can use cxxabi" ${use_cxxabi_default})
+pythonize_bool(SANITIZER_CAN_USE_CXXABI)
+
#================================
# Setup Compiler Flags
#================================
@@ -204,17 +217,6 @@ append_list_if(COMPILER_RT_HAS_WD4800_FLAG /wd4800 SANITIZER_COMMON_CFLAGS)
# Warnings to turn off for all libraries, not just sanitizers.
append_string_if(COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG -Wno-unused-parameter CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9")
- # Mac OS X prior to 10.9 had problems with exporting symbols from
- # libc++/libc++abi.
- set(SANITIZER_CAN_USE_CXXABI FALSE)
-elseif(MSVC)
- set(SANITIZER_CAN_USE_CXXABI FALSE)
-else()
- set(SANITIZER_CAN_USE_CXXABI TRUE)
-endif()
-pythonize_bool(SANITIZER_CAN_USE_CXXABI)
-
add_subdirectory(include)
set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx)