Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions boot/duneboot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,8 @@ module Library = struct
; root_module
}
~ext_obj
~ocaml_config
~ccomp_type
~architecture
=
let scan_subdirs =
match include_subdirs with
Expand Down Expand Up @@ -1155,8 +1156,6 @@ module Library = struct
| None -> files
| Some fn -> fn :: files
in
let ccomp_type = String.Map.find "ccomp_type" ocaml_config in
let architecture = String.Map.find "architecture" ocaml_config in
List.partition_map_skip files ~f:(fun (src, fn) ->
match src.kind with
| C c ->
Expand Down Expand Up @@ -1300,7 +1299,12 @@ let get_dependencies libraries =
deps
;;

let assemble_libraries { local_libraries; target = _, main; _ } ~ext_obj ~ocaml_config =
let assemble_libraries
{ local_libraries; target = _, main; _ }
~ext_obj
~ccomp_type
~architecture
=
(* In order to assemble all the sources in one place, the executables
modules are also put in a namespace *)
local_libraries
Expand All @@ -1309,7 +1313,7 @@ let assemble_libraries { local_libraries; target = _, main; _ } ~ext_obj ~ocaml_
in
{ Libs.main with main_module_name = Some namespace })
]
|> Fiber.parallel_map ~f:(Library.process ~ext_obj ~ocaml_config)
|> Fiber.parallel_map ~f:(Library.process ~ext_obj ~ccomp_type ~architecture)
;;

type status =
Expand Down Expand Up @@ -1521,7 +1525,9 @@ let main () =
try String.Map.find "ext_obj" ocaml_config with
| Not_found -> ".o"
in
let* libraries = assemble_libraries ~ext_obj ~ocaml_config task in
let ccomp_type = String.Map.find "ccomp_type" ocaml_config in
let architecture = String.Map.find "architecture" ocaml_config in
let* libraries = assemble_libraries task ~ext_obj ~ccomp_type ~architecture in
let c_files = List.concat_map ~f:(fun (lib : Library.t) -> lib.c_files) libraries in
let asm_files = List.concat_map ~f:(fun (lib : Library.t) -> lib.asm_files) libraries in
let* dependencies = get_dependencies libraries in
Expand Down
Loading