File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,9 +89,15 @@ else(MSVC)
8989endif (MSVC )
9090
9191if (DEFINED POCO_SANITIZEFLAGS AND NOT "${POCO_SANITIZEFLAGS} " STREQUAL "" )
92- message (STATUS "Using sanitize flags: ${POCO_SANITIZEFLAGS} " )
93- add_compile_options (${POCO_SANITIZEFLAGS} )
94- add_link_options (${POCO_SANITIZEFLAGS} )
92+ # separate_arguments splits the space-separated string into individual
93+ # tokens. Passing the raw variable to add_compile_options would treat a
94+ # multi-flag value (e.g. "-fsanitize=undefined -fno-sanitize=vptr") as a
95+ # single argument, which the compiler rejects; CMake only splits on ';'.
96+ separate_arguments (_poco_san_flags UNIX_COMMAND "${POCO_SANITIZEFLAGS} " )
97+ message (STATUS "Using sanitize flags: ${_poco_san_flags} " )
98+ add_compile_options (${_poco_san_flags} )
99+ add_link_options (${_poco_san_flags} )
100+ unset (_poco_san_flags)
95101endif ()
96102
97103#################################################################################
You can’t perform that action at this time.
0 commit comments