2017-03-31 06:02:53 -07:00
|
|
|
top_make() {
|
2017-03-31 06:17:38 -07:00
|
|
|
${MAKE_CMD} "$@"
|
2017-03-31 06:02:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
build_make() {
|
|
|
|
top_make -C "${BUILD_DIR}" "$@"
|
|
|
|
}
|
|
|
|
|
2015-07-05 00:52:36 -07:00
|
|
|
build_deps() {
|
2017-04-24 13:11:13 -07:00
|
|
|
if test "${BUILD_32BIT}" = ON ; then
|
2015-07-05 00:52:36 -07:00
|
|
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
|
|
|
fi
|
2017-05-08 05:43:45 -07:00
|
|
|
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
|
|
|
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
2016-03-06 22:18:44 -07:00
|
|
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2015-09-08 03:48:04 -07:00
|
|
|
rm -rf "${DEPS_BUILD_DIR}"
|
2015-07-05 00:52:36 -07:00
|
|
|
|
|
|
|
# If there is a valid cache and we're not forced to recompile,
|
|
|
|
# use cached third-party dependencies.
|
2017-04-24 13:11:13 -07:00
|
|
|
if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then
|
2017-04-24 12:14:32 -07:00
|
|
|
local statcmd="stat -c '%y'"
|
2017-04-24 13:11:13 -07:00
|
|
|
if test "${TRAVIS_OS_NAME}" = osx ; then
|
2017-04-24 12:14:32 -07:00
|
|
|
statcmd="stat -f '%Sm'"
|
2016-07-17 02:40:28 -07:00
|
|
|
fi
|
|
|
|
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-04-24 12:14:32 -07:00
|
|
|
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
|
|
|
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
2015-09-08 03:48:04 -07:00
|
|
|
else
|
|
|
|
mkdir -p "${DEPS_BUILD_DIR}"
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
|
2015-09-08 03:48:04 -07:00
|
|
|
# Even if we're using cached dependencies, run CMake and make to
|
|
|
|
# update CMake configuration and update to newer deps versions.
|
2015-07-05 00:52:36 -07:00
|
|
|
cd "${DEPS_BUILD_DIR}"
|
|
|
|
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
2016-07-17 07:29:59 -07:00
|
|
|
CC= cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2017-03-31 06:02:53 -07:00
|
|
|
if ! top_make; then
|
2015-07-05 00:52:36 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "${TRAVIS_BUILD_DIR}"
|
|
|
|
}
|
|
|
|
|
2016-09-10 12:48:45 -07:00
|
|
|
prepare_build() {
|
2017-04-24 12:14:32 -07:00
|
|
|
if test -n "${CLANG_SANITIZER}" ; then
|
2015-07-05 00:52:36 -07:00
|
|
|
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
|
|
|
fi
|
2017-04-24 13:11:13 -07:00
|
|
|
if test "${BUILD_32BIT}" = ON ; then
|
2015-07-05 00:52:36 -07:00
|
|
|
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "${BUILD_DIR}"
|
|
|
|
cd "${BUILD_DIR}"
|
2016-09-10 12:48:45 -07:00
|
|
|
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
|
|
|
cmake ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
|
|
|
|
}
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2016-09-10 12:48:45 -07:00
|
|
|
build_nvim() {
|
2015-07-05 00:52:36 -07:00
|
|
|
echo "Building nvim."
|
2017-04-24 12:14:32 -07:00
|
|
|
if ! top_make nvim ; then
|
2015-07-05 00:52:36 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-04-24 13:11:13 -07:00
|
|
|
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
2015-08-28 08:29:15 -07:00
|
|
|
echo "Building libnvim."
|
2017-04-24 12:14:32 -07:00
|
|
|
if ! top_make libnvim ; then
|
2015-08-28 08:29:15 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
|
2015-08-28 08:29:15 -07:00
|
|
|
echo "Building nvim-test."
|
2017-04-24 12:14:32 -07:00
|
|
|
if ! top_make nvim-test ; then
|
2015-08-28 08:29:15 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
2015-07-05 00:52:36 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Invoke nvim to trigger *San early.
|
2017-04-24 12:14:32 -07:00
|
|
|
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then
|
2015-08-28 08:29:15 -07:00
|
|
|
asan_check "${LOG_DIR}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
asan_check "${LOG_DIR}"
|
2015-09-08 03:48:04 -07:00
|
|
|
|
2015-07-05 00:52:36 -07:00
|
|
|
|
|
|
|
cd "${TRAVIS_BUILD_DIR}"
|
|
|
|
}
|