llvm.org GIT mirror llvm / c6a5d73
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308594 91177308-0d34-0410-b5e6-96231b3b80d8 Ilya Biryukov 2 years ago
1 changed file(s) with 45 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
4747 # We always checkout llvm
4848 LLVM_PROJECTS="llvm"
4949 CMAKE_LLVM_ENABLE_PROJECTS=""
50 CLANG_TOOLS_EXTRA_ENABLED=0
5051
5152 function contains_project() {
5253 local TARGET_PROJ="$1"
5960 return 1
6061 }
6162
63 function append_project() {
64 local PROJ="$1"
65
66 LLVM_PROJECTS="$LLVM_PROJECTS $PROJ"
67 if [ "$CMAKE_LLVM_ENABLE_PROJECTS" != "" ]; then
68 CMAKE_LLVM_ENABLE_PROJECTS="$CMAKE_LLVM_ENABLE_PROJECTS;$PROJ"
69 else
70 CMAKE_LLVM_ENABLE_PROJECTS="$PROJ"
71 fi
72 }
73
6274 while [[ $# -gt 0 ]]; do
6375 case "$1" in
6476 -r|--revision)
7486 -p|--llvm-project)
7587 shift
7688 PROJ="$1"
89 shift
90
7791 if [ "$PROJ" == "cfe" ]; then
7892 PROJ="clang"
7993 fi
94
95 if [ "$PROJ" == "clang-tools-extra" ]; then
96 if [ $CLANG_TOOLS_EXTRA_ENABLED -ne 0 ]; then
97 echo "Project 'clang-tools-extra' is already enabled, ignoring extra occurences."
98 else
99 CLANG_TOOLS_EXTRA_ENABLED=1
100 fi
101
102 continue
103 fi
104
80105 if ! contains_project "$PROJ" ; then
81 LLVM_PROJECTS="$LLVM_PROJECTS $PROJ"
82 if [ "$CMAKE_LLVM_ENABLE_PROJECTS" != "" ]; then
83 CMAKE_LLVM_ENABLE_PROJECTS="$CMAKE_LLVM_ENABLE_PROJECTS;"
84 fi
85 CMAKE_LLVM_ENABLE_PROJECTS="$CMAKE_LLVM_ENABLED_PROJECTS$PROJ"
106 append_project "$PROJ"
86107 else
87108 echo "Project '$PROJ' is already enabled, ignoring extra occurences."
88109 fi
89 shift
90110 ;;
91111 -i|--install-target)
92112 shift
111131 if [ "$CMAKE_INSTALL_TARGETS" == "" ]; then
112132 echo "No install targets. Please pass one or more --install-target."
113133 exit 1
134 fi
135
136 if [ $CLANG_TOOLS_EXTRA_ENABLED -ne 0 ]; then
137 if ! contains_project "clang"; then
138 echo "Project 'clang-tools-extra' was enabled without 'clang'."
139 echo "Adding 'clang' to a list of projects."
140
141 append_project "clang"
142 fi
114143 fi
115144
116145 if [ "$LLVM_BRANCH" == "" ]; then
147176 "$CLANG_BUILD_DIR/src/$LLVM_PROJECT"
148177 done
149178
179 if [ $CLANG_TOOLS_EXTRA_ENABLED -ne 0 ]; then
180 echo "Checking out https://llvm.org/svn/llvm-project/clang-tools-extra to $CLANG_BUILD_DIR/src/clang/tools/extra"
181 # FIXME: --trust-server-cert is required to workaround 'SSL issuer is not
182 # trusted' error. Using https seems preferable to http either way,
183 # albeit this is not secure.
184 svn co -q $SVN_REV_ARG --trust-server-cert \
185 "https://llvm.org/svn/llvm-project/clang-tools-extra/$LLVM_BRANCH" \
186 "$CLANG_BUILD_DIR/src/clang/tools/extra"
187 fi
188
150189 mkdir "$CLANG_BUILD_DIR/build"
151190 pushd "$CLANG_BUILD_DIR/build"
152191