diff options
Diffstat (limited to 'src/nvim/CMakeLists.txt')
-rwxr-xr-x | src/nvim/CMakeLists.txt | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 7b56af59da..62b661dc2d 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -219,34 +219,6 @@ endif() list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${TreeSitter_INCLUDE_DIRS}") list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${TreeSitter_LIBRARIES}") -# 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 -int -main(void) -{ - return 0; -} -" HAS_ACCEPTABLE_FORTIFY) - -if(NOT HAS_ACCEPTABLE_FORTIFY) - message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1") - # Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE). - string(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}") - string(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" ) - if(NOT _FORTIFY_SOURCE_PREFIX STREQUAL "") - message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}") - endif() - # -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} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1") -endif() - target_compile_definitions(main_lib INTERFACE INCLUDE_GENERATED_DECLARATIONS) # Remove --sort-common from linker flags, as this seems to cause bugs (see #2641, #3374). |