@@ -48,6 +48,8 @@ if [[ $# == 0 ]]; then
4848 exit 0
4949fi
5050
51+ VERBOSE_FLAG=' '
52+
5153while [[ $# -gt 0 ]]; do
5254 case ${1} in
5355 -h|--help)
@@ -62,6 +64,12 @@ while [[ $# -gt 0 ]]; do
6264 BUILD_DIR=" ${2} "
6365 shift ; shift
6466 ;;
67+ --verbose)
68+ # If the user passes --verbose, we enable verbose output for
69+ # Ninja builds.
70+ VERBOSE_FLAG=' -v'
71+ shift
72+ ;;
6573 * )
6674 BUILDER=" ${1} "
6775 shift
@@ -168,25 +176,25 @@ function generate-cmake-android() {
168176
169177function check-runtimes() {
170178 step " Building libc++ test dependencies"
171- ${NINJA} -vC " ${BUILD_DIR} " cxx-test-depends
179+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " cxx-test-depends
172180
173181 step " Running the libc++ tests"
174- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
182+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
175183
176184 step " Running the libc++abi tests"
177- ${NINJA} -vC " ${BUILD_DIR} " check-cxxabi
185+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxxabi
178186
179187 step " Running the libunwind tests"
180- ${NINJA} -vC " ${BUILD_DIR} " check-unwind
188+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-unwind
181189}
182190
183191# TODO: The goal is to test this against all configurations. We should also move
184192# this to the Lit test suite instead of being a separate CMake target.
185193function check-abi-list() {
186194 step " Running the libc++ ABI list test"
187- ${NINJA} -vC " ${BUILD_DIR} " check-cxx-abilist || (
195+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx-abilist || (
188196 error " Generating the libc++ ABI list after failed check"
189- ${NINJA} -vC " ${BUILD_DIR} " generate-cxx-abilist
197+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " generate-cxx-abilist
190198 false
191199 )
192200}
@@ -233,7 +241,7 @@ function test-armv7m-picolibc() {
233241 " ${@ } "
234242
235243 step " Installing compiler-rt"
236- ${NINJA} -vC " ${BUILD_DIR} /compiler-rt" install
244+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} /compiler-rt" install
237245 # Move compiler-rt libs into the same directory as all the picolib objects.
238246 mv " ${INSTALL_DIR} /lib/armv7m-unknown-none-eabi" /* " ${INSTALL_DIR} /lib"
239247
@@ -256,7 +264,7 @@ check-generated-output)
256264 # Reject patches that forgot to re-run the generator scripts.
257265 step " Making sure the generator scripts were run"
258266 set +x # Printing all the commands below just creates extremely confusing output
259- ${NINJA} -vC " ${BUILD_DIR} " libcxx-generate-files
267+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " libcxx-generate-files
260268 git diff | tee ${BUILD_DIR} /generated_output.patch
261269 git ls-files -o --exclude-standard | tee ${BUILD_DIR} /generated_output.status
262270 ! grep -q ' ^--- a' ${BUILD_DIR} /generated_output.patch || false
@@ -400,13 +408,13 @@ bootstrapping-build)
400408 -DLLVM_LIT_ARGS=" -sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
401409
402410 step " Running the libc++ and libc++abi tests"
403- ${NINJA} -vC " ${BUILD_DIR} " check-runtimes
411+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-runtimes
404412
405413 step " Installing libc++ and libc++abi to a fake location"
406- ${NINJA} -vC " ${BUILD_DIR} " install-runtimes
414+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " install-runtimes
407415
408416 step " Running the LLDB libc++ data formatter tests"
409- ${NINJA} -vC " ${BUILD_DIR} " lldb-api-test-deps
417+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " lldb-api-test-deps
410418 ${BUILD_DIR} /bin/llvm-lit -sv --param dotest-args=' --category libc++' " ${MONOREPO_ROOT} /lldb/test/API"
411419
412420 ccache -s
@@ -552,7 +560,7 @@ apple-configuration)
552560
553561 step " Running tests against Apple-configured libc++"
554562 # TODO: It would be better to run the tests against the fake-installed version of libc++ instead
555- xcrun --sdk macosx ninja -vC " ${BUILD_DIR} /${arch} " check-cxx check-cxxabi check-cxx-abilist
563+ xcrun --sdk macosx ninja ${VERBOSE_FLAG} -C " ${BUILD_DIR} /${arch} " check-cxx check-cxxabi check-cxx-abilist
556564;;
557565apple-system|apple-system-hardened)
558566 clean
@@ -595,13 +603,13 @@ apple-system|apple-system-hardened)
595603 -DCMAKE_INSTALL_NAME_DIR=" /usr/lib/system"
596604
597605 step " Running the libc++ tests"
598- ${NINJA} -vC " ${BUILD_DIR} /cxx" check-cxx
606+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} /cxx" check-cxx
599607
600608 step " Running the libc++abi tests"
601- ${NINJA} -vC " ${BUILD_DIR} /cxx" check-cxxabi
609+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} /cxx" check-cxxabi
602610
603611 step " Running the libunwind tests"
604- ${NINJA} -vC " ${BUILD_DIR} /unwind" check-unwind
612+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} /unwind" check-unwind
605613;;
606614aarch64)
607615 clean
@@ -659,31 +667,31 @@ clang-cl-dll)
659667 # setting when cmake and the test driver does the right thing automatically.
660668 generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS=" enable_experimental=False"
661669 step " Running the libc++ tests"
662- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
670+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
663671;;
664672clang-cl-static)
665673 clean
666674 generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
667675 step " Running the libc++ tests"
668- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
676+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
669677;;
670- clang-cl-no-vcruntime )
678+ clang-cl-no${VERBOSE_FLAG} -Cruntime )
671679 clean
672680 # Building libc++ in the same way as in clang-cl-dll above, but running
673681 # tests with -D_HAS_EXCEPTIONS=0, which users might set in certain
674682 # translation units while using libc++, even if libc++ is built with
675683 # exceptions enabled.
676684 generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS=" enable_experimental=False" \
677- -DLIBCXX_TEST_CONFIG=" llvm-libc++-shared-no-vcruntime -clangcl.cfg.in"
685+ -DLIBCXX_TEST_CONFIG=" llvm-libc++-shared-no${VERBOSE_FLAG} -Cruntime -clangcl.cfg.in"
678686 step " Running the libc++ tests"
679- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
687+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
680688;;
681689clang-cl-debug)
682690 clean
683691 generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS=" enable_experimental=False" \
684692 -DCMAKE_BUILD_TYPE=Debug
685693 step " Running the libc++ tests"
686- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
694+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
687695;;
688696clang-cl-static-crt)
689697 clean
@@ -692,7 +700,7 @@ clang-cl-static-crt)
692700 generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \
693701 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
694702 step " Running the libc++ tests"
695- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
703+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
696704;;
697705mingw-dll)
698706 clean
@@ -738,7 +746,7 @@ mingw-incomplete-sysroot)
738746 # Only test that building succeeds; there's not much extra value in running
739747 # the tests here, as it would be equivalent to the mingw-dll config above.
740748 step " Building the runtimes"
741- ${NINJA} -vC " ${BUILD_DIR} "
749+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} "
742750;;
743751aix)
744752 clean
@@ -775,7 +783,7 @@ android-ndk-*)
775783 -DLIBCXX_TEST_PARAMS=" ${PARAMS} " \
776784 -DLIBCXXABI_TEST_PARAMS=" ${PARAMS} "
777785 check-abi-list
778- ${NINJA} -vC " ${BUILD_DIR} " install-cxx install-cxxabi
786+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " install-cxx install-cxxabi
779787
780788 # Start the emulator and make sure we can connect to the adb server running
781789 # inside of it.
@@ -788,9 +796,9 @@ android-ndk-*)
788796 adb shell mkdir -p /data/local/tmp/adb_run
789797 adb push " ${BUILD_DIR} /lib/libc++_shared.so" /data/local/tmp/libc++/libc++_shared.so
790798 step " Running the libc++ tests"
791- ${NINJA} -vC " ${BUILD_DIR} " check-cxx
799+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxx
792800 step " Running the libc++abi tests"
793- ${NINJA} -vC " ${BUILD_DIR} " check-cxxabi
801+ ${NINJA} ${VERBOSE_FLAG} -C " ${BUILD_DIR} " check-cxxabi
794802;;
795803# ################################################################
796804# Insert vendor-specific internal configurations below.
0 commit comments