Uwe Stöhr wrote: > Am 29.11.2015 um 22:30 schrieb Kornel Benko: > >> The problem may also be usage (respective non-usage) of --std=c++11. >> I already asked, what to do to allow MSVC to use this flag, but got no >> answer. ATM the windows compilation is probably without, setting the >> 'LYX_USE_CXX11' to 0 >> >> The changes could be built in >> development/cmake/modules/FindCXX11Compiler.cmake:37 ff The actual search >> is done at development/cmake/modules/FindCXX11Compiler.cmake:86 ff > > I would like to test this. Could you please send me a patch to be able > to test?
Please try this one. It assumes that you use the build.bat file to compile, if you don't, then you need to adjust the call of cmake accordingly. MSVC 2010 does not need any special flag to compile in C++11 mode, the limited subset of C++11 features that it supports is enabled by default. The only thing I am not 100% sure about is whether the supported subset is enough for LyX, but I believe it is. Georg
diff --git a/CMakeLists.txt b/CMakeLists.txt index a87b049..4194a76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,9 +265,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(MSVC10) + # MSVC 10 has limited C++11 support (which is enabled by default, no switch needed) + set(LYX_USE_STD_REGEX 1) + endif() + if(MSVC12) + # MSVC 12 has less limited C++11 support (which is enabled by default, no switch needed) + set(LYX_USE_STD_REGEX 1) + endif() endif() diff --git a/development/cmake/build.bat b/development/cmake/build.bat index 25baec0..4ff711a 100755 --- a/development/cmake/build.bat +++ b/development/cmake/build.bat @@ -82,14 +82,14 @@ if [%2]==[] ( if "%1%" == "devel" ( REM Build solution to develop LyX - cmake %LYX_SOURCE% -GNinja -G%USED_STUDIO% -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_INSTALL=0 -DLYX_RELEASE=0 -DLYX_CONSOLE=FORCE %DEPENDENCIES_DOWNLOAD% + cmake %LYX_SOURCE% -GNinja -G%USED_STUDIO% -DLYX_ENABLE_CXX11=ON -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_INSTALL=0 -DLYX_RELEASE=0 -DLYX_CONSOLE=FORCE %DEPENDENCIES_DOWNLOAD% msbuild lyx.sln /p:Configuration=Debug /t:LyX /t:tex2lyx ) if "%1%" == "install" ( REM Build solution to develop LyX REM set -DLYX_MERGE_REBUILD and -DLYX_MERGE_FILES to 1 for a version released with an installer - cmake %LYX_SOURCE% -G%USED_STUDIO% -DLYX_MERGE_REBUILD=0 -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_INSTALL=1 -DLYX_RELEASE=1 -DLYX_CONSOLE=OFF %DEPENDENCIES_DOWNLOAD% + cmake %LYX_SOURCE% -G%USED_STUDIO% -DLYX_ENABLE_CXX11=ON -DLYX_MERGE_REBUILD=0 -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_INSTALL=1 -DLYX_RELEASE=1 -DLYX_CONSOLE=OFF %DEPENDENCIES_DOWNLOAD% msbuild lyx.sln /p:Configuration=Release /t:ALL_BUILD msbuild INSTALL.vcxproj /p:Configuration=Release )