Skip to content

Commit

Permalink
Compile stubs for @check
Browse files Browse the repository at this point in the history
Without this, errors in C/C++ sources would be ignored when building
@check

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Aug 9, 2019
1 parent 2803786 commit d06e226
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/check_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/check_rules.mli
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions src/lib_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d06e226

Please sign in to comment.