File tree Expand file tree Collapse file tree 3 files changed +27
-12
lines changed Expand file tree Collapse file tree 3 files changed +27
-12
lines changed Original file line number Diff line number Diff line change 11language : c
2+ # Ubuntu 14.04 Trusty support
3+ sudo : required
4+ dist : trusty
25# build matrix with both OSes and Compilers
36os :
47 - linux
58 - osx
69compiler :
710 - clang
8- # commenting out gcc until installing GCC v5.x+ actually works on Travis CI
9- # - gcc
11+ - gcc
1012# different C Standard versions - test on C99 and C11
1113env :
12- - LIBSAXBOSPIRAL_C_STANDARD=99
13- - LIBSAXBOSPIRAL_C_STANDARD=11
14- # exclude gcc on osx as this always points to clang
14+ matrix :
15+ - LIBSAXBOSPIRAL_C_STANDARD=99
16+ - LIBSAXBOSPIRAL_C_STANDARD=11
1517matrix :
18+ # exclude gcc on osx as this always points to clang
1619 exclude :
1720 - os : osx
1821 compiler : gcc
@@ -22,18 +25,22 @@ addons:
2225 apt :
2326 sources :
2427 - george-edison55-precise-backports # cmake 3.2.3 / doxygen 1.8.3
28+ # add PPAs with more up-to-date toolchains
29+ - ubuntu-toolchain-r-test
2530 packages :
2631 - cmake
2732 - cmake-data
28- # commenting out gcc until installing GCC v5.x+ actually works on Travis CI
2933 # want gcc 5.x as 4.x gives incorrect warnings
30- # - gcc-5
34+ - gcc-5
3135# branches safelist
3236branches :
3337 only :
3438 - master
3539 - develop
3640 - /^test\/.*$/
41+ install :
42+ # override $CC to use gcc-5
43+ - if [ "$CC" = "gcc" ]; then export CC="gcc-5"; fi
3744before_script :
3845 - cmake .
3946script :
Original file line number Diff line number Diff line change 2323# begin basic metadata
2424cmake_minimum_required (VERSION 3.0)
2525
26- project (libsaxbospiral VERSION 0.21.0 LANGUAGES C)
26+ project (libsaxbospiral VERSION 0.21.1 LANGUAGES C)
2727
28- # set default C standard to use (C99)
29- set (SAXBOSPIRAL_C_STANDARD "99" )
28+ # set default C standard to use (C99) if not already set
29+ if (NOT DEFINED SAXBOSPIRAL_C_STANDARD)
30+ set (SAXBOSPIRAL_C_STANDARD "99" )
31+ endif ()
3032# if env variable LIBSAXBOSPIRAL_C_STANDARD is set and valid, override version
3133if (DEFINED ENV{LIBSAXBOSPIRAL_C_STANDARD})
3234 # not a very robust regex but ok for most purposes
Original file line number Diff line number Diff line change @@ -61,11 +61,17 @@ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .
6161make
6262```
6363
64- The above builds in C99 mode by default. The standard to use is controlled by the ` LIBSAXBOSPIRAL_C_STANDARD ` environment variable.
64+ The above builds in C99 mode by default. The standard to use can be controlled by the ` SAXBOSPIRAL_C_STANDARD ` CMake variable or by the ` LIBSAXBOSPIRAL_C_STANDARD ` environment variable.
6565
66- You can build in C11 mode if you want with the following:
66+ You can build in C11 mode if you want with either of the following:
6767
6868``` sh
69+ # using CMake variable
70+ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DSAXBOSPIRAL_C_STANDARD=11 .
71+ ```
72+
73+ ``` sh
74+ # using environment variable
6975LIBSAXBOSPIRAL_C_STANDARD=11 cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .
7076```
7177
You can’t perform that action at this time.
0 commit comments