mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
cmake: Error instead of warning and dropping invalid LLVM_USE_SANITIZER
Currently, if you call cmake with a typo in an LLVM_USE_SANITIZER value, there's a cmake warning and the build goes on with no sanitizers at all. This isn't a good behaviour, since cmake warnings are fairly easy to miss and the resulting behaviour is that it looks like the build is sanitizer clean. Upgrade these warnings to errors so misconfigurations are more obvious. llvm-svn: 246531
This commit is contained in:
parent
55390f2377
commit
d7f80181b8
@ -507,17 +507,17 @@ if(LLVM_USE_SANITIZER)
|
|||||||
append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
|
append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
|
||||||
CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
else()
|
else()
|
||||||
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
|
message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
|
||||||
endif()
|
endif()
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
if (LLVM_USE_SANITIZER STREQUAL "Address")
|
if (LLVM_USE_SANITIZER STREQUAL "Address")
|
||||||
append_common_sanitizer_flags()
|
append_common_sanitizer_flags()
|
||||||
append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
else()
|
else()
|
||||||
message(WARNING "This sanitizer not yet supported in the MSVC environment: ${LLVM_USE_SANITIZER}")
|
message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${LLVM_USE_SANITIZER}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.")
|
message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this platform.")
|
||||||
endif()
|
endif()
|
||||||
if (LLVM_USE_SANITIZE_COVERAGE)
|
if (LLVM_USE_SANITIZE_COVERAGE)
|
||||||
append("-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
append("-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user