Next attempt to get the C++ runtime compiled in Travis CI.

This commit is contained in:
Mike Lischke 2016-10-04 10:17:59 +02:00
parent bb5d7ef0b6
commit fc5c1a29f9
1 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# -*- mode:cmake -*- # -*- mode:cmake -*-
cmake_minimum_required (VERSION 3.1) cmake_minimum_required (VERSION 2.8)
# 3.1 needed to allow enabling C++11 # 2.8 needed because of ExternalProject
# Detect build type, fallback to release and throw a warning if use didn't specify any # Detect build type, fallback to release and throw a warning if use didn't specify any
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
@ -60,8 +60,17 @@ endif(WITH_DEMO)
set(MY_CXX_WARNING_FLAGS " -Wall -pedantic -W") set(MY_CXX_WARNING_FLAGS " -Wall -pedantic -W")
# Initialize CXXFLAGS. # Initialize CXXFLAGS.
set(CMAKE_CXX_STANDARD 11) if("${CMAKE_VERSION}" VERSION_GREATER 3.1.0)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++11")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ${MY_CXX_WARNING_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ${MY_CXX_WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g ${MY_CXX_WARNING_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g ${MY_CXX_WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG ${MY_CXX_WARNING_FLAGS}") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG ${MY_CXX_WARNING_FLAGS}")