From 74814315514a9531f9db3ee4cb331fabad2dd608 Mon Sep 17 00:00:00 2001 From: CPunch Date: Sat, 29 Jan 2022 17:16:29 -0600 Subject: [PATCH] Misc. cmake refactoring --- CMakeLists.txt | 5 +++-- cmake-modules/FindASan.cmake | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c280dc..208f509 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules" ${CMAKE_MODULE_PATH}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) -find_package(Sanitizers) +#find_package(Sanitizers) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) @@ -21,7 +21,8 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} RAWCMAKEBUILDTYPE) message(STATUS "CMAKE_BUILD_TYPE: " ${RAWCMAKEBUILDTYPE}) if(RAWCMAKEBUILDTYPE STREQUAL "debug") message(STATUS "Adding sanitizer...") - add_sanitizers(LaikaLib LaikaBot LaikaCNC) + #set(SANITIZE_ADDRESS TRUE) + #add_sanitizers(LaikaLib LaikaBot LaikaCNC) # bug in FindSanitizer.cmake ??? idfk, i'll investigate l8tr add_compile_options(-fsanitize=address) diff --git a/cmake-modules/FindASan.cmake b/cmake-modules/FindASan.cmake index 98ea7cb..8b5301b 100644 --- a/cmake-modules/FindASan.cmake +++ b/cmake-modules/FindASan.cmake @@ -55,5 +55,6 @@ function (add_sanitize_address TARGET) return() endif () + message(STATUS "Adding ASAN for " ${TARGET} "") sanitizer_add_flags(${TARGET} "AddressSanitizer" "ASan") endfunction ()