Skip to content

Commit 9475d56

Browse files
mralephCommit Queue
authored andcommitted
[infra] Support Mac in pkg/dart2wasm/tool/run_benchmark
[email protected] Change-Id: I4f0604468402437a3361269a244f9b32dd8969f2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411302 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Slava Egorov <[email protected]>
1 parent b69cc05 commit 9475d56

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

pkg/dart2wasm/tool/run_benchmark

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,31 @@ SDK_DIR="$(cd "${PROG_DIR}/../../.." ; pwd -P)"
2626

2727
RUN_WASM="$SDK_DIR/pkg/dart2wasm/bin/run_wasm.js"
2828

29-
# Hardcoded to x64 Linux for now.
30-
D8_BIN="$SDK_DIR/third_party/d8/linux/x64/d8"
29+
function host_arch() {
30+
# Use uname to determine the host architecture.
31+
case `uname -m` in
32+
x86_64)
33+
echo "x64"
34+
;;
35+
aarch64 | arm64 | armv8*)
36+
echo "arm64"
37+
;;
38+
*)
39+
echo "Unsupported host architecture" `uname -m` >&2
40+
exit 1
41+
;;
42+
esac
43+
}
44+
45+
function host_os() {
46+
if [[ `uname` == 'Darwin' ]]; then
47+
echo 'macos'
48+
else
49+
echo 'linux'
50+
fi
51+
}
52+
53+
D8_BIN="$SDK_DIR/third_party/d8/$(host_os)/$(host_arch)/d8"
3154
JSSHELL_BIN="$SDK_DIR/third_party/firefox_jsshell/js"
3255
JSC_BIN="$SDK_DIR/third_party/jsc/jsc"
3356

0 commit comments

Comments
 (0)