Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -19,12 +19,20 @@ add_subdirectory(asan) add_subdirectory(interception) add_subdirectory(sanitizer_common) + else() + # If we don't support the OS, clear the arch list to disable the tests. + set(ASAN_SUPPORTED_ARCH PARENT_SCOPE) endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD" AND NOT ANDROID) # LSan, UBsan and profile can be built on Mac OS, FreeBSD and Linux. add_subdirectory(lsan) add_subdirectory(profile) add_subdirectory(ubsan) + else() + # If we don't support the OS, clear the arch list to disable the tests. + set(LSAN_SUPPORTED_ARCH PARENT_SCOPE) + set(PROFILE_SUPPORTED_ARCH PARENT_SCOPE) + set(UBSAN_SUPPORTED_ARCH PARENT_SCOPE) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID) # ThreadSanitizer and MemorySanitizer are supported on Linux only. @@ -33,6 +41,11 @@ add_subdirectory(msan) add_subdirectory(msandr) add_subdirectory(dfsan) + else() + # If we don't support the OS, clear the arch list to disable the tests. + set(TSAN_SUPPORTED_ARCH PARENT_SCOPE) + set(DFSAN_SUPPORTED_ARCH PARENT_SCOPE) + set(MSAN_SUPPORTED_ARCH PARENT_SCOPE) endif() endif()