Changeset View
Changeset View
Standalone View
Standalone View
lib/CMakeLists.txt
# First, add the subdirectories which contain feature-based runtime libraries | # First, add the subdirectories which contain feature-based runtime libraries | ||||
# and several convenience helper libraries. | # and several convenience helper libraries. | ||||
include(AddCompilerRT) | include(AddCompilerRT) | ||||
include(SanitizerUtils) | include(SanitizerUtils) | ||||
if(COMPILER_RT_BUILD_BUILTINS) | if(COMPILER_RT_BUILD_BUILTINS) | ||||
echristo: This definitely makes more sense, can you add a TODO to factor out the command line handling? | |||||
add_subdirectory(builtins) | add_subdirectory(builtins) | ||||
endif() | endif() | ||||
if(COMPILER_RT_BUILD_SANITIZERS) | if(COMPILER_RT_BUILD_SANITIZERS) | ||||
if(COMPILER_RT_HAS_INTERCEPTION) | if(COMPILER_RT_HAS_INTERCEPTION) | ||||
add_subdirectory(interception) | add_subdirectory(interception) | ||||
endif() | endif() | ||||
Show All 36 Lines | if(COMPILER_RT_BUILD_SANITIZERS) | ||||
if(COMPILER_RT_HAS_ESAN) | if(COMPILER_RT_HAS_ESAN) | ||||
add_subdirectory(esan) | add_subdirectory(esan) | ||||
endif() | endif() | ||||
if(COMPILER_RT_HAS_SCUDO) | if(COMPILER_RT_HAS_SCUDO) | ||||
add_subdirectory(scudo) | add_subdirectory(scudo) | ||||
endif() | endif() | ||||
endif() | endif() | ||||
if(COMPILER_RT_BUILD_XRAY) | |||||
if(COMPILER_RT_HAS_XRAY AND COMPILER_RT_HAS_SANITIZER_COMMON) | |||||
if (NOT COMPILER_RT_BUILD_SANITIZERS) | |||||
add_subdirectory(sanitizer_common) | |||||
endif() | |||||
add_subdirectory(xray) | |||||
endif() | |||||
endif() | |||||
echristoUnsubmitted Not Done ReplyInline ActionsThis looks unnecessarily complicated? echristo: This looks unnecessarily complicated? | |||||
dberrisAuthorUnsubmitted Not Done ReplyInline ActionsRight. The other option was to just lump XRay into the sanitizers above. But that doesn't allow us to just build XRay -- or at least, XRay isn't strictly a sanitizer even. If we want to allow building just XRay which depends on sanitizer_common for the flag processing then we need to guard that somehow. This is the Nth iteration for this that I can convince myself is succinct enough to convey the intent. It's really that:
Other more invasive change involves building sanitizer_common if either we build the sanitizers or we build xray. I can go with that approach, which might make this part of the stuff less complicated. WDYT? dberris: Right. The other option was to just lump XRay into the sanitizers above. But that doesn't allow… |
This definitely makes more sense, can you add a TODO to factor out the command line handling?