-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
With CMake 3.13, I've been writing a bunch of targets like this, where the SOURCES property of a target can be added by subdirectories and its evaluation is deferred to "generation time."
add_executable(myexecutable)
target_sources(myexecutable PRIVATE main.cc)
Unfortunately, this makes these targets incompatible with add_sanitizers(...) because the scripts are not able to find any source files in the target:
CMake Warning at third_party/sanitizers-cmake/cmake/FindSanitizers.cmake:82 (message):
Sanitizers for target myexecutable may not be usable, because it uses no or an
unknown compiler. This is a false warning for targets using only object
lib(s) as input.
Call Stack (most recent call first):
CMakeLists.txt:35 (add_sanitizers)
I'm pretty new to "modern" CMake and I don't know how to get around this. Maybe the compiler flags added by sanitizer_add_flags need to be generator expressions that get evaluated at generation time?
gunslingerfry, keichi and saxbophone
Metadata
Metadata
Assignees
Labels
No labels