Skip to content

Commit

Permalink
Build folly from the travis before_script
Browse files Browse the repository at this point in the history
  • Loading branch information
simpkins committed Oct 17, 2018
1 parent 31ff2a2 commit 70ee7b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ before_script:
- gem install coveralls-lcov
- lcov --version
- eval "$COMPILER_EVAL"
# Build folly
- mkdir build
- ./scripts/build_folly.sh build/folly-src build/folly-install

script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DRSOCKET_ASAN=$ASAN -DRSOCKET_INSTALL_DEPS=True
- cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DRSOCKET_ASAN=$ASAN
-DCMAKE_PREFIX_PATH=$PWD/folly-install
-DRSOCKET_BUILD_WITH_COVERAGE=ON ..
- make -j4
- lcov --directory . --zerocounters
Expand Down
13 changes: 12 additions & 1 deletion scripts/build_folly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ if [[ -z $INSTALL_DIR ]]; then
exit 1
fi

# Convert INSTALL_DIR to an absolute path so it still refers to the same
# location after we cd into the build directory.
case "$INSTALL_DIR" in
/*) ;;
*) INSTALL_DIR="$PWD/$INSTALL_DIR"
esac

# If folly was already installed, just return early
INSTALL_MARKER_FILE="$INSTALL_DIR/folly.installed"
if [[ -f $INSTALL_MARKER_FILE ]]; then
Expand All @@ -28,7 +35,11 @@ fi

mkdir -p "$CHECKOUT_DIR/_build"
cd "$CHECKOUT_DIR/_build"
cmake "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" ..
if ! cmake "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" ..; then
echo "error configuring folly" >&2
tail -n 100 CMakeFiles/CMakeError.log >&2
exit 1
fi
make -j4
make install
touch "$INSTALL_MARKER_FILE"

0 comments on commit 70ee7b4

Please sign in to comment.