-opaque should be passed for mli only modules or for all modules when opaque
 mode is on

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-08-07 11:33:22 +03:00
parent 0f18a6e047
commit 12bf6bda4a
2 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,9 @@ next
- Fix duplicate profile argument in suggested command when an external library
is missing (#1109, #1106, @emillon)
- Fix #1107. `-opaque` wasn't correctly being added to modules without
an interface. (#1108, fix #1107, @rgrinberg)
1.1.0 (06/08/2018)
------------------

View File

@ -88,7 +88,9 @@ let build_cm cctx ?sandbox ?(dynlink=true) ~dep_graphs ~cm_kind (m : Module.t) =
SC.add_rule sctx (Build.symlink ~src:in_obj_dir ~dst:in_dir))
end;
let opaque_arg =
if opaque && cm_kind = Cmi then
let intf_only = cm_kind = Cmi && not (Module.has_impl m) in
if opaque
|| (intf_only && Ocaml_version.supports_opaque_for_mli ctx.version) then
Arg_spec.A "-opaque"
else
As []