cmake:add c++11 flag (#262)

* cmake:add c++11 flag

to prevent errors such as this:

https://travis-ci.org/ZetaGlest/zetaglest-source/builds/436849785
This commit is contained in:
Andy Alt
2018-10-03 21:18:37 -05:00
committed by GitHub
parent 8efc78ebe7
commit 004e68f5a0
2 changed files with 7 additions and 4 deletions

View File

@@ -5,6 +5,10 @@ OPTION(FORCE_EMBEDDED_LIBS "Force use of embedded libraries' code." OFF)
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}") add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
# On Travis, the build fails on osx and Ubuntu trusty using
# clang 5.0 unless the -std=c++11 if used
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(WANT_USE_STREFLOP) if(WANT_USE_STREFLOP)
# IMPORTANT: should come BEFORE finding packages # IMPORTANT: should come BEFORE finding packages
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)

View File

@@ -7,10 +7,9 @@ SET(TARGET_NAME "zetaglest_tests")
IF(BUILD_ZETAGLEST_TESTS) IF(BUILD_ZETAGLEST_TESTS)
MESSAGE(STATUS "Build ${TARGET_NAME} = YES") MESSAGE(STATUS "Build ${TARGET_NAME} = YES")
# The tests fail on Travis with clang on osx because of the use of "bind" # On Travis, the build fails on osx and Ubuntu trusty using
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") # clang 5.0 unless the -std=c++11 if used
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
INCLUDE (CheckIncludeFiles) INCLUDE (CheckIncludeFiles)