cmake: Remove duplicate compile flags argument (#13920)

${C_FLAGS_ARRAY} is already part of ${gen_cflags} and does not
need to be passed explicitly.

Passing it a second time leads to macro redefinition warnings when
-D_FORTIFY_SOURCE=2 is given as part of CFLAGS because Neovim
enforces -D_FORTIFY_SOURCE=1.
This commit is contained in:
Florian Walch 2021-02-11 18:37:41 +01:00 committed by GitHub
parent 1aec5ba85e
commit 393095c1c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,7 +284,7 @@ foreach(sfile ${NVIM_SOURCES}
endif() endif()
add_custom_command( add_custom_command(
OUTPUT "${gf_c_h}" "${gf_h_h}" OUTPUT "${gf_c_h}" "${gf_h_h}"
COMMAND ${CMAKE_C_COMPILER} ${sfile} ${PREPROC_OUTPUT} ${gen_cflags} ${C_FLAGS_ARRAY} COMMAND ${CMAKE_C_COMPILER} ${sfile} ${PREPROC_OUTPUT} ${gen_cflags}
COMMAND "${LUA_PRG}" "${HEADER_GENERATOR}" "${sfile}" "${gf_c_h}" "${gf_h_h}" "${gf_i}" COMMAND "${LUA_PRG}" "${HEADER_GENERATOR}" "${sfile}" "${gf_c_h}" "${gf_h_h}" "${gf_i}"
DEPENDS ${depends}) DEPENDS ${depends})
list(APPEND NVIM_GENERATED_FOR_SOURCES "${gf_c_h}") list(APPEND NVIM_GENERATED_FOR_SOURCES "${gf_c_h}")