Cmake build:Amend 44bbd0b0 and 22f59925

44bbd0b0: Get full version of gcc
22f59925: Remove support for gcc 4.6

Also Remove support for msvc without STD_REGEX
This commit is contained in:
Kornel Benko 2019-06-13 09:18:40 +02:00
parent 44bbd0b0ef
commit 6f2cd26103

View File

@ -283,15 +283,17 @@ if(UNIX OR MINGW)
set(LYX_USE_STD_REGEX 0) set(LYX_USE_STD_REGEX 0)
endif() endif()
else() else()
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion OUTPUT_VARIABLE GCC_VERSION ERROR_VARIABLE _error RESULT_VARIABLE _err OUTPUT_STRIP_TRAILING_WHITESPACE)
#message(STATUS "dumpfullversion: error = ${_error}, result = ${_err}")
if (_err)
# previous check failed, try again with _old_ parameter
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION ERROR_VARIABLE _error RESULT_VARIABLE _err OUTPUT_STRIP_TRAILING_WHITESPACE)
#message(STATUS "dumpversion: error = ${_error}, result = ${_err}")
endif()
message(STATUS "Using GCC version ${GCC_VERSION}") message(STATUS "Using GCC version ${GCC_VERSION}")
if(GCC_VERSION VERSION_LESS 4.9) if(GCC_VERSION VERSION_LESS 4.9)
if(GCC_VERSION VERSION_LESS 4.6) # Drop support for gcc versions prior to 4.9
message(FATAL_ERROR "gcc >= 4.6 is required.") message(FATAL_ERROR "gcc >= 4.9 is required.")
endif()
# <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() else()
set(LYX_USE_STD_REGEX 1) set(LYX_USE_STD_REGEX 1)
endif() endif()
@ -299,6 +301,8 @@ if(UNIX OR MINGW)
set(LYX_GCC11_MODE "${CXX11_FLAG}") set(LYX_GCC11_MODE "${CXX11_FLAG}")
else() else()
if(MSVC_VERSION LESS 1915) if(MSVC_VERSION LESS 1915)
# Drop support for msvc versions prior to 1915
message(FATAL_ERROR "msvc >= 1915 is required.")
set(LYX_USE_STD_REGEX 0) set(LYX_USE_STD_REGEX 0)
else() else()
set(LYX_USE_STD_REGEX 1) set(LYX_USE_STD_REGEX 1)