fix cmake

This commit is contained in:
Bechir Braham 2024-03-20 17:38:01 +01:00
parent c1ddb84bc0
commit 72e3b58c09
No known key found for this signature in database
GPG Key ID: 7F511B55FD8E9671
2 changed files with 33 additions and 31 deletions

View File

@ -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()

View File

@ -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