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 =
76
76
| None -> f None
77
77
| Some x -> action x (fun y -> f (Some y))
78
78
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
+
79
89
let with_runtime_files ~runtime_wasm_files f =
80
90
let inputs =
81
91
List. map
82
92
~f: (fun file -> { Wat_preprocess. module_name = " env" ; file; source = File })
83
93
runtime_wasm_files
84
94
in
85
- Wat_preprocess. with_preprocessed_files ~variables: [] ~inputs f
95
+ Wat_preprocess. with_preprocessed_files ~variables: (preprocessor_variables () ) ~inputs f
86
96
87
97
let 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
98
99
match
99
100
List. find_opt Runtime_files. precompiled_runtimes ~f: (fun (flags , _ ) ->
100
101
assert (List. length flags = List. length variables);
You can’t perform that action at this time.
0 commit comments