diff --git a/CMakeLists.txt b/CMakeLists.txt index 6adcb7c..4b03700 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,16 +126,16 @@ set(ALLOWED_stacksan 0) set(ALLOWED_dataflowsan 0) set(ALLOWED_cfisan 0) set(ALLOWED_kcfisan 0) -if(NOT WIN32 OR NOT BUILD_ASAN OR NOT BUILD_SAN) +if(NOT WIN32 AND (BUILD_ASAN OR BUILD_SAN)) set(ALLOWED_asan 1) endif() -if(IS_CC_CLANG OR NOT BUILD_MSAN OR NOT BUILD_SAN) +if(IS_CC_CLANG AND (BUILD_MSAN OR BUILD_SAN)) set(ALLOWED_msan 1) endif() -if(NOT ANDROID OR NOT WIN32 OR NOT BUILD_TSAN OR NOT BUILD_SAN) +if(NOT ANDROID AND NOT WIN32 AND (BUILD_TSAN OR BUILD_SAN)) set(ALLOWED_tsan 1) endif() -if(NOT WIN32 OR NOT BUILD_UBSAN OR NOT BUILD_SAN) +if(NOT WIN32 AND (BUILD_UBSAN OR BUILD_SAN)) set(ALLOWED_ubsan 1) endif() set(SAN_NAMES "asan" "msan" "tsan" "ubsan") @@ -332,10 +332,8 @@ function(wtr_add_autosan_bin_target NAME SRC_SET IS_TEST) endif() foreach(SAN ${SAN_NAMES}) string(TOUPPER ${SAN} UPPER_SAN) - if(NOT BUILD_SAN) - message(STATUS "${NAME}.${SAN}: Skipped (BUILD_SAN=${BUILD_SAN})") - elseif(NOT BUILD_${UPPER_SAN}) - message(STATUS "${NAME}.${SAN}: Skipped (BUILD_${UPPER_SAN}=${BUILD_${UPPER_SAN}})") + if(NOT BUILD_SAN AND NOT BUILD_${UPPER_SAN}) + message(STATUS "${NAME}.${SAN}: Skipped (BUILD_SAN=${BUILD_SAN}, BUILD_${UPPER_SAN}=${BUILD_${UPPER_SAN}})") elseif(NOT ALLOWED_${SAN}) message(STATUS "${NAME}.${SAN}: Skipped (Unsupported on ${CMAKE_SYSTEM}/${CMAKE_CXX_COMPILER_ID})") elseif(IS_TEST) @@ -351,11 +349,8 @@ function(wtr_add_san_lib_target NAME OUTPUT_NAME SRC_SET INC_SET LIB_TYPE SAN) if (NOT BUILD_LIB) message(STATUS "${NAME}: Skipped (BUILD_LIB=${BUILD_LIB})") return() - elseif (NOT BUILD_SAN) - message(STATUS "${NAME}: Skipped (BUILD_SAN=${BUILD_SAN})") - return() - elseif (NOT BUILD_${UPPER_SAN}) - message(STATUS "${NAME}: Skipped (BUILD_${UPPER_SAN}=${BUILD_${UPPER_SAN}})") + elseif (NOT BUILD_SAN AND NOT BUILD_${UPPER_SAN}) + message(STATUS "${NAME}: Skipped (BUILD_SAN=${BUILD_SAN}, BUILD_${UPPER_SAN}=${BUILD_${UPPER_SAN}})") return() elseif (NOT ALLOWED_${SAN}) message(STATUS "${NAME}: Skipped (Unsupported on ${CMAKE_SYSTEM}/${CMAKE_CXX_COMPILER_ID})")