Skip to content

Commit

Permalink
build-all: Add the option --clean-runtimes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mstorsjo committed Apr 18, 2024
1 parent 760b639 commit 6c47958
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6c47958

Please sign in to comment.