Am 08.12.2015 um 02:40 schrieb Kornel Benko:
Try this patch.
With a clean tree I applied the attached cmake patch. Now CXX11 is true
but I get many of these compilation errors:
"D:\LyXGit\Master\compile-2013\lyx.sln" (ALL_BUILD Ziel) (1) ->
"D:\LyXGit\Master\compile-2013\ALL_BUILD.vcxproj.metaproj"
(Standardziel) (2) ->
"D:\LyXGit\Master\compile-2013\src\LyX.vcxproj.metaproj" (Standardziel)
(3) ->
"D:\LyXGit\Master\compile-2013\src\mathed\mathed.vcxproj.metaproj"
(Standardziel) (17) ->
"D:\LyXGit\Master\compile-2013\src\mathed\mathed.vcxproj" (Standardziel)
(18) -> D:\LyXGit\Master\src\mathed\InsetMathBox.cpp(236): error C2039:
'max' : is not a member of 'std'
[D:\LyXGit\Master\compile-2013\src\mathed\mathed.vcxproj]
D:\LyXGit\Master\src\mathed\InsetMathBox.cpp(236): error C3861:
'max': identifier not found
[D:\LyXGit\Master\compile-2013\src\mathed\mathed.vcxproj]
So the only solution for me is the attached patch "MSVC-solution".
Apparently MSVC 2013 can compile with std_regex without problems but it
cannot compile if cxx11 is enabled. Therefore we must allow std_regex
for MSVC independent of Cxx11.
regards Uwe
diff --git
"a/C:\\Users\\Usti\\AppData\\Local\\Temp\\TortoiseGit\\CMaAE0D.tmp\\CMakeLists-d4da5e9-left.txt"
"b/D:\\LyXGit\\Master\\CMakeLists.txt"
index 5840ad0..f5d2e4e 100644
---
"a/C:\\Users\\Usti\\AppData\\Local\\Temp\\TortoiseGit\\CMaAE0D.tmp\\CMakeLists-d4da5e9-left.txt"
+++ "b/D:\\LyXGit\\Master\\CMakeLists.txt"
@@ -269,9 +269,14 @@ if(UNIX OR MINGW)
endif()
else()
set(LYX_USE_STD_REGEX 0)
-# if(MSVC10)
-# set(LYX_USE_STD_REGEX 1) #TODO should we use it in ECMAScript
mode?
-# endif()
+ if (MSVC)
+ if(MSVC_VERSION GREATER 1799)
+ # Microsoft Visual Studio 2013 and newer, e.g. MSVC12 and MSVC14
+ set(LYX_USE_STD_REGEX 1)
+ set(LYX_USE_CXX11 1)
+ set(CXX11_FLAG "")
+ endif()
+ endif()
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5840ad0..68aad9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,9 +269,14 @@ if(UNIX OR MINGW)
endif()
else()
set(LYX_USE_STD_REGEX 0)
-# if(MSVC10)
-# set(LYX_USE_STD_REGEX 1) #TODO should we use it in ECMAScript
mode?
-# endif()
+ if (MSVC)
+ if(MSVC_VERSION GREATER 1799)
+ # Microsoft Visual Studio 2013 and newer, e.g. MSVC12 and MSVC14
+ set(LYX_USE_STD_REGEX 1)
+ #set(LYX_USE_CXX11 1)
+ #set(CXX11_FLAG "")
+ endif()
+ endif()
endif()
diff --git a/src/support/regex.h b/src/support/regex.h
index fd6f1e5..c99fd78 100644
--- a/src/support/regex.h
+++ b/src/support/regex.h
@@ -12,7 +12,7 @@
#ifndef LYX_REGEXP_H
#define LYX_REGEXP_H
-#if defined(LYX_USE_CXX11) && defined(LYX_USE_STD_REGEX)
+#if defined(LYX_USE_STD_REGEX) // && defined(LYX_USE_CXX11)
# include <regex>
// <regex> in gcc is unusable in versions less than 4.9.0
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631