diff --git a/compiler-rt/test/CMakeLists.txt b/compiler-rt/test/CMakeLists.txt index e5c51c8cd474..54132f342340 100644 --- a/compiler-rt/test/CMakeLists.txt +++ b/compiler-rt/test/CMakeLists.txt @@ -61,7 +61,7 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS) add_subdirectory(ubsan) endif() # CFI tests require diagnostic mode, which is implemented in UBSan. - if(COMPILER_RT_HAS_UBSAN) + if(COMPILER_RT_HAS_CFI AND COMPILER_RT_HAS_UBSAN) add_subdirectory(cfi) endif() if(COMPILER_RT_HAS_SAFESTACK)