language: cpp

os:
  - linux
  - osx

compiler:
  - gcc
  - clang

osx_image: xcode9.2

dist: xenial

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:timsc/swig-3.0.12 -y; sudo apt-get -qq update; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap homebrew/php; brew update; fi

install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install swig3.0 cmake python-dev ruby-dev php-dev liblua5.3-dev octave-pkg-dev openjdk-8-jdk r-base r-cran-rcpp -y; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install swig php71 lua; fi

before_script:
  - mkdir build
  - cd build
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]];then cmake ..; fi;
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake .. -DTINYSPLINE_WITH_PHP=FALSE -DTINYSPLINE_WITH_RUBY=FALSE; fi;

script:
  - cmake --build .

language: cpp

os:
  - linux
  - osx

compiler:
  - gcc
  - clang

env:
  - CMAKE_FLAGS=
  - CMAKE_FLAGS=-DTINYSPLINE_DOUBLE_PRECISION=NO
  - CMAKE_FLAGS=-DTINYSPLINE_DISABLE_CXX11_FEATURES=NO
  - CMAKE_FLAGS=-DTINYSPLINE_DOUBLE_PRECISION=NO -DTINYSPLINE_DISABLE_CXX11_FEATURES=NO

osx_image: xcode9.2

dist: xenial

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:timsc/swig-3.0.12 -y; sudo apt-get -qq update; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap homebrew/php; brew update; fi

install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install swig3.0 cmake python-dev ruby-dev php-dev liblua5.3-dev octave-pkg-dev openjdk-8-jdk r-base r-cran-rcpp -y; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install swig php71 lua; fi

before_script:
  - mkdir build
  - cd build
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]];then cmake .. $CMAKE_FLAGS; fi;
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake .. $CMAKE_FLAGS -DTINYSPLINE_WITH_PHP=FALSE -DTINYSPLINE_WITH_RUBY=FALSE; fi;

script:
  - cmake --build .

Add CMAKE_FLAGS environment variable to Travis-CI script
Add CMAKE_FLAGS environment variable to Travis-CI script

