mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
build: turn down the _FORTIFY_SOURCE level on gcc >= 4.0
This commit is contained in:
@@ -42,6 +42,16 @@ if(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently
|
||||||
|
# does not work with Neovim due to some uses of dynamically-sized structures.
|
||||||
|
# See https://github.com/neovim/neovim/issues/223 for details.
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "4")
|
||||||
|
# -U in add_definitions doesn't end up in the correct spot, so we add it to
|
||||||
|
# the flags variable instead.
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -std=gnu99)
|
-Wstrict-prototypes -std=gnu99)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user