mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:40:38 +00:00
[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. llvm-svn: 332628
This commit is contained in:
parent
74d366f0da
commit
c8ad1f12f2
@ -438,6 +438,7 @@ endif( LLVM_USE_OPROFILE )
|
||||
|
||||
set(LLVM_USE_SANITIZER "" CACHE STRING
|
||||
"Define the sanitizer used to build binaries and tests.")
|
||||
option(LLVM_OPTIMIZE_SANITIZED_BUILDS "Pass -O1 on debug sanitizer builds" ON)
|
||||
set(LLVM_LIB_FUZZING_ENGINE "" CACHE PATH
|
||||
"Path to fuzzing library for linking with fuzz targets")
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user