Skip to content

Commit 4cd2c1d

Browse files
mkustermannCommit Queue
authored andcommitted
[dart2wasm] Make pkg/dart2wasm/tool/compile_benchmark auto-detect correct architecture on Mac
Running `pkg/dart2wasm/tool/compile_benchmark` on * MacOS on X64 should use xcodebuild/ReleaseX64 * MacOS on ARM64 should use xcodebuild/ReleaseARM64 Change-Id: Id4cceb70eea1a3d0723e277325b21eff0fa36ef8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428780 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent 3c10662 commit 4cd2c1d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

pkg/dart2wasm/tool/compile_benchmark

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ function follow_links() {
1717
echo "$file"
1818
}
1919

20+
function host_arch() {
21+
# Use uname to determine the host architecture.
22+
case `uname -m` in
23+
x86_64)
24+
echo "X64"
25+
;;
26+
aarch64 | arm64 | armv8*)
27+
echo "ARM64"
28+
;;
29+
*)
30+
echo "Unknown host architecture" `uname -m` >&2
31+
exit 1
32+
;;
33+
esac
34+
}
35+
2036
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
2137
PROG_NAME="$(follow_links "$BASH_SOURCE")"
2238

@@ -30,7 +46,8 @@ if [[ `uname` == 'Darwin' ]]; then
3046
else
3147
OUT_DIR="$SDK_DIR/out"
3248
fi
33-
DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64}
49+
HOST_ARCH="$(host_arch)"
50+
DART_CONFIGURATION=${DART_CONFIGURATION:-Release$HOST_ARCH}
3451
BIN_DIR="$OUT_DIR/$DART_CONFIGURATION"
3552

3653
BINARYEN="$BIN_DIR/wasm-opt"

0 commit comments

Comments
 (0)