CMake: Handle EXTRA_CFLAGS w/o add_compile_options(). [skip ci]

Same as in libpcap commit 29d7856.
This commit is contained in:
Denis Ovsienko 2021-07-31 21:35:17 +01:00
parent d423316ce1
commit cae0c65013

View File

@ -924,8 +924,9 @@ endif()
# usage: cmake -DEXTRA_CFLAGS='-Wall -Wextra -Werror' ...
#
if(NOT "${EXTRA_CFLAGS}" STREQUAL "")
string(REPLACE " " ";" _extra_cflags_list ${EXTRA_CFLAGS})
add_compile_options(${_extra_cflags_list})
foreach(_extra_cflag ${EXTRA_CFLAGS})
check_and_add_compiler_option(_extra_cflag)
endforeach(_extra_cflag)
message(STATUS "Added extra compile options (${EXTRA_CFLAGS})")
endif()