Travis speed-ups (#3432)
* Enable ccache * Cache mingw dependencies * Expose USE_CCACHE option * Disable ccache for release builds
This commit is contained in:
@@ -2,6 +2,10 @@ language: cpp
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
cache:
|
||||
directories:
|
||||
- apt_mingw_cache
|
||||
- $HOME/.ccache
|
||||
matrix:
|
||||
include:
|
||||
- env: TARGET_OS=win32
|
||||
@@ -19,10 +23,14 @@ install:
|
||||
- . ${TRAVIS_BUILD_DIR}/.travis/${TRAVIS_OS_NAME}.${TARGET_OS}.install.sh
|
||||
before_script:
|
||||
- mkdir build && cd build
|
||||
- export CMAKE_FLAGS="-DWANT_QT5=$QT5 -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||
- if [ -z "$TRAVIS_TAG" ]; then export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"; fi
|
||||
script:
|
||||
- . ${TRAVIS_BUILD_DIR}/.travis/${TRAVIS_OS_NAME}.${TARGET_OS}.script.sh
|
||||
- make -j4
|
||||
- if [[ $TARGET_OS != win* ]]; then make tests && ./tests/tests; fi;
|
||||
after_script:
|
||||
- ccache -s
|
||||
before_deploy: make package
|
||||
deploy:
|
||||
provider: releases
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_WERROR=ON -DWANT_QT5=$QT5 ..
|
||||
cmake -DUSE_WERROR=ON $CMAKE_FLAGS ..
|
||||
|
||||
14
.travis/linux.win.download.sh
Normal file
14
.travis/linux.win.download.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1
|
||||
mkdir -p $CACHE_DIR
|
||||
|
||||
pushd $CACHE_DIR
|
||||
|
||||
apt-get --print-uris --yes install $MINGW_PACKAGES | grep ^\' | cut -d\' -f2 > downloads.list
|
||||
wget -N --input-file downloads.list
|
||||
|
||||
sudo cp ./*.deb /var/cache/apt/archives/
|
||||
|
||||
popd
|
||||
@@ -1,16 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32
|
||||
mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x-stk
|
||||
if [ $QT5 ]; then
|
||||
MINGW_PACKAGES="mingw32-x-qt5base"
|
||||
else
|
||||
MINGW_PACKAGES="mingw32-x-qt"
|
||||
fi
|
||||
|
||||
MINGW_PACKAGES="mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x-stk
|
||||
mingw32-x-glib2 mingw32-x-portaudio mingw32-x-libsndfile mingw32-x-fftw
|
||||
mingw32-x-flac mingw32-x-fltk mingw32-x-libsamplerate
|
||||
mingw32-x-pkgconfig mingw32-x-binutils mingw32-x-gcc mingw32-x-runtime
|
||||
mingw32-x-libgig mingw32-x-libsoundio"
|
||||
mingw32-x-libgig mingw32-x-libsoundio $MINGW_PACKAGES"
|
||||
|
||||
if [ $QT5 ]; then
|
||||
PACKAGES="$PACKAGES mingw32-x-qt5base"
|
||||
else
|
||||
PACKAGES="$PACKAGES mingw32-x-qt"
|
||||
fi
|
||||
export MINGW_PACKAGES
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $DIR/linux.win.download.sh win32
|
||||
|
||||
PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES"
|
||||
|
||||
sudo apt-get install -y $PACKAGES
|
||||
|
||||
# ccache 3.2 is needed because mingw32-x-gcc is version 4.9, which causes cmake
|
||||
# to use @file command line passing, which in turn ccache 3.1.9 doesn't support
|
||||
pushd /tmp
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/main/c/ccache/ccache_3.2.3-1_amd64.deb
|
||||
sudo dpkg -i ccache_3.2.3-1_amd64.deb
|
||||
popd
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export CMAKE_OPTS="-DUSE_WERROR=ON"
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_mingw32.sh
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# First, install 32-bit deps
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $DIR/linux.win32.install.sh
|
||||
|
||||
PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x-stk
|
||||
|
||||
if [ $QT5 ]; then
|
||||
MINGW_PACKAGES="mingw64-x-qt5base"
|
||||
else
|
||||
MINGW_PACKAGES="mingw64-x-qt"
|
||||
fi
|
||||
|
||||
MINGW_PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x-stk
|
||||
mingw64-x-glib2 mingw64-x-portaudio mingw64-x-libsndfile
|
||||
mingw64-x-fftw mingw64-x-flac mingw64-x-fltk mingw64-x-libsamplerate
|
||||
mingw64-x-pkgconfig mingw64-x-binutils mingw64-x-gcc mingw64-x-runtime
|
||||
mingw64-x-libgig mingw64-x-libsoundio"
|
||||
mingw64-x-libgig mingw64-x-libsoundio $MINGW_PACKAGES"
|
||||
|
||||
if [ $QT5 ]; then
|
||||
PACKAGES="$PACKAGES mingw64-x-qt5base"
|
||||
else
|
||||
PACKAGES="$PACKAGES mingw64-x-qt"
|
||||
fi
|
||||
export MINGW_PACKAGES
|
||||
|
||||
sudo apt-get install -y $PACKAGES
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $DIR/linux.win.download.sh win64
|
||||
|
||||
sudo apt-get install -y $MINGW_PACKAGES
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export CMAKE_OPTS="-DUSE_WERROR=ON"
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_mingw64.sh
|
||||
|
||||
@@ -8,7 +8,7 @@ else
|
||||
PACKAGES="$PACKAGES cartr/qt4/qt"
|
||||
fi
|
||||
|
||||
brew install $PACKAGES
|
||||
brew install $PACKAGES ccache
|
||||
|
||||
# Recompile fluid-synth without CoreAudio per issues #649
|
||||
# Changes to fluid-synth.rb must be pushed to URL prior to use
|
||||
|
||||
@@ -5,4 +5,4 @@ if [ $QT5 ]; then
|
||||
export CMAKE_PREFIX_PATH="$(brew --prefix qt55)"
|
||||
fi
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWANT_QT5=$QT5 -DUSE_WERROR=OFF ..
|
||||
cmake $CMAKE_FLAGS -DUSE_WERROR=OFF ..
|
||||
|
||||
@@ -476,6 +476,19 @@ ELSE(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
|
||||
ENDIF(WIN32)
|
||||
|
||||
# use ccache
|
||||
OPTION(USE_CCACHE "Use ccache for compilation" OFF)
|
||||
IF(USE_CCACHE)
|
||||
FIND_PROGRAM(CCACHE ccache)
|
||||
IF (CCACHE)
|
||||
MESSAGE(STATUS "Using ccache found in PATH")
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
|
||||
ELSE()
|
||||
MESSAGE(WARNING "USE_CCACHE enabled, but no ccache found")
|
||||
ENDIF()
|
||||
ENDIF(CCACHE_FOUND)
|
||||
|
||||
# make sub-directories
|
||||
ADD_SUBDIRECTORY(cmake)
|
||||
ADD_SUBDIRECTORY(src)
|
||||
|
||||
Reference in New Issue
Block a user