WIP: uv-simple-select #1

Closed
Chris Blackbourn wants to merge 182 commits from uv-simple-select into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit a43dca7424 - Show all commits

View File

@ -6,11 +6,11 @@
# - That dependency uses all available cores. # - That dependency uses all available cores.
# #
# Without this, simply calling `make -j$(nproc)` from the `${CMAKE_BUILD_DIR}/deps/` # Without this, simply calling `make -j$(nproc)` from the `${CMAKE_BUILD_DIR}/deps/`
# directory will build all projects at once. # directory will build many projects at once.
# #
# This is undesirable for the following reasons: # This is undesirable for the following reasons:
# #
# - The output from many projects is mixed together, # - The output from projects is mixed together,
# making it difficult to track down the cause of a build failure. # making it difficult to track down the cause of a build failure.
# #
# - Larger dependencies such as LLVM can bottleneck the build process, # - Larger dependencies such as LLVM can bottleneck the build process,
@ -20,7 +20,7 @@
# It's possible canceling happens as a patch is being applied or files are being copied. # It's possible canceling happens as a patch is being applied or files are being copied.
# (steps that aren't part of the compilation process where it's typically safe to cancel). # (steps that aren't part of the compilation process where it's typically safe to cancel).
if [[ -z "${MY_MAKE_CALL_LEVEL}" ]]; then if [[ -z "$MY_MAKE_CALL_LEVEL" ]]; then
export MY_MAKE_CALL_LEVEL=0 export MY_MAKE_CALL_LEVEL=0
export MY_MAKEFLAGS=$MAKEFLAGS export MY_MAKEFLAGS=$MAKEFLAGS
@ -31,34 +31,35 @@ if [[ -z "${MY_MAKE_CALL_LEVEL}" ]]; then
-j*) -j*)
export MY_JOBS_ARG=$i export MY_JOBS_ARG=$i
if [ "$MY_JOBS_ARG" = "-j" ]; then if [ "$MY_JOBS_ARG" = "-j" ]; then
add_next=1 add_next=1
fi fi
;; ;;
--jobs=*) --jobs=*)
shift # past argument=value shift # past argument=value
export MY_JOBS_ARG=$i MY_JOBS_ARG=$i
;; ;;
*) *)
if (( $add_next == 1 )); then if (( add_next == 1 )); then
export MY_JOBS_ARG="$MY_JOBS_ARG $i" MY_JOBS_ARG="$MY_JOBS_ARG $i"
add_next=0 add_next=0
fi fi
;; ;;
esac esac
done done
unset i add_next unset i add_next
if [[ -z "${MY_JOBS_ARG}" ]]; then if [[ -z "$MY_JOBS_ARG" ]]; then
export MY_JOBS_ARG="-j$(nproc)" MY_JOBS_ARG="-j$(nproc)"
fi fi
export MY_JOBS_ARG
# Support user defined `MAKEFLAGS`. # Support user defined `MAKEFLAGS`.
export MAKEFLAGS="$MY_MAKEFLAGS -j1" export MAKEFLAGS="$MY_MAKEFLAGS -j1"
else else
export MY_MAKE_CALL_LEVEL=$(( $MY_MAKE_CALL_LEVEL + 1 )) export MY_MAKE_CALL_LEVEL=$(( MY_MAKE_CALL_LEVEL + 1 ))
if (( $MY_MAKE_CALL_LEVEL == 1 )); then if (( MY_MAKE_CALL_LEVEL == 1 )); then
# Important to set jobs to 1, otherwise user defined jobs argument is used. # Important to set jobs to 1, otherwise user defined jobs argument is used.
export MAKEFLAGS="$MY_MAKEFLAGS -j1" export MAKEFLAGS="$MY_MAKEFLAGS -j1"
elif (( $MY_MAKE_CALL_LEVEL == 2 )); then elif (( MY_MAKE_CALL_LEVEL == 2 )); then
# This is the level used by each sub-project. # This is the level used by each sub-project.
export MAKEFLAGS="$MY_MAKEFLAGS $MY_JOBS_ARG" export MAKEFLAGS="$MY_MAKEFLAGS $MY_JOBS_ARG"
fi fi