summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-10-25 23:03:34 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-10-25 23:03:34 +0000
commit7e8db745c56f7f9317f0d3472bf01bd48ca3424b (patch)
tree912fcd40f44d646e0f81ab9ff63231dea1afe0b9 /CMakeLists.txt
parentc1a1ed62228288155459d39194995a36aca4a8a6 (diff)
downloadcompiler-rt-7e8db745c56f7f9317f0d3472bf01bd48ca3424b.tar.gz
compiler-rt-7e8db745c56f7f9317f0d3472bf01bd48ca3424b.tar.bz2
compiler-rt-7e8db745c56f7f9317f0d3472bf01bd48ca3424b.tar.xz
Add a CMake option COMPILER_RT_DEBUG for building runtimes with full debug info.
Differential Revision: http://llvm-reviews.chandlerc.com/D1984 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 123b60ea..2d968beb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,6 +124,11 @@ function(filter_available_targets out_var)
set(${out_var} ${archs} PARENT_SCOPE)
endfunction()
+option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF)
+
+# COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in.
+pythonize_bool(COMPILER_RT_DEBUG)
+
# Provide some common commmandline flags for Sanitizer runtimes.
if (NOT MSVC)
set(SANITIZER_COMMON_CFLAGS
@@ -134,9 +139,11 @@ if (NOT MSVC)
-funwind-tables
-fno-stack-protector
-Wno-gnu # Variadic macros with 0 arguments for ...
- -O3
-fvisibility=hidden
)
+ if (NOT COMPILER_RT_DEBUG)
+ list(APPEND SANITIZER_COMMON_CFLAGS -O3)
+ endif()
else()
set(SANITIZER_COMMON_CFLAGS
/MT
@@ -149,7 +156,7 @@ endif()
# Build sanitizer runtimes with debug info. (MSVC gets /Zi above)
if (NOT MSVC)
check_cxx_compiler_flag(-gline-tables-only SUPPORTS_GLINE_TABLES_ONLY_FLAG)
- if(SUPPORTS_GLINE_TABLES_ONLY_FLAG)
+ if(SUPPORTS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG)
list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only)
else()
list(APPEND SANITIZER_COMMON_CFLAGS -g)