Small improvement
This commit is contained in:
parent
d279e1e25d
commit
e5f27b8ba8
|
@ -7,11 +7,11 @@ type t =
|
||||||
; local_libs : Public_lib.t String_map.t
|
; local_libs : Public_lib.t String_map.t
|
||||||
}
|
}
|
||||||
|
|
||||||
let create context stanzas =
|
let create context l ~f =
|
||||||
let local_bins, local_libs =
|
let local_bins, local_libs =
|
||||||
List.fold_left stanzas ~init:(String_set.empty, String_map.empty)
|
List.fold_left l ~init:(String_set.empty, String_map.empty)
|
||||||
~f:(fun acc (_dir, stanzas) ->
|
~f:(fun acc x ->
|
||||||
List.fold_left stanzas ~init:acc
|
List.fold_left (f x) ~init:acc
|
||||||
~f:(fun (local_bins, local_libs) stanza ->
|
~f:(fun (local_bins, local_libs) stanza ->
|
||||||
match (stanza : Stanza.t) with
|
match (stanza : Stanza.t) with
|
||||||
| Install { section = Bin; files; _ } ->
|
| Install { section = Bin; files; _ } ->
|
||||||
|
|
|
@ -2,7 +2,11 @@ open! Import
|
||||||
|
|
||||||
type t
|
type t
|
||||||
|
|
||||||
val create : Context.t -> (Path.t * Jbuild.Stanza.t list) list -> t
|
val create
|
||||||
|
: Context.t
|
||||||
|
-> 'a list
|
||||||
|
-> f:('a -> Jbuild.Stanza.t list)
|
||||||
|
-> t
|
||||||
|
|
||||||
(** A named artifact that is looked up in the PATH if not found in the tree or
|
(** A named artifact that is looked up in the PATH if not found in the tree or
|
||||||
[in_the_tree] is [false].
|
[in_the_tree] is [false].
|
||||||
|
|
|
@ -147,8 +147,8 @@ let create
|
||||||
end)
|
end)
|
||||||
in
|
in
|
||||||
let artifacts =
|
let artifacts =
|
||||||
Artifacts.create context (List.map stanzas ~f:(fun (d : Dir_with_jbuild.t) ->
|
Artifacts.create context stanzas ~f:(fun (d : Dir_with_jbuild.t) ->
|
||||||
(d.ctx_dir, d.stanzas)))
|
d.stanzas)
|
||||||
in
|
in
|
||||||
let cxx_flags =
|
let cxx_flags =
|
||||||
String.extract_blank_separated_words context.ocamlc_cflags
|
String.extract_blank_separated_words context.ocamlc_cflags
|
||||||
|
|
Loading…
Reference in New Issue