[llvm] r308594 - Handle clang-tools-extra project in docker scripts.
Ilya Biryukov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 01:30:44 PDT 2017
Author: ibiryukov
Date: Thu Jul 20 01:30:44 2017
New Revision: 308594
URL: http://llvm.org/viewvc/llvm-project?rev=308594&view=rev
Log:
Handle clang-tools-extra project in docker scripts.
Reviewers: klimek, mehdi_amini
Reviewed By: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35418
Modified:
llvm/trunk/utils/docker/scripts/build_install_llvm.sh
Modified: llvm/trunk/utils/docker/scripts/build_install_llvm.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/docker/scripts/build_install_llvm.sh?rev=308594&r1=308593&r2=308594&view=diff
==============================================================================
--- llvm/trunk/utils/docker/scripts/build_install_llvm.sh (original)
+++ llvm/trunk/utils/docker/scripts/build_install_llvm.sh Thu Jul 20 01:30:44 2017
@@ -48,6 +48,7 @@ CMAKE_INSTALL_TARGETS=""
# We always checkout llvm
LLVM_PROJECTS="llvm"
CMAKE_LLVM_ENABLE_PROJECTS=""
+CLANG_TOOLS_EXTRA_ENABLED=0
function contains_project() {
local TARGET_PROJ="$1"
@@ -60,6 +61,17 @@ function contains_project() {
return 1
}
+function append_project() {
+ local PROJ="$1"
+
+ LLVM_PROJECTS="$LLVM_PROJECTS $PROJ"
+ if [ "$CMAKE_LLVM_ENABLE_PROJECTS" != "" ]; then
+ CMAKE_LLVM_ENABLE_PROJECTS="$CMAKE_LLVM_ENABLE_PROJECTS;$PROJ"
+ else
+ CMAKE_LLVM_ENABLE_PROJECTS="$PROJ"
+ fi
+}
+
while [[ $# -gt 0 ]]; do
case "$1" in
-r|--revision)
@@ -75,19 +87,27 @@ while [[ $# -gt 0 ]]; do
-p|--llvm-project)
shift
PROJ="$1"
+ shift
+
if [ "$PROJ" == "cfe" ]; then
PROJ="clang"
fi
- if ! contains_project "$PROJ" ; then
- LLVM_PROJECTS="$LLVM_PROJECTS $PROJ"
- if [ "$CMAKE_LLVM_ENABLE_PROJECTS" != "" ]; then
- CMAKE_LLVM_ENABLE_PROJECTS="$CMAKE_LLVM_ENABLE_PROJECTS;"
+
+ if [ "$PROJ" == "clang-tools-extra" ]; then
+ if [ $CLANG_TOOLS_EXTRA_ENABLED -ne 0 ]; then
+ echo "Project 'clang-tools-extra' is already enabled, ignoring extra occurences."
+ else
+ CLANG_TOOLS_EXTRA_ENABLED=1
fi
- CMAKE_LLVM_ENABLE_PROJECTS="$CMAKE_LLVM_ENABLED_PROJECTS$PROJ"
+
+ continue
+ fi
+
+ if ! contains_project "$PROJ" ; then
+ append_project "$PROJ"
else
echo "Project '$PROJ' is already enabled, ignoring extra occurences."
fi
- shift
;;
-i|--install-target)
shift
@@ -114,6 +134,15 @@ if [ "$CMAKE_INSTALL_TARGETS" == "" ]; t
exit 1
fi
+if [ $CLANG_TOOLS_EXTRA_ENABLED -ne 0 ]; then
+ if ! contains_project "clang"; then
+ echo "Project 'clang-tools-extra' was enabled without 'clang'."
+ echo "Adding 'clang' to a list of projects."
+
+ append_project "clang"
+ fi
+fi
+
if [ "$LLVM_BRANCH" == "" ]; then
LLVM_BRANCH="trunk"
fi
@@ -148,6 +177,16 @@ for LLVM_PROJECT in $LLVM_PROJECTS; do
"$CLANG_BUILD_DIR/src/$LLVM_PROJECT"
done
+if [ $CLANG_TOOLS_EXTRA_ENABLED -ne 0 ]; then
+ echo "Checking out https://llvm.org/svn/llvm-project/clang-tools-extra to $CLANG_BUILD_DIR/src/clang/tools/extra"
+ # FIXME: --trust-server-cert is required to workaround 'SSL issuer is not
+ # trusted' error. Using https seems preferable to http either way,
+ # albeit this is not secure.
+ svn co -q $SVN_REV_ARG --trust-server-cert \
+ "https://llvm.org/svn/llvm-project/clang-tools-extra/$LLVM_BRANCH" \
+ "$CLANG_BUILD_DIR/src/clang/tools/extra"
+fi
+
mkdir "$CLANG_BUILD_DIR/build"
pushd "$CLANG_BUILD_DIR/build"
More information about the llvm-commits
mailing list