Index: lib/CMakeLists.txt =================================================================== --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -56,8 +56,15 @@ if(COMPILER_RT_HAS_SCUDO) add_subdirectory(scudo) endif() +endif() - if(COMPILER_RT_HAS_XRAY) +if(COMPILER_RT_BUILD_XRAY) + if(COMPILER_RT_HAS_SANITIZER_COMMON AND COMPILER_RT_HAS_XRAY) + if (NOT COMPILER_RT_BUILD_SANITIZERS) + # For the case where only XRay is being built (i.e. none of the other + # sanitizers), we want to build the sanitizer_common library as well. + add_subdirectory(sanitizer_common) + endif() add_subdirectory(xray) endif() endif()