diff --git a/.travis.yml b/.travis.yml index 48f0e6437..5bc693245 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/scripts/build_folly.sh b/scripts/build_folly.sh index 091e328e9..8a668ce6d 100755 --- a/scripts/build_folly.sh +++ b/scripts/build_folly.sh @@ -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 @@ -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"