From 7d285ea7b988b7a7ff906e19e29a9632e37ce120 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 15 May 2021 23:58:35 -0400 Subject: [PATCH] CMake better cache variable properties options for sanitizers Makes it easier for CMake GUI interfaces to know this is a variable that takes in different strings instead of a boolean. --- cmake/sanitizers.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/sanitizers.cmake b/cmake/sanitizers.cmake index a86e336..8abf3f2 100644 --- a/cmake/sanitizers.cmake +++ b/cmake/sanitizers.cmake @@ -76,7 +76,8 @@ endmacro() macro(process_sanitizer prefix) # Add options for the project to use sanitizers - option(${prefix}_USE_SANITIZER "Enable building with sanitizer support. Options are: Address, HWAddress, Memory, MemoryWithOrigins, Undefined, Thread, DataFlow, Leak, 'Address,Undefined'" false) + set(${prefix}_USE_SANITIZER "false" CACHE STRING "Enable building with sanitizer support.") + set_property(CACHE ${prefix}_USE_SANITIZER PROPERTY STRINGS Address HWAddress Memory MemoryWithOrigins Undefined Thread DataFlow Leak "Address,Undefined") if (UNIX) option(${prefix}_OPTIMIZE_SANITIZED_BUILDS "Optimize builds that use sanitization" false) option(${prefix}_BLACKLIST_FILE "Path to blacklist file for sanitizers" "")