diff --git a/src/check_rules.ml b/src/check_rules.ml index 952c88257c69..424c9f9c6a5c 100644 --- a/src/check_rules.ml +++ b/src/check_rules.ml @@ -25,3 +25,9 @@ let add_obj_dir sctx ~obj_dir = (Alias.check ~dir:(Obj_dir.dir obj_dir)) ~dyn_deps Path.Set.empty + +let add_files sctx ~dir files = + if (Super_context.context sctx).merlin then + let alias = Alias.check ~dir in + let files = Path.Set.of_list files in + Rules.Produce.Alias.add_deps alias files diff --git a/src/check_rules.mli b/src/check_rules.mli index f100d81341d9..089edf7e6717 100644 --- a/src/check_rules.mli +++ b/src/check_rules.mli @@ -1,3 +1,9 @@ open Stdune val add_obj_dir : Super_context.t -> obj_dir:Path.Build.t Obj_dir.t -> unit + +val add_files + : Super_context.t + -> dir:Path.Build.t + -> Path.t list + -> unit diff --git a/src/lib_rules.ml b/src/lib_rules.ml index 67b3a2422a1d..bfba3cbc6b57 100644 --- a/src/lib_rules.ml +++ b/src/lib_rules.ml @@ -251,6 +251,7 @@ let build_stubs lib ~sctx ~dir ~expander ~requires ~dir_contents else [] in + Check_rules.add_files sctx ~dir lib_o_files; match vlib_stubs_o_files @ lib_o_files with | [] -> () | o_files -> build_self_stubs lib ~sctx ~dir ~expander ~o_files