From a316625d9f69254b67cf0a5426aac12812a039a4 Mon Sep 17 00:00:00 2001 From: Levon Gevorgyan Date: Fri, 20 Dec 2024 13:25:13 -0600 Subject: [PATCH] fix macos build --- scripts/build.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 35e547a..8f12a24 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -25,15 +25,6 @@ BUILD_LTO='Y' # options for ffmpeg configure FFMPEG_CONFIGURE_OPT="" -# compilation job count -THREADS="$(nproc)" - -# for MacOs / Darwin -if [ "$(uname)" == "Darwin" ] ; then - FFMPEG_CONFIGURE_OPT+="--enable-rpath " - THREADS="$(sysctl -n hw.ncpu)" -fi - GREP_FILTER="av1" OPTS='hAsvorlO:' NUM_OPTS=$(echo -n $OPTS | wc -m) @@ -168,7 +159,6 @@ fi # architecture/cpu compile flags ARCH=$(uname -m) -COMP_FLAGS="-I${PREFIX}/include" COMP_FLAGS="" if [[ "$ARCH" == "x86_64" ]] then @@ -177,6 +167,19 @@ elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]] then COMP_FLAGS+=" -mcpu=native" fi + +# compilation job count +if commmand -v nproc 2> /dev/null ; then + THREADS="$(nproc)" +fi + +# for MacOs / Darwin +if [ "$(uname)" == "Darwin" ] ; then + COMP_FLAGS+=" -I${PREFIX}/include" + FFMPEG_CONFIGURE_OPT+="--enable-rpath " + THREADS="$(sysctl -n hw.ncpu)" +fi + echo "COMP_FLAGS: [${COMP_FLAGS}]" # for ccache