@@ -4171,8 +4171,9 @@ val unsafe_string : bool ref
4171
4171
val opaque : bool ref
4172
4172
4173
4173
4174
+ type mli_status = Mli_na | Mli_exists | Mli_non_exists
4174
4175
val no_implicit_current_dir : bool ref
4175
- val assume_no_mli : bool ref
4176
+ val assume_no_mli : mli_status ref
4176
4177
4177
4178
4178
4179
end = struct
@@ -4294,8 +4295,9 @@ let keep_locs = ref false (* -keep-locs *)
4294
4295
let unsafe_string = ref true;; (* -safe-string / -unsafe-string *)
4295
4296
4296
4297
4298
+ type mli_status = Mli_na | Mli_exists | Mli_non_exists
4297
4299
let no_implicit_current_dir = ref false
4298
- let assume_no_mli = ref false
4300
+ let assume_no_mli = ref Mli_na
4299
4301
4300
4302
4301
4303
end
@@ -56655,7 +56657,8 @@ let type_implementation_more sourcefile outputprefix modulename initial_env ast
56655
56657
let sourceintf =
56656
56658
Misc.chop_extension_if_any sourcefile ^ !Config.interface_suffix in
56657
56659
56658
- if not !Clflags.assume_no_mli && Sys.file_exists sourceintf then begin
56660
+ let mli_status = !Clflags.assume_no_mli in
56661
+ if (mli_status = Clflags.Mli_na && Sys.file_exists sourceintf) || (mli_status = Clflags.Mli_exists) then begin
56659
56662
56660
56663
let intf_file =
56661
56664
try
@@ -56754,7 +56757,8 @@ let package_units initial_env objfiles cmifile modulename =
56754
56757
let prefix = chop_extension_if_any cmifile in
56755
56758
let mlifile = prefix ^ !Config.interface_suffix in
56756
56759
56757
- if not !Clflags.assume_no_mli && Sys.file_exists mlifile then begin
56760
+ let mli_status = !Clflags.assume_no_mli in
56761
+ if (mli_status = Clflags.Mli_na && Sys.file_exists mlifile) || (mli_status = Clflags.Mli_exists) then begin
56758
56762
56759
56763
if not (Sys.file_exists cmifile) then begin
56760
56764
raise(Error(Location.in_file mlifile, Env.empty,
@@ -105089,9 +105093,12 @@ let define_variable s =
105089
105093
let buckle_script_flags =
105090
105094
("-bs-no-implicit-include", Arg.Set Clflags.no_implicit_current_dir
105091
105095
, " Don't include current dir implicitly")
105096
+ ::
105097
+ ("-bs-assume-has-mli", Arg.Unit (fun _ -> Clflags.assume_no_mli := Clflags.Mli_exists),
105098
+ " (internal) Assume mli always exist ")
105092
105099
::
105093
- ("-bs-assume-no-mli", Arg.Set Clflags.assume_no_mli,
105094
- " Don't lookup whether mli exist or not")
105100
+ ("-bs-assume-no-mli", Arg.Unit (fun _ -> Clflags.assume_no_mli := Clflags.Mli_non_exists) ,
105101
+ " (internal) Don't lookup whether mli exist or not")
105095
105102
::
105096
105103
("-bs-D", Arg.String define_variable,
105097
105104
" Define conditional variable e.g, -D DEBUG=true"
0 commit comments