File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11language : cpp
2-
32sudo : false # Use the new container infrastructure
43
5- compiler :
6- - clang
7- - gcc
8-
94matrix :
105 include :
116 - os : linux
12- env : COMPILER=clang++-3.5
13- addons :
14- apt :
15- packages : ["clang-3.5"]
16-
17- - os : linux
18- env : COMPILER=clang++-3.6
7+ env :
8+ - COMPILER=clang++-3.6 STDLIB=libc++
199 addons :
2010 apt :
11+ sources : ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
2112 packages : ["clang-3.6"]
2213
2314 - os : linux
24- env : COMPILER=clang++-3.7
15+ env :
16+ - COMPILER=clang++-3.7 STDLIB=libc++
2517 addons :
2618 apt :
19+ sources : ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
2720 packages : ["clang-3.7"]
2821
29- - os : linux
30- env : COMPILER=clang++-3.8
31- addons :
32- apt :
33- packages : ["clang-3.8"]
34-
35- - os : linux
36- env : COMPILER=g++-5
37- addons :
38- apt :
39- packages : ["gcc-5"]
40-
4122 - os : osx
42- env : COMPILER=clang++
4323 osx_image : xcode6.4
24+ env :
25+ - COMPILER=clang++ V='Apple LLVM 6.4'
26+ - COMPILER=clang++ V='Apple LLVM 6.4' WITH_CPP14=true
4427
4528 - os : osx
46- env : COMPILER=clang++
4729 osx_image : xcode7
30+ env :
31+ - COMPILER=clang++ V='Apple LLVM 7.0'
32+ - COMPILER=clang++ V='Apple LLVM 7.0' WITH_CPP14=true
33+
34+ before_install :
35+ - |
36+ if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
37+ brew install cmake
38+ fi
39+
40+ - CMAKE_CXX_FLAGS+=" -Wall"
41+
42+ - if [[ "${WITH_CPP14}" == "true" ]]; then CMAKE_OPTIONS+=" -DWITH_CPP14=1"; fi
43+ - if [[ "${STDLIB}" == "libc++" ]]; then CMAKE_CXX_FLAGS+=" -stdlib=libc++"; fi
44+
45+ - sh ${COMPILER} --version || true
4846
4947before_script :
50- - cmake -DCMAKE_CXX_COMPILER=${COMPILER} -DWITH_TESTS=1 -DWITH_EXAMPLE=1 .
48+ - rm -rf build/
49+ - mkdir build
50+ - cd build
51+ - cmake -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DWITH_TESTS=1 -DWITH_EXAMPLE=1 ${CMAKE_OPTIONS} ..
5152
5253script :
5354 - cmake --build .
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 2.6.4)
33option (WITH_TESTS "Build tests." OFF )
44option (WITH_EXAMPLE "Build example." OFF )
55option (WITH_STATIC "Build static libs." ON )
6+ option (WITH_CPP11 "Build with C++11." ON )
7+ option (WITH_CPP14 "Build with C++14." OFF )
68
79project (docopt.cpp)
810include_directories ("${PROJECT_SOURCE_DIR} " )
@@ -22,7 +24,11 @@ if(WITH_STATIC)
2224endif ()
2325add_library (docopt SHARED ${DOCOPT_SRC} )
2426
25- add_definitions ("-std=c++11" )
27+ if (WITH_CPP14)
28+ add_definitions ("-std=c++14" )
29+ elseif (WITH_CPP11)
30+ add_definitions ("-std=c++11" )
31+ endif ()
2632
2733########################################################################
2834# tests
You can’t perform that action at this time.
0 commit comments