From cca9c5249dfb60db4a73f8732424c1602104b278 Mon Sep 17 00:00:00 2001 From: Bechir Braham Date: Wed, 20 Mar 2024 17:38:01 +0100 Subject: [PATCH] fix cmake --- CMakeLists.txt | 57 +++++++++++++++++++++--------------------- file_io/CMakeLists.txt | 7 ++++-- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f112f6a..0b227b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,34 @@ else() -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC ) + + if (NOT AARE_PYTHON_BINDINGS) + target_compile_options( + aare_compiler_flags + INTERFACE + -fdiagnostics-parseable-fixits + -fdiagnostics-generate-patch + -fdiagnostics-show-template-tree + -fsanitize=address,undefined,pointer-compare + -fno-sanitize-recover + # -D_FORTIFY_SOURCE=2 # not needed for debug builds + # -fstack-protector # cause errors wih folly (ProducerConsumerQueue.hpp) + -fno-omit-frame-pointer + ) + + target_link_libraries( + aare_compiler_flags + INTERFACE + -fdiagnostics-parseable-fixits + -fdiagnostics-generate-patch + -fdiagnostics-show-template-tree + -fsanitize=address,undefined,pointer-compare + -fno-sanitize-recover + # -D_FORTIFY_SOURCE=2 + -fno-omit-frame-pointer + ) +endif() + endif() if(AARE_USE_WARNINGS) @@ -64,35 +92,6 @@ if(AARE_USE_WARNINGS) ) endif() -if (NOT AARE_PYTHON_BINDINGS) - target_compile_options( - aare_compiler_flags - INTERFACE - -fsanitize=address - -fdiagnostics-parseable-fixits - -fdiagnostics-generate-patch - -fdiagnostics-show-template-tree - -fsanitize=address,undefined,pointer-compare - -fno-sanitize-recover - -D_FORTIFY_SOURCE=2 - -fstack-protector - -fno-omit-frame-pointer - ) - - target_link_libraries( - aare_compiler_flags - INTERFACE - -fsanitize=address - -fdiagnostics-parseable-fixits - -fdiagnostics-generate-patch - -fdiagnostics-show-template-tree - -fsanitize=address,undefined,pointer-compare - -fno-sanitize-recover - -D_FORTIFY_SOURCE=2 - -fstack-protector - -fno-omit-frame-pointer - ) -endif() if(AARE_TESTS) add_subdirectory(tests) endif() diff --git a/file_io/CMakeLists.txt b/file_io/CMakeLists.txt index 8d65baa..474babd 100644 --- a/file_io/CMakeLists.txt +++ b/file_io/CMakeLists.txt @@ -1,5 +1,8 @@ -find_package(nlohmann_json 3.2.0 REQUIRED) - +FetchContent_Declare(json + GIT_REPOSITORY https://github.com/nlohmann/json + GIT_TAG v3.11.3 +) +FetchContent_MakeAvailable(json) set(SourceFiles ${CMAKE_CURRENT_SOURCE_DIR}/src/File.cpp