diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2017-07-15 00:30:46 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2017-07-15 00:30:46 +0000 |
commit | e89d0a8f5cd83557fcff4d13a6dbffdd19220236 (patch) | |
tree | 7c9691d299861f9204e119034d22ffe8dbdd765b /compiler-rt | |
parent | 0bc7d633224a56e0112243e428b4e8fbdb9a3f60 (diff) | |
download | bcm5719-llvm-e89d0a8f5cd83557fcff4d13a6dbffdd19220236.tar.gz bcm5719-llvm-e89d0a8f5cd83557fcff4d13a6dbffdd19220236.zip |
[compiler-rt] [CMake] Build compiler-rt with no optimizations if the flag says so
Differential Revision: https://reviews.llvm.org/D35400
llvm-svn: 308072
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 3195de1e5d1..f997c53410c 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -172,10 +172,16 @@ endif() append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) -# Build with optimization, unless we're in debug mode. If we're using MSVC, +# If we're using MSVC, # always respect the optimization flags set by CMAKE_BUILD_TYPE instead. -if(NOT COMPILER_RT_DEBUG AND NOT MSVC) - list(APPEND SANITIZER_COMMON_CFLAGS -O3) +if (NOT MSVC) + + # Build with optimization, unless we're in debug mode. + if(COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -O0) + else() + list(APPEND SANITIZER_COMMON_CFLAGS -O3) + endif() endif() # Determine if we should restrict stack frame sizes. |