Cmake build: Adapt detection of C++11 mode to automake

This commit is contained in:
Kornel Benko 2015-09-03 11:15:10 +02:00
parent 67385e69fc
commit 46d2344902
2 changed files with 7 additions and 3 deletions

View File

@ -70,7 +70,11 @@
// use GNU c++11 extensions // use GNU c++11 extensions
#cmakedefine LYX_USE_CXX11 1 #cmakedefine LYX_USE_CXX11 1
#ifndef LYX_USE_CXX11
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#error "Conflicting defines of LYX_USE_CXX11"
#endif
#endif
#cmakedefine Z_PREFIX 1 #cmakedefine Z_PREFIX 1
${Include_used_spellchecker} ${Include_used_spellchecker}

View File

@ -35,11 +35,11 @@ INCLUDE(CheckCXXSourceCompiles)
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$") if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$")
set(CXX11_FLAG_CANDIDATES "--std=c++11") set(CXX11_FLAG_CANDIDATES "--std=c++11 -Wno-deprecated-register")
else() else()
set(CXX11_FLAG_CANDIDATES set(CXX11_FLAG_CANDIDATES
"--std=gnu++11"
"--std=c++11" "--std=c++11"
"--std=gnu++11"
"--std=gnu++0x" "--std=gnu++0x"
) )
endif() endif()