2021-02-08 21:54:40 +00:00
|
|
|
target_compile_options(zm-warning-interface
|
|
|
|
INTERFACE
|
2021-02-27 01:08:14 +00:00
|
|
|
-Wall
|
2021-04-07 15:01:46 +00:00
|
|
|
$<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,5.0>:-Wconditionally-supported>
|
2021-02-27 01:08:14 +00:00
|
|
|
-Wextra
|
2021-03-05 21:24:33 +00:00
|
|
|
-Wformat-security
|
2021-02-27 01:08:14 +00:00
|
|
|
-Wno-cast-function-type
|
2021-04-19 21:06:54 +00:00
|
|
|
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,11>:-Wno-clobbered>
|
2021-05-23 23:15:00 +00:00
|
|
|
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,5.1>:-Wno-missing-field-initializers>
|
2021-04-10 23:18:00 +00:00
|
|
|
-Wno-unused-parameter
|
2021-04-25 21:52:32 +00:00
|
|
|
-Woverloaded-virtual
|
|
|
|
-Wvla)
|
2021-02-08 22:07:21 +00:00
|
|
|
|
2021-04-29 22:13:32 +00:00
|
|
|
if(ENABLE_WERROR)
|
|
|
|
target_compile_options(zm-warning-interface
|
|
|
|
INTERFACE
|
|
|
|
-Werror)
|
|
|
|
endif()
|
|
|
|
|
2021-02-08 22:07:21 +00:00
|
|
|
if(ASAN)
|
|
|
|
target_compile_options(zm-compile-option-interface
|
|
|
|
INTERFACE
|
2021-05-29 17:55:17 +00:00
|
|
|
-D_GLIBCXX_SANITIZE_VECTOR=1
|
2021-02-08 22:07:21 +00:00
|
|
|
-fno-omit-frame-pointer
|
|
|
|
-fsanitize=address
|
|
|
|
-fsanitize-recover=address
|
2021-05-27 22:08:46 +00:00
|
|
|
-fsanitize-address-use-after-scope
|
|
|
|
-Wno-stringop-truncation)
|
2021-02-08 22:07:21 +00:00
|
|
|
|
|
|
|
target_link_options(zm-compile-option-interface
|
|
|
|
INTERFACE
|
|
|
|
-fno-omit-frame-pointer
|
|
|
|
-fsanitize=address
|
|
|
|
-fsanitize-recover=address
|
|
|
|
-fsanitize-address-use-after-scope)
|
|
|
|
|
|
|
|
message(STATUS "GCC: Enabled AddressSanitizer (ASan)")
|
|
|
|
endif()
|
2021-02-10 23:38:31 +00:00
|
|
|
|
|
|
|
if(TSAN)
|
|
|
|
target_compile_options(zm-compile-option-interface
|
|
|
|
INTERFACE
|
|
|
|
-fsanitize=thread)
|
|
|
|
|
|
|
|
target_link_options(zm-compile-option-interface
|
|
|
|
INTERFACE
|
|
|
|
-fsanitize=thread)
|
|
|
|
|
|
|
|
message(STATUS "GCC: Enabled ThreadSanitizer (TSan)")
|
|
|
|
endif()
|