My project adds 3rd party dependencies via FetchContent_Declare:
FetchContent_Declare(
mbedtls
GIT_REPOSITORY https://github.com/Mbed-TLS/mbedtls
GIT_TAG v3.6.5)
FetchContent_MakeAvailable(mbedtls)
add_library(exampleProj main.cpp)
target_link_libraries(exampleProj PUBLIC mbedtls)
add_library(exampleProj_sanitizers INTERFACE)
myproject_enable_sanitizers(exampleProj_sanitizers ON ON ON OFF OFF)
target_link_libraries(exampleProj PUBLIC exampleProj_sanitizers)
As you can see, myproject_enable_sanitizers only allows me to enable sanitizers for my own code, not for 3rd-party dependencies.
I don't think this is entirely correct. Sanitizers should be used for all code.
My project adds 3rd party dependencies via
FetchContent_Declare:As you can see,
myproject_enable_sanitizersonly allows me to enable sanitizers for my own code, not for 3rd-party dependencies.I don't think this is entirely correct. Sanitizers should be used for all code.