Updates for LOOT's Travis CI integration

* Build and use Boost 1.61.0
* Cache Node, Bower and Boost dependencies
* Always link to static Boost libraries
* Remove Travis's Boost ABI incompatibility hack
This commit is contained in:
Oliver Hamlet
2016-07-22 19:39:12 +01:00
parent b0aaf380dd
commit 863939c2c5
4 changed files with 41 additions and 27 deletions
+15 -11
View File
@@ -8,16 +8,10 @@ compiler: gcc
addons:
apt:
sources:
- boost-latest
- ubuntu-toolchain-r-test
- kubuntu-backports
- ubuntu-toolchain-r-test # ppa:ubuntu-toolchain-r/test
- kubuntu-backports # ppa:kubuntu-ppa/backports
packages:
- libboost-log1.55-dev
- libboost-date-time1.55-dev
- libboost-thread1.55-dev
- libboost-filesystem1.55-dev
- libboost-locale1.55-dev
- libboost-iostreams1.55-dev
- libbz2-dev
- libssl-dev
- gcc-5
- g++-5
@@ -25,6 +19,13 @@ addons:
- cmake-data
sauce_connect: true
cache:
directories:
- $TRAVIS_BUILD_DIR/node_modules
- $TRAVIS_BUILD_DIR/bower_components
- $HOME/boost_1_61_0/boost
- $HOME/boost_1_61_0/stage/lib
install:
# Use GCC 5.
- if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
@@ -38,15 +39,18 @@ install:
- export PATH="./node_modules/.bin:$PATH"
# Install runtime dependencies using Bower
- bower install
- chmod +x scripts/travis/install_boost.sh
- scripts/travis/install_boost.sh
before_script:
# Move into the cloned LOOT repo build path.
- mkdir build && cd build
# Travis machines are 64 bit, and the dependencies use dynamic linking.
- cmake .. -DPROJECT_STATIC_RUNTIME=OFF -DBUILD_SHARED_LIBS=OFF
# Link dynamically to the C++ standard library runtime.
- cmake .. -DPROJECT_STATIC_RUNTIME=OFF -DBOOST_ROOT=~/boost_1_61_0
script:
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm test; fi
- export CXXFLAGS="-fPIC" CFLAGS="-fPIC"
- make tests && ./tests
- make api-tests && ./api-tests
+1 -8
View File
@@ -30,7 +30,7 @@ configure_file("${CMAKE_SOURCE_DIR}/src/backend/app/loot_version.cpp.in" "${CMAK
# External Projects
##############################
set (Boost_USE_STATIC_LIBS ${PROJECT_STATIC_RUNTIME})
set (Boost_USE_STATIC_LIBS ON)
set (Boost_USE_MULTITHREADED ON)
set (Boost_USE_STATIC_RUNTIME ${PROJECT_STATIC_RUNTIME})
@@ -317,13 +317,6 @@ include_directories ("${CMAKE_SOURCE_DIR}/src"
# System-Specific Settings
##############################
# If building on Travis, define BOOST_NO_CXX11_SCOPED_ENUMS to avoid
# boost::filesystem::copy_file() linking errors due to mismatched C++ runtimes
# between Boost and LOOT.
IF ($ENV{TRAVIS})
add_definitions (-DBOOST_NO_CXX11_SCOPED_ENUMS)
ENDIF ()
# Settings when compiling for Windows.
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions (-DUNICODE -D_UNICODE -DLIBLO_STATIC)
-8
View File
@@ -32,14 +32,6 @@ sudo apt-get update
sudo apt-get install nodejs libx11-dev libgtk2.0-dev libnss3-dev libgconf2-dev libxss-dev libasound2-dev libxtst-dev
```
## Pre-built Boost Packages Workaround
The pre-built Boost packages for Boost 1.55 and below in Ubuntu were built without C++11 support, which causes an error when linking with a C++11-built LOOT binary. While it's better to use a build of Boost with C++11 support when building LOOT, the error can be worked around by running the following before running CMake:
```
export TRAVIS=1
```
## Runtime Differences
Not all LOOT's features have been implemented for Linux builds. Issues labelled
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
BOOST_BASENAME=boost_1_61_0
BOOST_LIBRARIES=(libboost_atomic.a libboost_chrono.a libboost_date_time.a libboost_filesystem.a libboost_iostreams.a libboost_locale.a libboost_log.a libboost_log_setup.a libboost_regex.a libboost_system.a libboost_thread.a)
function isLibraryMissing {
for LIBRARY in $BOOST_LIBRARIES; do
if [[ ! -e ~/$BOOST_BASENAME/stage/lib/$LIBRARY ]]; then
return 0
fi
done
return 1
}
if isLibraryMissing; then
cd ~
wget http://downloads.sourceforge.net/project/boost/boost/1.61.0/${BOOST_BASENAME}.tar.bz2
tar xf ${BOOST_BASENAME}.tar.bz2
cd $BOOST_BASENAME
./bootstrap.sh
./b2 toolset=gcc-5 link=static variant=release address-model=64 cxxflags="-std=c++14 -fPIC" boost.locale.icu=off --with-log --with-date_time --with-thread --with-filesystem --with-locale --with-regex --with-system --with-iostreams
fi