2021-02-09 05:54:40 +08:00
|
|
|
target_compile_options(zm-warning-interface
|
|
|
|
INTERFACE
|
2021-02-27 09:08:14 +08:00
|
|
|
-Wall
|
2021-04-07 23:01:46 +08:00
|
|
|
$<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,5.0>:-Wconditionally-supported>
|
2021-02-27 09:08:14 +08:00
|
|
|
-Wextra
|
2021-03-06 05:24:33 +08:00
|
|
|
-Wformat-security
|
2021-02-27 09:08:14 +08:00
|
|
|
-Wno-cast-function-type
|
2021-04-20 05:06:54 +08:00
|
|
|
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,11>:-Wno-clobbered>
|
2021-05-24 07:15:00 +08:00
|
|
|
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,5.1>:-Wno-missing-field-initializers>
|
2021-04-11 07:18:00 +08:00
|
|
|
-Wno-unused-parameter
|
2021-04-26 05:52:32 +08:00
|
|
|
-Woverloaded-virtual
|
|
|
|
-Wvla)
|
2021-02-09 06:07:21 +08:00
|
|
|
|
2021-04-30 06:13:32 +08:00
|
|
|
if(ENABLE_WERROR)
|
|
|
|
target_compile_options(zm-warning-interface
|
|
|
|
INTERFACE
|
|
|
|
-Werror)
|
|
|
|
endif()
|
|
|
|
|
2021-02-09 06:07:21 +08:00
|
|
|
if(ASAN)
|
|
|
|
target_compile_options(zm-compile-option-interface
|
|
|
|
INTERFACE
|
|
|
|
-fno-omit-frame-pointer
|
|
|
|
-fsanitize=address
|
|
|
|
-fsanitize-recover=address
|
|
|
|
-fsanitize-address-use-after-scope)
|
|
|
|
|
|
|
|
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-11 07:38:31 +08: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()
|