Skip to content

Commit a514f08

Browse files
committed
get rid of gentypeconfig interpolation
1 parent 5179e08 commit a514f08

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

Diff for: jscomp/bsb/bsb_ninja_gen.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,13 @@ let output_ninja_and_namespace_map
127127
let dpkg_incls = (Bsb_build_util.include_dirs_by
128128
bs_dev_dependencies
129129
(fun x -> x.package_install_path)) in
130+
130131
let () =
131132
Ext_option.iter pp_file (fun flag ->
132133
Bsb_ninja_targets.output_kv Bsb_ninja_global_vars.pp_flags
133134
(Bsb_build_util.pp_flag flag) oc
134135
);
135-
Ext_option.iter gentype_config (fun x ->
136-
(* resolved earlier *)
137-
Bsb_ninja_targets.output_kv Bsb_ninja_global_vars.gentypeconfig
138-
("-bs-gentype " ^ x.path) oc
139-
);
136+
140137
Bsb_ninja_targets.output_kv
141138
Bsb_ninja_global_vars.src_root_dir per_proj_dir
142139
oc
@@ -176,7 +173,7 @@ let output_ninja_and_namespace_map
176173
let rules : Bsb_ninja_rule.builtin =
177174
Bsb_ninja_rule.make_custom_rules
178175
~refmt
179-
~has_gentype:(gentype_config <> None)
176+
~gentype_config
180177
~has_postbuild:js_post_build_cmd
181178
~has_pp:(pp_file <> None)
182179
~has_builtin:(built_in_dependency <> None)

Diff for: jscomp/bsb/bsb_ninja_global_vars.ml

-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,5 @@ let pp_flags = "pp_flags"
3939
let refmt = "refmt"
4040

4141

42-
let gentypeconfig = "gentypeconfig"
43-
4442

4543

Diff for: jscomp/bsb/bsb_ninja_rule.ml

+7-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type builtin = {
114114
;;
115115

116116
let make_custom_rules
117-
~(has_gentype : bool)
117+
~(gentype_config : Bsb_config_types.gentype_config option)
118118
~(has_postbuild : string option)
119119
~(has_pp : bool)
120120
~(has_builtin : bool)
@@ -158,13 +158,17 @@ let make_custom_rules
158158
Ext_buffer.add_string buf " -nostdlib";
159159
Ext_buffer.add_char_string buf ' ' warnings;
160160
Ext_buffer.add_char_string buf ' ' bsc_flags;
161+
begin match gentype_config with
162+
| None -> ()
163+
| Some x ->
164+
Ext_buffer.add_string buf " -bs-gentype " ;
165+
Ext_buffer.add_string buf x.path
166+
end;
161167
if read_cmi <> `is_cmi then begin
162168
Ext_buffer.add_string buf " -bs-package-name ";
163169
Ext_buffer.add_string buf package_name;
164170
Ext_buffer.add_string buf (Bsb_package_specs.package_flag_of_package_specs package_specs "$in_d")
165171
end;
166-
if has_gentype then
167-
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.gentypeconfig;
168172
Ext_buffer.add_string buf " -o $out $in";
169173
begin match postbuild with
170174
| None -> ()

Diff for: jscomp/bsb/bsb_ninja_rule.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type command = string
6969
we must make sure it is re-entrant
7070
*)
7171
val make_custom_rules :
72-
has_gentype:bool ->
72+
gentype_config:Bsb_config_types.gentype_config option ->
7373
has_postbuild:string option ->
7474
has_pp:bool ->
7575
has_builtin:bool ->

Diff for: lib/4.06.1/bsb.ml

+11-12
Original file line numberDiff line numberDiff line change
@@ -12950,8 +12950,6 @@ let pp_flags = "pp_flags"
1295012950
let refmt = "refmt"
1295112951

1295212952

12953-
let gentypeconfig = "gentypeconfig"
12954-
1295512953

1295612954

1295712955

@@ -13029,7 +13027,7 @@ type command = string
1302913027
we must make sure it is re-entrant
1303013028
*)
1303113029
val make_custom_rules :
13032-
has_gentype:bool ->
13030+
gentype_config:Bsb_config_types.gentype_config option ->
1303313031
has_postbuild:string option ->
1303413032
has_pp:bool ->
1303513033
has_builtin:bool ->
@@ -13169,7 +13167,7 @@ type builtin = {
1316913167
;;
1317013168

1317113169
let make_custom_rules
13172-
~(has_gentype : bool)
13170+
~(gentype_config : Bsb_config_types.gentype_config option)
1317313171
~(has_postbuild : string option)
1317413172
~(has_pp : bool)
1317513173
~(has_builtin : bool)
@@ -13213,13 +13211,17 @@ let make_custom_rules
1321313211
Ext_buffer.add_string buf " -nostdlib";
1321413212
Ext_buffer.add_char_string buf ' ' warnings;
1321513213
Ext_buffer.add_char_string buf ' ' bsc_flags;
13214+
begin match gentype_config with
13215+
| None -> ()
13216+
| Some x ->
13217+
Ext_buffer.add_string buf " -bs-gentype " ;
13218+
Ext_buffer.add_string buf x.path
13219+
end;
1321613220
if read_cmi <> `is_cmi then begin
1321713221
Ext_buffer.add_string buf " -bs-package-name ";
1321813222
Ext_buffer.add_string buf package_name;
1321913223
Ext_buffer.add_string buf (Bsb_package_specs.package_flag_of_package_specs package_specs "$in_d")
1322013224
end;
13221-
if has_gentype then
13222-
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.gentypeconfig;
1322313225
Ext_buffer.add_string buf " -o $out $in";
1322413226
begin match postbuild with
1322513227
| None -> ()
@@ -14030,16 +14032,13 @@ let output_ninja_and_namespace_map
1403014032
let dpkg_incls = (Bsb_build_util.include_dirs_by
1403114033
bs_dev_dependencies
1403214034
(fun x -> x.package_install_path)) in
14035+
1403314036
let () =
1403414037
Ext_option.iter pp_file (fun flag ->
1403514038
Bsb_ninja_targets.output_kv Bsb_ninja_global_vars.pp_flags
1403614039
(Bsb_build_util.pp_flag flag) oc
1403714040
);
14038-
Ext_option.iter gentype_config (fun x ->
14039-
(* resolved earlier *)
14040-
Bsb_ninja_targets.output_kv Bsb_ninja_global_vars.gentypeconfig
14041-
("-bs-gentype " ^ x.path) oc
14042-
);
14041+
1404314042
Bsb_ninja_targets.output_kv
1404414043
Bsb_ninja_global_vars.src_root_dir per_proj_dir
1404514044
oc
@@ -14079,7 +14078,7 @@ let output_ninja_and_namespace_map
1407914078
let rules : Bsb_ninja_rule.builtin =
1408014079
Bsb_ninja_rule.make_custom_rules
1408114080
~refmt
14082-
~has_gentype:(gentype_config <> None)
14081+
~gentype_config
1408314082
~has_postbuild:js_post_build_cmd
1408414083
~has_pp:(pp_file <> None)
1408514084
~has_builtin:(built_in_dependency <> None)

0 commit comments

Comments
 (0)