Update CMake for minimum GCC version: 4.9

This commit is contained in:
Yuriy Skalko 2020-11-25 00:00:28 +02:00
parent fdefff1108
commit b4b2d01ea7

View File

@ -77,9 +77,9 @@ if(NOT help AND NOT HELP)
# 'project' triggers the searching for a compiler # 'project' triggers the searching for a compiler
project(${LYX_PROJECT}) project(${LYX_PROJECT})
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}") message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "is too old, should be >= 4.0") message(STATUS "is too old, should be >= 4.9")
message(FATAL_ERROR "Exiting") message(FATAL_ERROR "Exiting")
endif() endif()
endif() endif()
@ -396,25 +396,18 @@ if(UNIX OR MINGW)
#message(STATUS "dumpversion: error = ${_error}, result = ${_err}") #message(STATUS "dumpversion: error = ${_error}, result = ${_err}")
endif() endif()
message(STATUS "Using GCC version ${GCC_VERSION}") message(STATUS "Using GCC version ${GCC_VERSION}")
if(GCC_VERSION VERSION_LESS 4.6) if(GCC_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "gcc >= 4.6 is required.") message(FATAL_ERROR "gcc >= 4.9 is required.")
elseif(GCC_VERSION VERSION_LESS 4.9)
# <regex> in gcc is unusable in versions less than 4.9.0
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631
set(LYX_USE_STD_REGEX 0)
else()
set(LYX_USE_STD_REGEX 1)
endif() endif()
set(LYX_USE_STD_REGEX 1)
endif() endif()
set(LYX_GCC11_MODE "${CXX11_FLAG}") set(LYX_GCC11_MODE "${CXX11_FLAG}")
else() else()
if(MSVC_VERSION LESS 1900) if(MSVC_VERSION LESS 1900)
# Drop support for msvc versions prior to 1900 (Visual Studio 2015) # Drop support for msvc versions prior to 1900 (Visual Studio 2015)
message(FATAL_ERROR "Visual Studio >= 2015 is required.") message(FATAL_ERROR "Visual Studio >= 2015 is required.")
set(LYX_USE_STD_REGEX 0)
else()
set(LYX_USE_STD_REGEX 1)
endif() endif()
set(LYX_USE_STD_REGEX 1)
endif() endif()
if(LYX_3RDPARTY_BUILD) if(LYX_3RDPARTY_BUILD)