diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-03 15:16:49 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-07 18:01:02 -0700 |
commit | f964e40e7e9220d08751d8607af61ac5a7c0794c (patch) | |
tree | d34ca5407188fe3d71396faa8a8acceb52d9bd4b /scripts/travis_setup.sh | |
parent | f5d66f362272db034a311d2077dbdb2937c9bbdf (diff) | |
download | qtlocation-mapboxgl-f964e40e7e9220d08751d8607af61ac5a7c0794c.tar.gz |
[build] Refactor and simplify build system
* Main gyp files are now standardized as platform/<platform>/platform.gyp.
* Each platform gyp file defines appropriate loop_lib and headless_lib variables.
* Each platform gyp file includes mbgl.gypi, which defines base targets which may be useful to all platforms.
* CI targets are consistent across platforms: `make $(PLATFORM) && make test-$(PLATFORM)`.
* Renamed the "linux" test app to "glfw". It's now built in OS X CI.
* Android build flakiness is fixed.
* iOS CI builds the bench and iosapp targets.
* Mesa version is now in one place.
* CI scripts use bash "strict mode" and correct error handling.
* All build output goes to the build directory.
* Removed vestigial iOS/OS X/Android Travis scripts.
Diffstat (limited to 'scripts/travis_setup.sh')
-rwxr-xr-x | scripts/travis_setup.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/scripts/travis_setup.sh b/scripts/travis_setup.sh new file mode 100755 index 0000000000..e9fa87811f --- /dev/null +++ b/scripts/travis_setup.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# This script is sourced; do not set -e or -o pipefail here. + +if [ ! -z "${_CXX}" ]; then export CXX="${_CXX}" ; fi +if [ ! -z "${_CC}" ]; then export CC="${_CC}" ; fi + +if [ "${CCACHE:-0}" -ge 1 ]; then + export CXX="ccache ${CXX}" + export CC="ccache ${CC}" + + # ccache splits up the compile steps, so we end up with unused arguments in some steps. + # Clang also thinks that ccache isn't interactive, so we explicitly need to enable color. + if [ $(echo | ${CXX} -dM -E - | grep -c "#define __clang__ 1") -ge 1 ]; then + export CXX="${CXX} -Qunused-arguments -fcolor-diagnostics" + export CC="${CC} -Qunused-arguments -fcolor-diagnostics" + else + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60304 + # GCC normally throws this error which is in GTest, but *only* when compilation and + # preprocessing aren't combined in one step. However, when using ccache with GCC, we are + # running them in separate steps, so this warning/error is shown. + export CXX="${CXX} -Wno-conversion-null" + export CC="${CC} -Wno-conversion-null" + fi +fi + +echo "export CXX=\"${CXX}\"" +echo "export CC=\"${CC}\"" +${CXX} --version + +# Ensure mason is on the PATH +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +# Start the mock X server +if [ -f /etc/init.d/xvfb ] ; then + mapbox_time "start_xvfb" \ + sh -e /etc/init.d/xvfb start + sleep 2 # sometimes, xvfb takes some time to start up +fi + +# Make sure we're connecting to xvfb +export DISPLAY=:99.0 + +mapbox_time "checkout_mason" \ +git submodule update --init .mason + +# Install and set up to load a more recent version of mesa +mapbox_time "install_mesa" \ +mason install mesa 10.4.3 +export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}" + +# Install and set up to load awscli +pip install --user awscli +export PATH="`python -m site --user-base`/bin:${PATH}" + +# Install coveralls gem +gem install coveralls-lcov --no-rdoc --no-ri |