2016-12-15 14:22:42 -05:00
|
|
|
#!/bin/bash
|
|
|
|
if [ "${CXX:0:7}" = "clang++" ]; then
|
2017-01-25 09:21:58 -05:00
|
|
|
LLVM_ROOT="${DEPS_DIR}/llvm-${LLVM_VERSION}"
|
|
|
|
|
2016-11-19 02:55:46 -05:00
|
|
|
if [ -z "$(ls -A "${LLVM_ROOT}/install/include" 2>/dev/null)" ]; then
|
|
|
|
mkdir -p "${LLVM_ROOT}" "${LLVM_ROOT}/build" "${LLVM_ROOT}/projects/libcxx" "${LLVM_ROOT}/projects/libcxxabi"
|
|
|
|
|
2017-01-19 21:30:03 -05:00
|
|
|
travis_retry wget -O - "${LLVM_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}"
|
|
|
|
travis_retry wget -O - "${LIBCXX_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}/projects/libcxx"
|
|
|
|
travis_retry wget -O - "${LIBCXXABI_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}/projects/libcxxabi"
|
2016-11-19 02:55:46 -05:00
|
|
|
|
2016-12-15 15:32:05 -05:00
|
|
|
(cd "${LLVM_ROOT}/build" && cmake .. -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_C_COMPILER="$CC" -DCMAKE_INSTALL_PREFIX="${LLVM_ROOT}/install" -DCMAKE_BUILD_TYPE=$BUILD_TYPE)
|
2016-11-19 02:55:46 -05:00
|
|
|
(cd "${LLVM_ROOT}/build/projects/libcxx" && make install)
|
|
|
|
(cd "${LLVM_ROOT}/build/projects/libcxxabi" && make install)
|
|
|
|
fi
|
|
|
|
|
2016-12-15 15:32:05 -05:00
|
|
|
export CXXFLAGS="${CXXFLAGS} -I ${LLVM_ROOT}/install/include/c++/v1"
|
|
|
|
export LDFLAGS="${LDFLAGS} -L ${LLVM_ROOT}/install/lib -lc++ -lc++abi"
|
2016-11-19 02:55:46 -05:00
|
|
|
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_ROOT}/install/lib"
|
|
|
|
fi
|