Skip to content

Commit

Permalink
Merge pull request #15 from LoungeCPP/наб/ci-integration
Browse files Browse the repository at this point in the history
Add TravisCI integration
  • Loading branch information
TheCatPlusPlus committed Mar 29, 2016
2 parents 8c7d9c1 + b8a99a4 commit 48f1cc6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
61 changes: 61 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
language: generic
matrix:
include:
- language: rust
rust: stable
- language: rust
rust: beta
- language: rust
rust: nightly
- language: python
python: "3.5"
env: CXX=g++-5 CC=gcc-5
addons:
apt:
packages:
- g++-5
- libicu-dev
- ninja-build
sources: &sources
- r-packages-precise
- llvm-toolchain-precise
- ubuntu-toolchain-r-test
- language: python
python: "3.5"
env: CXX=clang++-3.8 CC=clang-3.8
addons:
apt:
packages:
- clang-3.8
- libicu-dev
- ninja-build
sources: *sources

install:
- if [ -n "$CXX" ]; then
pushd ~;
curl -SsL http://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2?ts=1459198664 | tar -xjf -;
mv boost_1_58_0/boost .;
rm -rf boost_1_58_0;
export BOOST_DIR="$HOME/boost";

git clone https://github.com/zaphoyd/websocketpp.git --branch "0.7.0" --depth 1;
mv websocketpp/websocketpp wspp;
rm -rf websocketpp;
rm wspp/CMakeLists.txt;
mv wspp websocketpp;
export WEBSOCKETPP_DIR="$HOME/websocketpp";
popd;
fi

script:
- if [ -n "$CXX" ]; then
cd server-cpp;
python3.5 configure.py;
ninja;
fi
- if [ -n "$TRAVIS_RUST_VERSION" ]; then
cd server;
cargo test;
fi

16 changes: 14 additions & 2 deletions server-cpp/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@

sources = {}

def lib_compiler_args(lib_dir):
if lib_dir is None:
return ''
else:
return '-isystem{}'.format(lib_dir)

def boost_compiler_arg():
return lib_compiler_args(os.environ.get('BOOST_DIR'))

def websocketpp_compiler_arg():
return lib_compiler_args(os.environ.get('WEBSOCKETPP_DIR'))

for root, dirs, files in os.walk(str(source_path)):
for fn in files:
if fn.endswith('.cpp'):
Expand All @@ -21,7 +33,7 @@
# this file is generated by configure.py
cxx = {cxx}
common_flags = -ggdb -fPIC
cxx_flags = $common_flags -Wall -Werror -pedantic-errors -std=c++14 -MMD -c
cxx_flags = $common_flags -Wall -Werror -pedantic-errors -std=c++14 {boost} {websocketpp} -MMD -c
exe_flags = $common_flags -fno-omit-frame-pointer
rule cxx
Expand All @@ -30,7 +42,7 @@
rule exe
command = $cxx $exe_flags -o $out $in
'''.format(cxx = os.environ.get('CXX', 'clang++-3.8'))
'''.format(cxx = os.environ.get('CXX', 'clang++-3.8'), boost = boost_compiler_arg(), websocketpp = websocketpp_compiler_arg())

(here / temp_path).mkdir(parents = True, exist_ok = True)
(here / out_path).mkdir(parents = True, exist_ok = True)
Expand Down

0 comments on commit 48f1cc6

Please sign in to comment.