File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ${PY3LM_LINK_LIBRARIES})
7171
7272if (MSVC )
7373 target_compile_options (${PROJECT_NAME} PRIVATE /W4 /WX /Zc:preprocessor $<$<CONFIG:Release>:/Zi>)
74+ target_link_options (${PROJECT_NAME} PRIVATE $<$<CONFIG:Release>:/DEBUG /OPT:REF /OPT:ICF>)
7475else ()
7576 target_compile_options (${PROJECT_NAME} PRIVATE -Wextra -Wconversion -Werror -Wshadow -Wpedantic $<$<CONFIG:Release>:-g1>)
7677endif ()
@@ -82,10 +83,15 @@ elseif(UNIX)
8283 target_link_options (${PROJECT_NAME} PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR} /sym/version_script.lds" )
8384endif ()
8485
85- if (PLUGIFY_HAS_SANITIZER )
86+ if (PLUGIFY_USE_SANITIZER )
8687 # https://github.com/llvm/llvm-project/pull/121228
87- target_compile_options (${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: -fsanitize=address -fno-omit-frame-pointer>) # -fsanitize=undefined
88- target_link_libraries (${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: -fsanitize=address -fno-omit-frame-pointer>) # -fsanitize=undefined
88+ if (MSVC )
89+ target_compile_options (${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: /fsanitize=address>)
90+ target_compile_definitions (${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: _DISABLE_VECTOR_ANNOTATION>)
91+ else ()
92+ target_compile_options (${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: -fsanitize=address -fsanitize=leak>) # -fsanitize=undefined disabled
93+ target_link_libraries (${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: -fsanitize=address -fsanitize=leak>) # -fsanitize=undefined disabled
94+ endif ()
8995endif ()
9096
9197include (GenerateExportHeader)
You can’t perform that action at this time.
0 commit comments