Skip to content

Commit

Permalink
(library (extra_objects)): avoid double linking
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
nojb committed Jul 30, 2024
1 parent 81877e5 commit d135d3a
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/dune_rules/lib_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,13 @@ let build_stubs lib ~cctx ~dir ~expander ~requires ~dir_contents ~vlib_stubs_o_f
Foreign_sources.for_lib foreign_sources ~name
in
let* o_files =
let lib_foreign_o_files =
let { Lib_config.ext_obj; _ } = (Compilation_context.ocaml cctx).lib_config in
Foreign.Objects.build_paths lib.buildable.extra_objects ~ext_obj ~dir
in
let+ tbl =
Foreign_rules.build_o_files
~sctx
~dir
~expander
~requires
~dir_contents
~foreign_sources
in
Mode.Map.Multi.add_all tbl Mode.Select.All lib_foreign_o_files
Foreign_rules.build_o_files
~sctx
~dir
~expander
~requires
~dir_contents
~foreign_sources
in
let all_o_files = Mode.Map.Multi.to_flat_list o_files in
let* () = Check_rules.add_files sctx ~dir all_o_files in
Expand Down

0 comments on commit d135d3a

Please sign in to comment.