Skip to content

Commit

Permalink
fix: make cmake sanitizer inclusion optional as it breaks the feature…
Browse files Browse the repository at this point in the history
…_summary function

Hopefully this will be fixed in arsenm/sanitizers-cmake#18
  • Loading branch information
azubieta committed Dec 2, 2021
1 parent 1b97acc commit 02e693b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

option(ENABLE_SANITIZERS "Enable builds using sanitizers" off)

# include external libraries
add_subdirectory(lib)

Expand Down
4 changes: 0 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion src/qt-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 02e693b

Please sign in to comment.