File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
compiler/bin-wasm_of_ocaml Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -76,25 +76,26 @@ let opt_with action x f =
7676 | None -> f None
7777 | Some x -> action x (fun y -> f (Some y))
7878
79+ let preprocessor_variables () =
80+ (* Keep this variables in sync with gen/gen.ml *)
81+ [ ( " effects"
82+ , Wat_preprocess. String
83+ (match Config. effects () with
84+ | `Disabled | `Jspi -> " jspi"
85+ | `Cps -> " cps"
86+ | `Double_translation -> assert false ) )
87+ ]
88+
7989let with_runtime_files ~runtime_wasm_files f =
8090 let inputs =
8191 List. map
8292 ~f: (fun file -> { Wat_preprocess. module_name = " env" ; file; source = File })
8393 runtime_wasm_files
8494 in
85- Wat_preprocess. with_preprocessed_files ~variables: [] ~inputs f
95+ Wat_preprocess. with_preprocessed_files ~variables: (preprocessor_variables () ) ~inputs f
8696
8797let build_runtime ~runtime_file =
88- (* Keep this variables in sync with gen/gen.ml *)
89- let variables =
90- [ ( " effects"
91- , Wat_preprocess. String
92- (match Config. effects () with
93- | `Disabled | `Jspi -> " jspi"
94- | `Cps -> " cps"
95- | `Double_translation -> assert false ) )
96- ]
97- in
98+ let variables = preprocessor_variables () in
9899 match
99100 List. find_opt Runtime_files. precompiled_runtimes ~f: (fun (flags , _ ) ->
100101 assert (List. length flags = List. length variables);
You can’t perform that action at this time.
0 commit comments