Skip to content

Enable sanitizers globally #140

@PolarGoose

Description

@PolarGoose

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions