diff --git a/.idea/editor.xml b/.idea/editor.xml index 46540da..b0d69ef 100644 --- a/.idea/editor.xml +++ b/.idea/editor.xml @@ -1,6 +1,483 @@ - \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 7389c4f..1e39106 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,26 @@ cmake_minimum_required(VERSION 3.25) +macro(compile_options target_name) + target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wpedantic -Wno-comment) + target_link_options(${target_name} PRIVATE -Wall -Wextra -Wpedantic -Wno-comment) +endmacro() + +macro(sanitizers target_name) + if (${ENABLE_ADDRSAN} MATCHES ON) + target_compile_options(${target_name} PRIVATE -fsanitize=address) + target_link_options(${target_name} PRIVATE -fsanitize=address) + endif () + + if (${ENABLE_UBSAN} MATCHES ON) + target_compile_options(${target_name} PRIVATE -fsanitize=undefined) + target_link_options(${target_name} PRIVATE -fsanitize=undefined) + endif () + + if (${ENABLE_TSAN} MATCHES ON) + target_compile_options(${target_name} PRIVATE -fsanitize=thread) + target_link_options(${target_name} PRIVATE -fsanitize=thread) + endif () +endmacro() + project(blt-gp VERSION 0.2.1) include(CTest)