[LyX/master] Add default TransformID enum value

Yuriy Skalko yuriy.skalko at gmail.com
Wed Nov 25 21:30:47 UTC 2020


> 1/ I do not know cmake, but it is strange that you still have code after a FATAL_ERROR
> 

It is not my favorite language too, and I should not take later checking 
of MSVC compiler as a template. Corrected it in both places.

Seems like std::regex was already always used for most recent compilers, 
so how about getting rid of boost::regex (I've already sent a patch 
earlier)?

> 
> 2/ fine
> 
> 3/ thanks for spotting it
> 
> 4/ fine.
> 
> JMarc

Committed these.

Yuriy
-------------- next part --------------
From f6e5c1ba01d5dc6ddb5488fe2d41ba4a6b6e127e Mon Sep 17 00:00:00 2001
From: Yuriy Skalko <yuriy.skalko at gmail.com>
Date: Wed, 25 Nov 2020 00:00:28 +0200
Subject: [PATCH] Update CMake for minimum GCC version: 4.9

---
 CMakeLists.txt | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0e6a6482f..53109465ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,9 +77,9 @@ if(NOT help AND NOT HELP)
   # 'project' triggers the searching for a compiler
   project(${LYX_PROJECT})
   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 "is too old, should be >= 4.0")
+      message(STATUS "is too old, should be >= 4.9")
       message(FATAL_ERROR "Exiting")
     endif()
   endif()
@@ -396,25 +396,18 @@ if(UNIX OR MINGW)
 	    #message(STATUS "dumpversion: error = ${_error}, result = ${_err}")
 	  endif()
 	  message(STATUS "Using GCC version ${GCC_VERSION}")
-	  if(GCC_VERSION VERSION_LESS 4.6)
-		message(FATAL_ERROR "gcc >= 4.6 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)
+	  if(GCC_VERSION VERSION_LESS 4.9)
+		message(FATAL_ERROR "gcc >= 4.9 is required.")
 	  endif()
+	  set(LYX_USE_STD_REGEX 1)
 	endif()
 	set(LYX_GCC11_MODE "${CXX11_FLAG}")
 else()
 	if(MSVC_VERSION LESS 1900)
 		# Drop support for msvc versions prior to 1900 (Visual Studio 2015)
 		message(FATAL_ERROR "Visual Studio >= 2015 is required.")
-		set(LYX_USE_STD_REGEX 0)
-	else()
-		set(LYX_USE_STD_REGEX 1)
 	endif()
+	set(LYX_USE_STD_REGEX 1)
 endif()
 
 if(LYX_3RDPARTY_BUILD)
-- 
2.28.0.windows.1



More information about the lyx-devel mailing list