set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope")
if (COMPILER_GCC)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libasan")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libasan")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan")
endif ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} ${MSAN_FLAGS}")
if (COMPILER_GCC)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libmsan")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libmsan")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libmsan")
endif ()
elseif (SANITIZE STREQUAL "undefined")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if (COMPILER_GCC)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libubsan")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libubsan")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined")
- endif()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libubsan")
endif ()