From 64ba9346dfa3bcdc83dea4ecd79ce22004e8e24b Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 8 Oct 2026 20:19:56 +0100 Subject: [PATCH] Allow build script to build only macOS libraries. --- build.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build.sh b/build.sh index 1d43da6..047f97a 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,26 @@ #!/bin/bash set -e +usage() { + echo "Usage: $0 [--mac-only]" + echo " -m, --mac-only Build only the macOS targets" + echo " -h, --help Show this help" +} + +MAC_ONLY=0 +for arg in "$@"; do + case "$arg" in + -m|--mac-only) MAC_ONLY=1 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $arg" >&2; usage >&2; exit 1 ;; + esac +done + +if [[ $MAC_ONLY == 1 && $(uname) != Darwin ]]; then + echo "--mac-only requires running on macOS" >&2 + exit 1 +fi + # Function to build for a target using dockcross build_with_dockcross() { local docker_image="$1" @@ -18,6 +38,7 @@ build_with_dockcross() { rm -f "docker/$script_name" } +if [[ $MAC_ONLY == 0 ]]; then # Linux targets build_with_dockcross dockcross/linux-armv7a-lts dockcross-linux-arm so runtimes/linux-arm/native build_with_dockcross dockcross/linux-arm64-lts dockcross-linux-arm64 so runtimes/linux-arm64/native @@ -33,6 +54,7 @@ build_with_dockcross dockcross/windows-armv7 dockcross-win-arm dll runtimes/win- build_with_dockcross dockcross/windows-arm64 dockcross-win-arm64 dll runtimes/win-arm64/native build_with_dockcross dockcross/windows-shared-x64 dockcross-win-x64 dll runtimes/win-x64/native build_with_dockcross dockcross/windows-shared-x86 dockcross-win-x86 dll runtimes/win-x86/native +fi # Mac OS X targets if [[ $(uname) == Darwin ]]; then