Skip to content

Enable sanitizers globally #140

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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