default LTO to OFF on 64 bit MinGW

64 bit MinGW (e.g. msys2 64 bit) produces a binary that immediately
segfaults when built with LTO.

Make ENABLE_LTO default to OFF on 64 bit MinGW (32 bit will still
default to ON.)
This commit is contained in:
Rafael Kitover 2017-09-22 00:42:49 -07:00
parent 75ef0aa26d
commit f069f0c02d
1 changed files with 2 additions and 2 deletions

View File

@ -79,8 +79,8 @@ option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT})
SET(LTO_DEFAULT ON)
IF(WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
# lto produces buggy binaries on gcc < 7 on win32
IF(WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND AMD64)
# lto produces buggy binaries for 64 bit win32
SET(LTO_DEFAULT OFF)
ENDIF()