Skip to content

Commit 0cc0f8d

Browse files
committed
Add check of Binaryen support for sourcemaps
1 parent 46aa737 commit 0cc0f8d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/bin-wasm_of_ocaml/compile.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ let optimize ~profile ?sourcemap_file in_file out_file =
175175

176176
let link_and_optimize ~profile ?sourcemap_file runtime_wasm_files wat_file output_file =
177177
let sourcemap_file =
178-
if Sys.command "wasm-merge -osm foo 2> /dev/null" <> 0 then None else sourcemap_file
178+
(* Check that Binaryen supports the necessary sourcemaps options (requires
179+
version >= 118) *)
180+
match sourcemap_file with
181+
| Some _ when Sys.command "wasm-merge -osm foo 2> /dev/null" <> 0 -> None
182+
| Some _ | None -> sourcemap_file
179183
in
180184
let enable_source_maps = Option.is_some sourcemap_file in
181185
with_intermediate_file (Filename.temp_file "runtime" ".wasm")

0 commit comments

Comments
 (0)