mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Set C++11 option defaulting to 'AUTO' as it is on autotools too.
Nothing changes for already cached values. With fresh build-dir and in 'AUTO'-mode we try to determine if the c++ compiler is able to use this feature.
This commit is contained in:
parent
53d911b35d
commit
a413d667ca
@ -140,6 +140,7 @@ LYX_OPTION(ENABLE_EXPORT_TESTS "Enable for export tests" OFF ALL)
|
||||
LYX_OPTION(ASAN "Use address sanitizer" OFF ALL)
|
||||
LYX_COMBO(USE_QT "Use Qt version as frontend" QT4 QT5)
|
||||
LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL)
|
||||
LYX_COMBO(ENABLE_CXX11 "Build with options for c++11-mode" AUTO ON OFF)
|
||||
|
||||
# GCC specific
|
||||
LYX_OPTION(PROFILE "Build profile version" OFF GCC)
|
||||
@ -149,7 +150,6 @@ LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF GCC)
|
||||
LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++ pedantic debug mode" OFF GCC)
|
||||
LYX_OPTION(STDLIB_DEBUG "Use debug stdlib" OFF GCC)
|
||||
LYX_OPTION(PROFILE "Build with options for gprof" OFF GCC)
|
||||
LYX_OPTION(ENABLE_CXX11 "Build with options for c++11-mode" OFF GCC)
|
||||
|
||||
# MSVC specific
|
||||
LYX_OPTION(CONSOLE "Show console on Windows, enforce with =FORCE" ON MSVC)
|
||||
@ -252,6 +252,29 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
if(LYX_ENABLE_CXX11 MATCHES "AUTO")
|
||||
# Set to some meaningful default
|
||||
find_package(CXX11Compiler)
|
||||
if(NOT CXX11COMPILER_FOUND)
|
||||
set(LYX_ENABLE_CXX11 OFF CACHE TYPE STRING FORCE)
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT GCC_VERSION VERSION_LESS 4.3)
|
||||
set(LYX_ENABLE_CXX11 ON CACHE TYPE STRING FORCE)
|
||||
else()
|
||||
set(LYX_ENABLE_CXX11 OFF CACHE TYPE STRING FORCE)
|
||||
endif()
|
||||
else()
|
||||
# Not a gnu compiler
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$")
|
||||
set(LYX_ENABLE_CXX11 ON CACHE TYPE STRING FORCE)
|
||||
else()
|
||||
set(LYX_ENABLE_CXX11 OFF CACHE TYPE STRING FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(LYX_GCC11_MODE)
|
||||
if(UNIX OR MINGW)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
@ -106,7 +106,7 @@ cmake $lyxsrcdir \
|
||||
-DLYX_XMINGW=$compiler \
|
||||
-DLYX_USE_QT=QT5 \
|
||||
-DLYX_QUIET=1 \
|
||||
-DLYX_ENABLE_CXX11=1 \
|
||||
-DLYX_ENABLE_CXX11=ON \
|
||||
-DLYX_HUNSPELL=1 \
|
||||
-DLYX_3RDPARTY_BUILD=1 \
|
||||
$pch $mergefile
|
||||
|
Loading…
Reference in New Issue
Block a user