Currently we passthrough CMake variables based on project prefix,
i.e. LIBCXX_, LIBCXXABI_, LIBUNWIND_ and COMPILER_RT_. However, many
compiler-rt flags start with SANITIZER_ rather than COMPILER_RT, so
passthrough those as well.
Differential Revision: https://reviews.llvm.org/D75773
string(REPLACE "-" "_" canon_name ${projName})
string(TOUPPER ${canon_name} canon_name)
list(APPEND prefixes ${canon_name})
+ # Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_,
+ # so when compiler-rt is enabled, consider both.
+ if(canon_name STREQUAL "COMPILER_RT")
+ list(APPEND prefixes SANITIZER)
+ endif()
string(FIND ${projName} "lib" LIB_IDX)
if(LIB_IDX EQUAL 0)