summaryrefslogtreecommitdiff
path: root/cmake/detect-sanitizer.cmake
diff options
context:
space:
mode:
authoralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
committeralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
commit004b98220a30de0d1956a8149d8bc6ec356667da (patch)
tree1eaee2603984d7ab4524be68b57ce0a2b2b72118 /cmake/detect-sanitizer.cmake
parent2ca0d0b38b60e8d6d49a8959bf674a79e7d16f41 (diff)
parenta583e215afa2356e23b418efa871a1cc4348702a (diff)
Merge tag '2.0.7' into tachibanatachibana-mr1tachibana
Change-Id: I7b03d60d67d184c21ff7437a35062077666951e9
Diffstat (limited to 'cmake/detect-sanitizer.cmake')
-rw-r--r--cmake/detect-sanitizer.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmake/detect-sanitizer.cmake b/cmake/detect-sanitizer.cmake
index b0a0236..8af1f8e 100644
--- a/cmake/detect-sanitizer.cmake
+++ b/cmake/detect-sanitizer.cmake
@@ -16,12 +16,12 @@ macro(check_sanitizer_support known_checks supported_checks)
set(CMAKE_REQUIRED_FLAGS "-fsanitize=${compile_checks}")
- check_c_source_compiles("int main() { return 0; }" HAS_SANITIZER_${check}
+ check_c_source_compiles("int main() { return 0; }" HAVE_SANITIZER_${check}
FAIL_REGEX "not supported|unrecognized command|unknown option")
set(CMAKE_REQUIRED_FLAGS)
- if(HAS_SANITIZER_${check})
+ if(HAVE_SANITIZER_${check})
set(available_checks ${compile_checks})
endif()
endforeach()
@@ -108,7 +108,7 @@ macro(add_undefined_sanitizer)
)
# Only check for alignment sanitizer flag if unaligned access is not supported
- if(NOT UNALIGNED_OK)
+ if(NOT WITH_UNALIGNED)
list(APPEND known_checks alignment)
endif()
# Object size sanitizer has no effect at -O0 and produces compiler warning if enabled
@@ -124,7 +124,7 @@ macro(add_undefined_sanitizer)
# Group sanitizer flag -fsanitize=undefined will automatically add alignment, even if
# it is not in our sanitize flag list, so we need to explicitly disable alignment sanitizing.
- if(UNALIGNED_OK)
+ if(WITH_UNALIGNED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-sanitize=alignment")
endif()
else()