From 6c479581da6d9b0b4d3f38b464bcc6c594c3a1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 31 Aug 2023 10:05:46 +0300 Subject: [PATCH] build-all: Add the option --clean-runtimes This sets the variable CLEAN=1 after building the tools, which makes all the builds of the runtime libraries remove old build dirs before building. This is similar to, but has a slight different purpose than the existing --wipe-runtimes, which removes the installed runtime files. Both are useful when testing various build configurations and investigating issues, for different testing scenarios. --- build-all.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build-all.sh b/build-all.sh index 3601ec5..8ce0b6b 100755 --- a/build-all.sh +++ b/build-all.sh @@ -73,6 +73,9 @@ while [ $# -gt 0 ]; do --wipe-runtimes) WIPE_RUNTIMES=1 ;; + --clean-runtimes) + CLEAN_RUNTIMES=1 + ;; *) if [ -n "$PREFIX" ]; then echo Unrecognized parameter $1 @@ -84,7 +87,7 @@ while [ $# -gt 0 ]; do shift done if [ -z "$PREFIX" ]; then - echo "$0 [--host-clang[=clang]] [--enable-asserts] [--disable-dylib] [--full-llvm] [--with-python] [--disable-lldb] [--disable-lldb-mi] [--disable-clang-tools-extra] [--host=triple] [--with-default-win32-winnt=0x601] [--with-default-msvcrt=ucrt] [--enable-cfguard|--disable-cfguard] [--no-runtimes] [--no-tools] [--wipe-runtimes] dest" + echo "$0 [--host-clang[=clang]] [--enable-asserts] [--disable-dylib] [--full-llvm] [--with-python] [--disable-lldb] [--disable-lldb-mi] [--disable-clang-tools-extra] [--host=triple] [--with-default-win32-winnt=0x601] [--with-default-msvcrt=ucrt] [--enable-cfguard|--disable-cfguard] [--no-runtimes] [--no-tools] [--wipe-runtimes] [--clean-runtimes] dest" exit 1 fi @@ -123,6 +126,9 @@ if [ -n "$WIPE_RUNTIMES" ]; then # in lib/clang/*/include. rm -rf $PREFIX/*-w64-mingw32 $PREFIX/lib/clang/*/lib fi +if [ -n "$CLEAN_RUNTIMES" ]; then + export CLEAN=1 +fi ./build-mingw-w64.sh $PREFIX $MINGW_ARGS $CFGUARD_ARGS ./build-compiler-rt.sh $PREFIX $CFGUARD_ARGS ./build-libcxx.sh $PREFIX $CFGUARD_ARGS