From 5f1e4418deb1739dc0244602332265ed28f79f74 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 20 Sep 2022 00:06:10 -0700 Subject: [PATCH] Sanitize: Add sanitize flags to shared libraries For MSVC, all libraries need to have the same flags, therefore we add them here. Change-Id: If980ca138dfde0a5ec52b1879c2c703309950a37 Reviewed-by: Eike Ziller --- src/shared/qtlockedfile/CMakeLists.txt | 4 ++++ src/shared/qtsingleapplication/CMakeLists.txt | 4 ++++ src/shared/registryaccess/CMakeLists.txt | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/shared/qtlockedfile/CMakeLists.txt b/src/shared/qtlockedfile/CMakeLists.txt index 5386c7c9627..aafb38497ff 100644 --- a/src/shared/qtlockedfile/CMakeLists.txt +++ b/src/shared/qtlockedfile/CMakeLists.txt @@ -11,3 +11,7 @@ if (WIN32) target_compile_definitions(shared_qtlockedfile PRIVATE "QT_QTLOCKEDFILE_EXPORT=__declspec(dllexport)" _UNICODE UNICODE) endif() + +if (WITH_SANITIZE) + qtc_enable_sanitize(shared_qtlockedfile ${SANITIZE_FLAGS}) +endif() diff --git a/src/shared/qtsingleapplication/CMakeLists.txt b/src/shared/qtsingleapplication/CMakeLists.txt index b31f8f93ed6..b60ee27f94c 100644 --- a/src/shared/qtsingleapplication/CMakeLists.txt +++ b/src/shared/qtsingleapplication/CMakeLists.txt @@ -7,3 +7,7 @@ target_include_directories(shared_qtsingleapplication PUBLIC "${CMAKE_CURRENT_SO if (WIN32) target_compile_definitions(shared_qtsingleapplication PRIVATE "QT_QTSINGLEAPPLICATION_EXPORT=__declspec(dllexport)") endif() + +if (WITH_SANITIZE) + qtc_enable_sanitize(shared_qtsingleapplication ${SANITIZE_FLAGS}) +endif() diff --git a/src/shared/registryaccess/CMakeLists.txt b/src/shared/registryaccess/CMakeLists.txt index e289a0ba157..1a7d190cf52 100644 --- a/src/shared/registryaccess/CMakeLists.txt +++ b/src/shared/registryaccess/CMakeLists.txt @@ -6,3 +6,7 @@ if (WIN32) else() add_library(registryaccess INTERFACE) endif() + +if (WITH_SANITIZE) + qtc_enable_sanitize(registryaccess ${SANITIZE_FLAGS}) +endif()