diff options
Diffstat (limited to 'cmake/QtConfig.cmake.in')
-rw-r--r-- | cmake/QtConfig.cmake.in | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index b0b4dd3a82..cc3b2d7fce 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -66,6 +66,20 @@ if(NOT DEFINED QT_CMAKE_EXPORT_NAMESPACE) set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@) endif() +# Propagate sanitizer flags to both internal Qt builds and user projects. +# Allow opt-out in case if downstream projects handle it in a different way. +set(QT_CONFIGURED_SANITIZER_OPTIONS "@ECM_ENABLE_SANITIZERS@") + +if(QT_CONFIGURED_SANITIZER_OPTIONS + AND NOT __qt_sanitizer_options_set + AND NOT QT_NO_ADD_SANITIZER_OPTIONS) + set(ECM_ENABLE_SANITIZERS "${QT_CONFIGURED_SANITIZER_OPTIONS}") + include( + "${CMAKE_CURRENT_LIST_DIR}/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake") +endif() +# Mark that the current directory scope has its sanitizer flags set. +set(__qt_sanitizer_options_set TRUE) + # Find required dependencies, if any. include(CMakeFindDependencyMacro) if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Dependencies.cmake") |