mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
CMake: Add #include in _FORTIFY_SOURCE check. #4214
Some toolchains apparently set _FORTIFY_SOURCE=2 in internal header files. Include <string.h> (which in turn should include such internal header files) before checking the value of _FORTIFY_SOURCE to catch that. Fixes #4183.
This commit is contained in:
parent
dcdb50b64b
commit
e7615ddc22
@ -153,7 +153,11 @@ if(${INIT_FLAGS_NAME})
|
||||
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
|
||||
endif()
|
||||
|
||||
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
|
||||
# internal header files, which should in turn be #included by <string.h>.
|
||||
check_c_source_compiles("
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
|
||||
#error \"_FORTIFY_SOURCE > 1\"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user