[test] Build sanitizer/xray tests only if COMPILER_RT_BUILD_* is on
Cover the sanitizer tests with COMPILER_RT_BUILD_SANITIZERS
conditional, and add COMPILER_RT_BUILD_XRAY conditional to the xray
tests. This makes it possible to do a pure-builtins build with tests
enabled.
@@ -41,6 +41,7 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
if(COMPILER_RT_BUILD_BUILTINS)
add_subdirectory(builtins)
endif()
+ if(COMPILER_RT_BUILD_SANITIZERS)
if(COMPILER_RT_HAS_ASAN)
add_subdirectory(asan)
endif()
@@ -81,7 +82,8 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
if(COMPILER_RT_HAS_SCUDO)
add_subdirectory(scudo)
endif()
- if(COMPILER_RT_HAS_XRAY)
+ endif()
+ if(COMPILER_RT_BUILD_XRAY AND COMPILER_RT_HAS_XRAY)
add_subdirectory(xray)
endif()
endif()
