From d540a97a791549536b98d9314128323c6fc31963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berke=20Kocao=C4=9Flu?= Date: Sun, 18 Aug 2024 08:22:27 +0300 Subject: [PATCH] .make: also don't compile C++ projects if can't compile standalone C++ programs --- .make | 68 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.make b/.make index 9999c330..6998549b 100755 --- a/.make +++ b/.make @@ -237,6 +237,23 @@ install() { ' -- ) + printf "\n%s\n" \ + "Installing external C and C++ libraries:" + + ( + # shellcheck disable=SC2069 + printf "%s\0" \ + "$rootdir/lib/hedley/hedley.h" \ + "$rootdir/lib/pstreams/pstream.h" \ + "$rootdir/lib/imtui-xphyro/include/imtui/" \ + "$rootdir/lib/lyra-xphyro/include/lyra/" \ + | xargs -r0 -n 1 -P "${MAKE_JOBS:-0}" sh -c ' + fl="$1" + printf " %s -> %s\n" "${fl##"$rootdir/lib/"}" "$includeprefix/${fl##*/}" >&2 + cp -rf -t "$includeprefix" -- "$fl" + ' -- + ) + printf "\n%s\n" \ "Preparing to install C++ programs:" @@ -306,45 +323,28 @@ install() { "$(printf "%s\n" "$ldflags" | tr -d "\n" | sed "s/^\s\+//;s/\s\+$//;s/\s\+/ /g")" '"$CXX"' '"$CXXFLAGS"' $flags $extraflags "$1" '"$CXXLDFLAGS"' $ldflags -o "$installprefix/$out" ' -- - ) - - printf "\n%s\n" \ - "Installing external C and C++ libraries:" - ( - # shellcheck disable=SC2069 - printf "%s\0" \ - "$rootdir/lib/hedley/hedley.h" \ - "$rootdir/lib/pstreams/pstream.h" \ - "$rootdir/lib/imtui-xphyro/include/imtui/" \ - "$rootdir/lib/lyra-xphyro/include/lyra/" \ - | xargs -r0 -n 1 -P "${MAKE_JOBS:-0}" sh -c ' - fl="$1" - printf " %s -> %s\n" "${fl##"$rootdir/lib/"}" "$includeprefix/${fl##*/}" >&2 - cp -rf -t "$includeprefix" -- "$fl" - ' -- - ) - - printf "\n%s\n" \ - "Installing C++ projects:" + printf "\n%s\n" \ + "Installing C++ projects:" - ( - cd cpp/project + ( + cd project - for dir in */; do - ( - cd "$dir" - name="${dir%/}" + for dir in */; do + ( + cd "$dir" + name="${dir%/}" - [ -f ".no-runner" ] && [ -d "/home/runner" ] && { - printf " %s\n" "Runner detected, not compiling $name." - exit 0 - } + [ -f ".no-runner" ] && [ -d "/home/runner" ] && { + printf " %s\n" "Runner detected, not compiling $name." + exit 0 + } - make -j"$CPU_PROC" "$name" - cp -f -t "$binprefix" -- "$name" - ) - done + make -j"$CPU_PROC" "$name" + cp -f -t "$binprefix" -- "$name" + ) + done + ) ) printf "\n%s\n" \