Skip to content

Commit

Permalink
Add check of Binaryen support for sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole committed Mar 27, 2024
1 parent 46aa737 commit 0cc0f8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/bin-wasm_of_ocaml/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ let optimize ~profile ?sourcemap_file in_file out_file =

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

0 comments on commit 0cc0f8d

Please sign in to comment.