summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorChris Bieneman <chris.bieneman@me.com>2018-05-17 16:55:29 +0000
committerChris Bieneman <chris.bieneman@me.com>2018-05-17 16:55:29 +0000
commitcce04b3a5cdd8c9557af7131fae217a32f4d5b01 (patch)
treebeebea93fafd1f03bd7421801ec73accc8df5699 /cmake
parenta1fecd54c572375e631ec2b1135cab708428abc3 (diff)
[CMake] Make optimizing sanitizer builds optional
This behavior has been the default for a long time, so the default value is On, however this can make it difficult to debug sanitizer failures, so we should have an option to turn it off. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 66ccebddbdc..7687a4663e4 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -639,7 +639,7 @@ macro(append_common_sanitizer_flags)
add_flag_if_supported("-gline-tables-only" GLINE_TABLES_ONLY)
endif()
# Use -O1 even in debug mode, otherwise sanitizers slowdown is too large.
- if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND LLVM_OPTIMIZE_SANITIZED_BUILDS)
add_flag_if_supported("-O1" O1)
endif()
elseif (CLANG_CL)