File tree Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0)
22set (CADABRA_CMAKE_VERSION 3.1)
33
44cmake_minimum_required (VERSION ${CADABRA_CMAKE_VERSION} )
5- set (CMAKE_CXX_STANDARD 14)
5+ if (${CMAKE_VERSION} VERSION_LESS "3.8.0" )
6+ set (CMAKE_CXX_STANDARD 14)
7+ message (STATUS "Using C++14 as you are using CMake < 3.8; consider upgrading as future versions of Cadabra may use C++17 features" )
8+ else ()
9+ set (CMAKE_CXX_STANDARD 17)
10+ endif ()
611project (Cadabra)
712
813if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
@@ -146,6 +151,8 @@ endif()
146151# - Turn optimizations on
147152# - Turn off warnings we don't need
148153
154+
155+
149156# GCC
150157if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
151158 if (ENABLE_FRONTEND)
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 2.8)
2- set (CMAKE_CXX_STANDARD 14)
2+
3+ if (${CMAKE_VERSION} VERSION_LESS "3.8.0" )
4+ set (CMAKE_CXX_STANDARD 14)
5+ message (STATUS "Using C++14 as you are using CMkake < 3.8, consider upgrading as future versions of Cadabra may make use of C++17 features" )
6+ else ()
7+ set (CMAKE_CXX_STANDARD 17)
8+ endif ()
9+
310project (Cadabra)
411
512#---------------------------------------------------------------------------
@@ -42,11 +49,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
4249endif ()
4350
4451if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
45- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 - O2" )
52+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" )
4653endif ()
4754
4855if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
49- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 - O2" )
56+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" )
5057endif ()
5158
5259if (MSVC )
Original file line number Diff line number Diff line change @@ -5,7 +5,12 @@ cmake_minimum_required(VERSION 3.5)
55
66project (CadabraWeb)
77
8- set (CMAKE_CXX_STANDARD 14)
8+ if (${CMAKE_VERSION} VERSION_LESS "3.8.0" )
9+ message (STATUS "Using C++14 as you are using CMake < 3.8, consider upgrading as future versions of Cadabra may use C++17 features)
10+ set(CMAKE_CXX_STANDARD 14)
11+ else()
12+ set(CMAKE_CXX_STANDARD 17)
13+ endif()
914
1015if(NOT " ${CMAKE_SYSTEM_NAME} " STREQUAL " Emscripten")
1116 message(FATAL_ERROR
You can’t perform that action at this time.
0 commit comments