forked from ceres-solver/ceres-solver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (63 loc) · 2.1 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
language: cpp
matrix:
fast_finish: true
include:
- os: linux
dist: bionic
sudo: required
compiler: gcc
env: CERES_BUILD_TARGET=LINUX
- os: linux
dist: bionic
sudo: required
compiler: gcc
env: CERES_BUILD_TARGET=ANDROID
- os: osx
osx_image: xcode11.2
env: CERES_BUILD_TARGET=OSX
- os: osx
osx_image: xcode11.2
env: CERES_BUILD_TARGET=IOS
env:
# As per http://docs.travis-ci.com/user/languages/cpp/#OpenMP-projects don't be greedy with OpenMP.
- OMP_NUM_THREADS=4
before_install:
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get update -qq; fi
- |
if [[ "$CERES_BUILD_TARGET" == "ANDROID" ]]; then
cd /tmp
wget https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip
unzip -qq android-ndk-r20b-linux-x86_64.zip
fi
install:
- if [ $TRAVIS_OS_NAME = linux ]; then $TRAVIS_BUILD_DIR/travis/install_travis_linux_deps.sh; fi
- if [ $TRAVIS_OS_NAME = osx ]; then $TRAVIS_BUILD_DIR/travis/install_travis_osx_deps.sh; fi
before_script:
- mkdir /tmp/ceres-build
- cd /tmp/ceres-build
script:
# NOTE: TRAVIS_BUILD_DIR is actually the source directory for Ceres.
- |
if [[ "$CERES_BUILD_TARGET" == "LINUX" || "$CERES_BUILD_TARGET" == "OSX" ]]; then
cmake $TRAVIS_BUILD_DIR
fi
- |
if [[ "$CERES_BUILD_TARGET" == "ANDROID" ]]; then
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/android-ndk-r20b/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3 -DANDROID_ABI=arm64-v8a -DANDROID_STL=c++_shared -DANDROID_NATIVE_API_LEVEL=android-29 -DMINIGLOG=ON -DBUILD_EXAMPLES=OFF $TRAVIS_BUILD_DIR
fi
- |
if [[ "$CERES_BUILD_TARGET" == "IOS" ]]; then
cmake -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/iOS.cmake -DEigen3_DIR=/usr/local/share/eigen3/cmake -DIOS_PLATFORM=OS $TRAVIS_BUILD_DIR
fi
- make -j 4
- |
if [[ "$CERES_BUILD_TARGET" == "LINUX" || "$CERES_BUILD_TARGET" == "OSX" ]]; then
sudo make install
ctest --output-on-failure -j 4
fi
notifications:
email: