Skip to content

Commit 6d185d2

Browse files
mkustermannCommit Queue
authored and
Commit Queue
committed
[dart2wasm] Make pkg/dart2wasm/tool/compile_benchmark more similar to dart compile wasm
This allows copy&past'ing commands from `flutter build web --wasm --verbose` and replacing `dart compile wasm` with `pkg/dart2wasm/tool/compile_benchmark`. * We make the shell script recognize `-o` flag. * We make the shell script recognize different platform being passed. Change-Id: Iabecc7c87b35d35f073ced5e111a9ca5ea0d9298 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371341 Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent d150ad8 commit 6d185d2

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

pkg/dart2wasm/tool/compile_benchmark

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ OPT_FLAGS_L4=($(find_flags 'optimizationLevel4Flags'))
5252
RUN_BINARYEN=1
5353
RUN_SRC=0
5454
COMPILE_BENCHMARK_BASE_NAME=""
55-
PLATFORM_FILENAME="dart2wasm_platform.dill"
55+
PLATFORM_FILENAME="$BIN_DIR/dart2wasm_platform.dill"
5656
SNAPSHOT_NAME="dart2wasm"
5757

5858
# All arguments will be passed along to dart2wasm except specially recognized
@@ -74,7 +74,7 @@ while [ $# -gt 0 ]; do
7474
;;
7575

7676
--js-compatibility)
77-
PLATFORM_FILENAME="dart2wasm_js_compatibility_platform.dill"
77+
PLATFORM_FILENAME="$BIN_DIR/dart2wasm_js_compatibility_platform.dill"
7878
DART2WASM_ARGS+=("--js-compatibility")
7979
shift
8080
;;
@@ -120,11 +120,22 @@ while [ $# -gt 0 ]; do
120120
shift
121121
;;
122122

123+
--extra-compiler-option=--platform=*)
124+
PLATFORM_FILENAME="${1#--extra-compiler-option=--platform=}"
125+
shift
126+
;;
127+
123128
--extra-compiler-option=*)
124129
DART2WASM_ARGS+=(${1#--extra-compiler-option=})
125130
shift
126131
;;
127132

133+
-o)
134+
shift
135+
WASM_FILE="$1"
136+
shift
137+
;;
138+
128139
--* | -*)
129140
DART2WASM_ARGS+=("$1")
130141
shift
@@ -153,7 +164,7 @@ if [ -z "$DART_FILE" -o -z "$WASM_FILE" ]; then
153164
fi
154165

155166

156-
PLATFORM_ARG="--platform=$BIN_DIR/$PLATFORM_FILENAME"
167+
PLATFORM_ARG="--platform=$PLATFORM_FILENAME"
157168
DART2WASM_AOT_SNAPSHOT="$BIN_DIR/$SNAPSHOT_NAME.snapshot"
158169
DART2WASM_SRC="$SDK_DIR/pkg/dart2wasm/bin/dart2wasm.dart"
159170

0 commit comments

Comments
 (0)