diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 19c81ffcbe..409face71c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,14 @@ endif() option(ENABLE_LIBINTL "enable libintl" ON) option(ENABLE_LIBICONV "enable libiconv" ON) -option(ENABLE_LTO "enable link time optimization" ON) +if (MINGW) + # Disable LTO by default as it may not compile + # See https://github.com/Alexpux/MINGW-packages/issues/3516 + # and https://github.com/neovim/neovim/pull/8654#issuecomment-402316672 + option(ENABLE_LTO "enable link time optimization" OFF) +else() + option(ENABLE_LTO "enable link time optimization" ON) +endif() message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") @@ -315,6 +322,10 @@ else() endif() endif() +if(MINGW) + # Use POSIX compatible stdio in Mingw + add_definitions(-D__USE_MINGW_ANSI_STDIO) +endif() if(WIN32) # Windows Vista is the minimum supported version add_definitions(-D_WIN32_WINNT=0x0600) |