add_definitions(-D_LIBCPP_DEBUG2=0)# Additional checks such as index out of bounds in vectors in libc++; might
# be removed at any point from libc++.
...
...
@@ -109,6 +106,17 @@ else()
message(FATAL_ERROR "Sorry, your compiler family wasn't recognized. If CMake has updated its flag, please modify the cmake/Compiler.cmake file in MoReFEM accoerdingly. See CMAKE_LANG_COMPILER_ID in CMake tutorial to find out the valid options.")
endif()
if(${MOREFEM_DO_SANITIZE})
add_cxx_compiler_flag("-fno-omit-frame-pointer")
add_cxx_compiler_flag("-fsanitize=address")
add_cxx_compiler_flag("-fsanitize=leak")
if(LIBRARY_TYPE MATCHES SHARED)# See limitations on https://clang.llvm.org/docs/MemorySanitizer.html
@@ -9,6 +9,9 @@ set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard; at least 17 is expected.")
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE STRING "Leave this one active.")
set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "If ON you might be using gnu++17; with OFF you'll use c++17.")
set(MOREFEM_DO_SANITIZE False CACHE BOOL "If true, sanitizer options -fsanitize=address, -fsanitize=memory and -fno-omit-frame-pointer are added.")
set(LIBRARY_TYPE STATIC CACHE BOOL "Choose either STATIC or SHARED.")
set(BUILD_MOREFEM_UNIQUE_LIBRARY True CACHE BOOL "Whether a unique library is built for MoReFEM core libraries or on the contrary if it is splitted in modules.")
@@ -9,6 +9,8 @@ set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard; at least 17 is expected.")
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE STRING "Leave this one active.")
set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "If ON you might be using gnu++17; with OFF you'll use c++17.")
set(MOREFEM_DO_SANITIZE False CACHE BOOL "If true, sanitizer options -fsanitize=address, -fsanitize=memory and -fno-omit-frame-pointer are added.")
set(LIBRARY_TYPE STATIC CACHE BOOL "Choose either STATIC or SHARED.")
set(BUILD_MOREFEM_UNIQUE_LIBRARY False CACHE BOOL "Whether a unique library is built for MoReFEM core libraries or on the contrary if it is splitted in modules.")