From 02e693bec2ca32ac9267391973c8389e8d39ccb5 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Wed, 1 Dec 2021 16:04:18 -0600 Subject: [PATCH] fix: make cmake sanitizer inclusion optional as it breaks the feature_summary function Hopefully this will be fixed in https://github.com/arsenm/sanitizers-cmake/pull/18 --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 4 ---- src/qt-ui/CMakeLists.txt | 9 ++++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb2a5c1..6704ccb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE ) +option(ENABLE_SANITIZERS "Enable builds using sanitizers" off) + # include external libraries add_subdirectory(lib) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5f95882..91deec7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.2) set(CMAKE_POSITION_INDEPENDENT_CODE true) -# add support for sanitizers -set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/lib/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH}) -find_package(Sanitizers REQUIRED) - # required to link to correct thread library find_package(Threads REQUIRED) find_package(X11 REQUIRED) diff --git a/src/qt-ui/CMakeLists.txt b/src/qt-ui/CMakeLists.txt index aa867f7..69ba21a 100644 --- a/src/qt-ui/CMakeLists.txt +++ b/src/qt-ui/CMakeLists.txt @@ -37,7 +37,14 @@ target_compile_definitions(libappimageupdate-qt_static PRIVATE -DQT_UI) # Qt GUI application add_executable(AppImageUpdate main.cpp) -add_sanitizers(AppImageUpdate) + +if (ENABLE_SANITIZERS) + # add support for sanitizers. Partially broken: fix at https://github.com/arsenm/sanitizers-cmake/pull/18 + set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/lib/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH}) + find_package(Sanitizers REQUIRED) + + add_sanitizers(AppImageUpdate) +endif (ENABLE_SANITIZERS) # link libraries target_link_libraries(AppImageUpdate libappimageupdate libappimageupdate-qt)