From 3c68b18f73c4455771bc5075028fb35586da2aaf Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 2 Jul 2024 21:46:28 +0000 Subject: [PATCH] Use the correct ninja binary for the host in aninja Change-Id: I79eb7fb397e9ae623a1cc2e67a472881767656f6 Test: `aninja -h` on Linux & Mac --- bin/aninja | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/aninja b/bin/aninja index cceb79489..5acb9681c 100755 --- a/bin/aninja +++ b/bin/aninja @@ -20,6 +20,19 @@ source $(cd $(dirname $BASH_SOURCE) &> /dev/null && pwd)/../../make/shell_utils. require_top require_lunch -cd $(gettop) -prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja "$@" +case $(uname -s) in + Darwin) + host_arch=darwin-x86 + ;; + Linux) + host_arch=linux-x86 + ;; + *) + >&2 echo Unknown host $(uname -s) + exit 1 + ;; +esac + +cd $(gettop) +prebuilts/build-tools/${host_arch}/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja "$@"