Factorize jbuilds a bit
This commit is contained in:
parent
7d10b0e983
commit
3fd14a8f28
|
@ -25,7 +25,7 @@ module Ocaml_flags = struct
|
||||||
; specific : string list Mode.Dict.t
|
; specific : string list Mode.Dict.t
|
||||||
}
|
}
|
||||||
|
|
||||||
let make ~flags ~ocamlc_flags ~ocamlopt_flags =
|
let make { Buildable. flags; ocamlc_flags; ocamlopt_flags; _ } =
|
||||||
let eval = Ordered_set_lang.eval_with_standard in
|
let eval = Ordered_set_lang.eval_with_standard in
|
||||||
{ common = eval flags ~standard:default_flags
|
{ common = eval flags ~standard:default_flags
|
||||||
; specific =
|
; specific =
|
||||||
|
@ -38,9 +38,7 @@ module Ocaml_flags = struct
|
||||||
|
|
||||||
let get_for_cm t ~cm_kind = get t (Mode.of_cm_kind cm_kind)
|
let get_for_cm t ~cm_kind = get t (Mode.of_cm_kind cm_kind)
|
||||||
|
|
||||||
let default =
|
let default = make (Sexp.Of_sexp.record Buildable.t (List []))
|
||||||
let std = Ordered_set_lang.standard in
|
|
||||||
make ~flags:std ~ocamlc_flags:std ~ocamlopt_flags:std
|
|
||||||
end
|
end
|
||||||
|
|
||||||
let default_c_flags = g ()
|
let default_c_flags = g ()
|
||||||
|
@ -928,13 +926,10 @@ module Gen(P : Params) = struct
|
||||||
|
|
||||||
let library_rules (lib : Library.t) ~dir ~all_modules ~files =
|
let library_rules (lib : Library.t) ~dir ~all_modules ~files =
|
||||||
let dep_kind = if lib.optional then Build.Optional else Required in
|
let dep_kind = if lib.optional then Build.Optional else Required in
|
||||||
let flags =
|
let flags = Ocaml_flags.make lib.buildable in
|
||||||
Ocaml_flags.make
|
let modules =
|
||||||
~flags:lib.flags
|
parse_modules ~dir ~all_modules ~modules_written_by_user:lib.buildable.modules
|
||||||
~ocamlc_flags:lib.ocamlc_flags
|
|
||||||
~ocamlopt_flags:lib.ocamlopt_flags
|
|
||||||
in
|
in
|
||||||
let modules = parse_modules ~dir ~all_modules ~modules_written_by_user:lib.modules in
|
|
||||||
let main_module_name = String.capitalize_ascii lib.name in
|
let main_module_name = String.capitalize_ascii lib.name in
|
||||||
let modules =
|
let modules =
|
||||||
String_map.map modules ~f:(fun (m : Module.t) ->
|
String_map.map modules ~f:(fun (m : Module.t) ->
|
||||||
|
@ -965,8 +960,8 @@ module Gen(P : Params) = struct
|
||||||
in
|
in
|
||||||
(* Preprocess before adding the alias module as it doesn't need preprocessing *)
|
(* Preprocess before adding the alias module as it doesn't need preprocessing *)
|
||||||
let modules =
|
let modules =
|
||||||
pped_modules ~dir ~dep_kind ~modules ~preprocess:lib.preprocess
|
pped_modules ~dir ~dep_kind ~modules ~preprocess:lib.buildable.preprocess
|
||||||
~preprocessor_deps:lib.preprocessor_deps
|
~preprocessor_deps:lib.buildable.preprocessor_deps
|
||||||
~lib_name:(Some lib.name)
|
~lib_name:(Some lib.name)
|
||||||
in
|
in
|
||||||
let modules =
|
let modules =
|
||||||
|
@ -991,14 +986,14 @@ module Gen(P : Params) = struct
|
||||||
|
|
||||||
let requires =
|
let requires =
|
||||||
requires ~dir ~dep_kind ~item:lib.name
|
requires ~dir ~dep_kind ~item:lib.name
|
||||||
~libraries:lib.libraries
|
~libraries:lib.buildable.libraries
|
||||||
~preprocess:lib.preprocess
|
~preprocess:lib.buildable.preprocess
|
||||||
~virtual_deps:lib.virtual_deps
|
~virtual_deps:lib.virtual_deps
|
||||||
in
|
in
|
||||||
setup_runtime_deps ~dir ~dep_kind ~item:lib.name
|
setup_runtime_deps ~dir ~dep_kind ~item:lib.name
|
||||||
~libraries:lib.libraries
|
~libraries:lib.buildable.libraries
|
||||||
~ppx_runtime_libraries:lib.ppx_runtime_libraries;
|
~ppx_runtime_libraries:lib.ppx_runtime_libraries;
|
||||||
List.iter (Lib_db.select_rules ~dir lib.libraries) ~f:add_rule;
|
List.iter (Lib_db.select_rules ~dir lib.buildable.libraries) ~f:add_rule;
|
||||||
|
|
||||||
build_modules ~flags ~dir ~dep_graph ~modules ~requires ~alias_module;
|
build_modules ~flags ~dir ~dep_graph ~modules ~requires ~alias_module;
|
||||||
Option.iter alias_module ~f:(fun m ->
|
Option.iter alias_module ~f:(fun m ->
|
||||||
|
@ -1119,13 +1114,10 @@ module Gen(P : Params) = struct
|
||||||
|
|
||||||
let executables_rules (exes : Executables.t) ~dir ~all_modules =
|
let executables_rules (exes : Executables.t) ~dir ~all_modules =
|
||||||
let dep_kind = Build.Required in
|
let dep_kind = Build.Required in
|
||||||
let flags =
|
let flags = Ocaml_flags.make exes.buildable in
|
||||||
Ocaml_flags.make
|
let modules =
|
||||||
~flags:exes.flags
|
parse_modules ~dir ~all_modules ~modules_written_by_user:exes.buildable.modules
|
||||||
~ocamlc_flags:exes.ocamlc_flags
|
|
||||||
~ocamlopt_flags:exes.ocamlopt_flags
|
|
||||||
in
|
in
|
||||||
let modules = parse_modules ~dir ~all_modules ~modules_written_by_user:exes.modules in
|
|
||||||
let modules =
|
let modules =
|
||||||
String_map.map modules ~f:(fun (m : Module.t) ->
|
String_map.map modules ~f:(fun (m : Module.t) ->
|
||||||
{ m with obj_name = obj_name_of_basename m.ml_fname })
|
{ m with obj_name = obj_name_of_basename m.ml_fname })
|
||||||
|
@ -1136,19 +1128,21 @@ module Gen(P : Params) = struct
|
||||||
name (Path.to_string dir));
|
name (Path.to_string dir));
|
||||||
*)
|
*)
|
||||||
let modules =
|
let modules =
|
||||||
pped_modules ~dir ~dep_kind ~modules ~preprocess:exes.preprocess
|
pped_modules ~dir ~dep_kind ~modules
|
||||||
~preprocessor_deps:[] ~lib_name:None
|
~preprocess:exes.buildable.preprocess
|
||||||
|
~preprocessor_deps:exes.buildable.preprocessor_deps
|
||||||
|
~lib_name:None
|
||||||
in
|
in
|
||||||
let item = List.hd exes.names in
|
let item = List.hd exes.names in
|
||||||
let dep_graph = ocamldep_rules ~dir ~item ~modules ~alias_module:None in
|
let dep_graph = ocamldep_rules ~dir ~item ~modules ~alias_module:None in
|
||||||
|
|
||||||
let requires =
|
let requires =
|
||||||
requires ~dir ~dep_kind ~item
|
requires ~dir ~dep_kind ~item
|
||||||
~libraries:exes.libraries
|
~libraries:exes.buildable.libraries
|
||||||
~preprocess:exes.preprocess
|
~preprocess:exes.buildable.preprocess
|
||||||
~virtual_deps:[]
|
~virtual_deps:[]
|
||||||
in
|
in
|
||||||
List.iter (Lib_db.select_rules ~dir exes.libraries) ~f:add_rule;
|
List.iter (Lib_db.select_rules ~dir exes.buildable.libraries) ~f:add_rule;
|
||||||
|
|
||||||
build_modules ~flags ~dir ~dep_graph ~modules ~requires ~alias_module:None;
|
build_modules ~flags ~dir ~dep_graph ~modules ~requires ~alias_module:None;
|
||||||
|
|
||||||
|
@ -1394,8 +1388,8 @@ module Gen(P : Params) = struct
|
||||||
| Ocamllex conf -> List.map conf.names ~f:(fun name -> name ^ ".ml")
|
| Ocamllex conf -> List.map conf.names ~f:(fun name -> name ^ ".ml")
|
||||||
| Ocamlyacc conf -> List.concat_map conf.names ~f:(fun name ->
|
| Ocamlyacc conf -> List.concat_map conf.names ~f:(fun name ->
|
||||||
[ name ^ ".ml"; name ^ ".mli" ])
|
[ name ^ ".ml"; name ^ ".mli" ])
|
||||||
| Library { libraries; _ } | Executables { libraries; _ } ->
|
| Library { buildable; _ } | Executables { buildable; _ } ->
|
||||||
List.filter_map libraries ~f:(function
|
List.filter_map buildable.libraries ~f:(function
|
||||||
| Direct _ -> None
|
| Direct _ -> None
|
||||||
| Select s -> Some s.result_fn)
|
| Select s -> Some s.result_fn)
|
||||||
| _ -> [])
|
| _ -> [])
|
||||||
|
|
|
@ -285,16 +285,9 @@ end
|
||||||
let field_osl name =
|
let field_osl name =
|
||||||
field name Ordered_set_lang.t ~default:Ordered_set_lang.standard
|
field name Ordered_set_lang.t ~default:Ordered_set_lang.standard
|
||||||
|
|
||||||
let field_modules =
|
|
||||||
field "modules" (fun s -> Ordered_set_lang.(map (t s)) ~f:String.capitalize_ascii)
|
|
||||||
~default:Ordered_set_lang.standard
|
|
||||||
|
|
||||||
let field_oslu name =
|
let field_oslu name =
|
||||||
field name Ordered_set_lang.Unexpanded.t ~default:Ordered_set_lang.Unexpanded.standard
|
field name Ordered_set_lang.Unexpanded.t ~default:Ordered_set_lang.Unexpanded.standard
|
||||||
|
|
||||||
let field_pp name =
|
|
||||||
field name Preprocess_map.t ~default:Preprocess_map.default
|
|
||||||
|
|
||||||
module Js_of_ocaml = struct
|
module Js_of_ocaml = struct
|
||||||
type t =
|
type t =
|
||||||
{ flags : string list
|
{ flags : string list
|
||||||
|
@ -369,6 +362,55 @@ module Lib_dep = struct
|
||||||
let direct s = Direct s
|
let direct s = Direct s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module Buildable = struct
|
||||||
|
type t =
|
||||||
|
{ modules : Ordered_set_lang.t
|
||||||
|
; libraries : Lib_dep.t list
|
||||||
|
; preprocess : Preprocess_map.t
|
||||||
|
; preprocessor_deps : Dep_conf.t list
|
||||||
|
; flags : Ordered_set_lang.t
|
||||||
|
; ocamlc_flags : Ordered_set_lang.t
|
||||||
|
; ocamlopt_flags : Ordered_set_lang.t
|
||||||
|
}
|
||||||
|
|
||||||
|
let t =
|
||||||
|
field "preprocess" Preprocess_map.t ~default:Preprocess_map.default
|
||||||
|
>>= fun preprocess ->
|
||||||
|
field "preprocessor_deps" (list Dep_conf.t) ~default:[]
|
||||||
|
>>= fun preprocessor_deps ->
|
||||||
|
field "modules" (fun s -> Ordered_set_lang.(map (t s)) ~f:String.capitalize_ascii)
|
||||||
|
~default:Ordered_set_lang.standard
|
||||||
|
>>= fun modules ->
|
||||||
|
field "extra_disabled_warnings" (list int) ~default:[]
|
||||||
|
>>= fun extra_disabled_warnings ->
|
||||||
|
field "libraries" (list Lib_dep.t) ~default:[]
|
||||||
|
>>= fun libraries ->
|
||||||
|
field_osl "flags" >>= fun flags ->
|
||||||
|
field_osl "ocamlc_flags" >>= fun ocamlc_flags ->
|
||||||
|
field_osl "ocamlopt_flags" >>= fun ocamlopt_flags ->
|
||||||
|
let flags =
|
||||||
|
if Ordered_set_lang.is_standard flags && extra_disabled_warnings <> [] then
|
||||||
|
Ordered_set_lang.append flags
|
||||||
|
(Ordered_set_lang.t
|
||||||
|
(List [ Atom "-w"
|
||||||
|
; Atom
|
||||||
|
(String.concat ~sep:""
|
||||||
|
(List.map extra_disabled_warnings ~f:(sprintf "-%d")))
|
||||||
|
]))
|
||||||
|
else
|
||||||
|
flags
|
||||||
|
in
|
||||||
|
return
|
||||||
|
{ preprocess
|
||||||
|
; preprocessor_deps
|
||||||
|
; modules
|
||||||
|
; libraries
|
||||||
|
; flags
|
||||||
|
; ocamlc_flags
|
||||||
|
; ocamlopt_flags
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
module Library = struct
|
module Library = struct
|
||||||
module Kind = struct
|
module Kind = struct
|
||||||
type t =
|
type t =
|
||||||
|
@ -389,11 +431,9 @@ module Library = struct
|
||||||
; public_name : string option
|
; public_name : string option
|
||||||
; synopsis : string option
|
; synopsis : string option
|
||||||
; install_c_headers : string list
|
; install_c_headers : string list
|
||||||
; libraries : Lib_dep.t list
|
|
||||||
; ppx_runtime_libraries : string list
|
; ppx_runtime_libraries : string list
|
||||||
; modes : Mode.t list
|
; modes : Mode.t list
|
||||||
; kind : Kind.t
|
; kind : Kind.t
|
||||||
; modules : Ordered_set_lang.t
|
|
||||||
; c_flags : Ordered_set_lang.Unexpanded.t
|
; c_flags : Ordered_set_lang.Unexpanded.t
|
||||||
; c_names : string list
|
; c_names : string list
|
||||||
; cxx_flags : Ordered_set_lang.Unexpanded.t
|
; cxx_flags : Ordered_set_lang.Unexpanded.t
|
||||||
|
@ -401,59 +441,46 @@ module Library = struct
|
||||||
; includes : String_with_vars.t list
|
; includes : String_with_vars.t list
|
||||||
; library_flags : String_with_vars.t list
|
; library_flags : String_with_vars.t list
|
||||||
; c_library_flags : Ordered_set_lang.Unexpanded.t
|
; c_library_flags : Ordered_set_lang.Unexpanded.t
|
||||||
; preprocess : Preprocess_map.t
|
|
||||||
; preprocessor_deps : Dep_conf.t list
|
|
||||||
; self_build_stubs_archive : string option
|
; self_build_stubs_archive : string option
|
||||||
; js_of_ocaml : Js_of_ocaml.t option
|
; js_of_ocaml : Js_of_ocaml.t option
|
||||||
; virtual_deps : string list
|
; virtual_deps : string list
|
||||||
; wrapped : bool
|
; wrapped : bool
|
||||||
; optional : bool
|
; optional : bool
|
||||||
; flags : Ordered_set_lang.t
|
; buildable : Buildable.t
|
||||||
; ocamlc_flags : Ordered_set_lang.t
|
|
||||||
; ocamlopt_flags : Ordered_set_lang.t
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let t =
|
let t =
|
||||||
record
|
record
|
||||||
(ignore_fields ["inline_tests"; "skip_from_default"; "lint"] >>= fun () ->
|
(ignore_fields ["inline_tests"; "skip_from_default"; "lint"] >>= fun () ->
|
||||||
field "name" library_name >>= fun name ->
|
Buildable.t >>= fun buildable ->
|
||||||
field_o "public_name" string >>= fun public_name ->
|
field "name" library_name >>= fun name ->
|
||||||
field_o "synopsis" string >>= fun synopsis ->
|
field_o "public_name" string >>= fun public_name ->
|
||||||
field "install_c_headers" (list string) ~default:[] >>= fun install_c_headers ->
|
field_o "synopsis" string >>= fun synopsis ->
|
||||||
field "libraries" (list Lib_dep.t) ~default:[] >>= fun libraries ->
|
field "install_c_headers" (list string) ~default:[] >>= fun install_c_headers ->
|
||||||
field "ppx_runtime_libraries" (list string) ~default:[] >>= fun ppx_runtime_libraries ->
|
field "ppx_runtime_libraries" (list string) ~default:[] >>= fun ppx_runtime_libraries ->
|
||||||
field_modules >>= fun modules ->
|
field_oslu "c_flags" >>= fun c_flags ->
|
||||||
field_oslu "c_flags" >>= fun c_flags ->
|
field_oslu "cxx_flags" >>= fun cxx_flags ->
|
||||||
field_oslu "cxx_flags" >>= fun cxx_flags ->
|
field "c_names" (list string) ~default:[] >>= fun c_names ->
|
||||||
field "c_names" (list string) ~default:[] >>= fun c_names ->
|
field "cxx_names" (list string) ~default:[] >>= fun cxx_names ->
|
||||||
field "cxx_names" (list string) ~default:[] >>= fun cxx_names ->
|
field "library_flags" (list String_with_vars.t) ~default:[] >>= fun library_flags ->
|
||||||
field "library_flags" (list String_with_vars.t) ~default:[] >>= fun library_flags ->
|
field "c_libraries" (list string) ~default:[] >>= fun c_libraries ->
|
||||||
field "c_libraries" (list string) ~default:[] >>= fun c_libraries ->
|
field_oslu "c_library_flags" >>= fun c_library_flags ->
|
||||||
field_oslu "c_library_flags" >>= fun c_library_flags ->
|
field "self_build_stubs_archive" (option string) ~default:None >>= fun self_build_stubs_archive ->
|
||||||
field_pp "preprocess" >>= fun preprocess ->
|
field_o "js_of_ocaml" Js_of_ocaml.t >>= fun js_of_ocaml ->
|
||||||
field "preprocessor_deps" (list Dep_conf.t) ~default:[] >>= fun preprocessor_deps ->
|
field "virtual_deps" (list string) ~default:[] >>= fun virtual_deps ->
|
||||||
field "self_build_stubs_archive" (option string) ~default:None >>= fun self_build_stubs_archive ->
|
field "modes" (list Mode.t) ~default:Mode.all >>= fun modes ->
|
||||||
field_o "js_of_ocaml" Js_of_ocaml.t >>= fun js_of_ocaml ->
|
field "includes" (list String_with_vars.t) ~default:[] >>= fun includes ->
|
||||||
field "virtual_deps" (list string) ~default:[] >>= fun virtual_deps ->
|
field "kind" Kind.t ~default:Kind.Normal >>= fun kind ->
|
||||||
field "modes" (list Mode.t) ~default:Mode.all >>= fun modes ->
|
field "wrapped" bool ~default:true >>= fun wrapped ->
|
||||||
field "includes" (list String_with_vars.t) ~default:[] >>= fun includes ->
|
field_b "optional" >>= fun optional ->
|
||||||
field "kind" Kind.t ~default:Kind.Normal >>= fun kind ->
|
|
||||||
field "wrapped" bool ~default:true >>= fun wrapped ->
|
|
||||||
field_b "optional" >>= fun optional ->
|
|
||||||
field_osl "flags" >>= fun flags ->
|
|
||||||
field_osl "ocamlc_flags" >>= fun ocamlc_flags ->
|
|
||||||
field_osl "ocamlopt_flags" >>= fun ocamlopt_flags ->
|
|
||||||
field "extra_disabled_warnings" (list int) ~default:[] >>= fun extra_disabled_warnings ->
|
|
||||||
return
|
return
|
||||||
{ name
|
{ name
|
||||||
; public_name
|
; public_name
|
||||||
; synopsis
|
; synopsis
|
||||||
; install_c_headers
|
; install_c_headers
|
||||||
; libraries
|
|
||||||
; ppx_runtime_libraries
|
; ppx_runtime_libraries
|
||||||
; modes
|
; modes
|
||||||
; kind
|
; kind
|
||||||
; modules
|
|
||||||
; c_names
|
; c_names
|
||||||
; c_flags
|
; c_flags
|
||||||
; cxx_names
|
; cxx_names
|
||||||
|
@ -465,26 +492,12 @@ module Library = struct
|
||||||
(Ordered_set_lang.Unexpanded.t
|
(Ordered_set_lang.Unexpanded.t
|
||||||
(Sexp.To_sexp.(list string (List.map c_libraries ~f:((^) "-l")))))
|
(Sexp.To_sexp.(list string (List.map c_libraries ~f:((^) "-l")))))
|
||||||
c_library_flags
|
c_library_flags
|
||||||
; preprocess
|
|
||||||
; preprocessor_deps
|
|
||||||
; self_build_stubs_archive
|
; self_build_stubs_archive
|
||||||
; js_of_ocaml
|
; js_of_ocaml
|
||||||
; virtual_deps
|
; virtual_deps
|
||||||
; wrapped
|
; wrapped
|
||||||
; optional
|
; optional
|
||||||
; flags =
|
; buildable
|
||||||
if Ordered_set_lang.is_standard flags && extra_disabled_warnings <> [] then
|
|
||||||
Ordered_set_lang.append flags
|
|
||||||
(Ordered_set_lang.t
|
|
||||||
(List [ Atom "-w"
|
|
||||||
; Atom
|
|
||||||
(String.concat ~sep:""
|
|
||||||
(List.map extra_disabled_warnings ~f:(sprintf "-%d")))
|
|
||||||
]))
|
|
||||||
else
|
|
||||||
flags
|
|
||||||
; ocamlc_flags
|
|
||||||
; ocamlopt_flags
|
|
||||||
})
|
})
|
||||||
|
|
||||||
let has_stubs t =
|
let has_stubs t =
|
||||||
|
@ -496,7 +509,7 @@ module Library = struct
|
||||||
Path.relative dir (sprintf "lib%s_stubs%s" t.name ext_lib)
|
Path.relative dir (sprintf "lib%s_stubs%s" t.name ext_lib)
|
||||||
|
|
||||||
let all_lib_deps t =
|
let all_lib_deps t =
|
||||||
List.map t.virtual_deps ~f:(fun s -> Lib_dep.Direct s) @ t.libraries
|
List.map t.virtual_deps ~f:(fun s -> Lib_dep.Direct s) @ t.buildable.libraries
|
||||||
end
|
end
|
||||||
|
|
||||||
module Executables = struct
|
module Executables = struct
|
||||||
|
@ -505,13 +518,8 @@ module Executables = struct
|
||||||
; object_public_name : string option
|
; object_public_name : string option
|
||||||
; synopsis : string option
|
; synopsis : string option
|
||||||
; link_executables : bool
|
; link_executables : bool
|
||||||
; libraries : Lib_dep.t list
|
|
||||||
; link_flags : string list
|
; link_flags : string list
|
||||||
; modules : Ordered_set_lang.t
|
; buildable : Buildable.t
|
||||||
; preprocess : Preprocess_map.t
|
|
||||||
; flags : Ordered_set_lang.t
|
|
||||||
; ocamlc_flags : Ordered_set_lang.t
|
|
||||||
; ocamlopt_flags : Ordered_set_lang.t
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let t =
|
let t =
|
||||||
|
@ -519,29 +527,19 @@ module Executables = struct
|
||||||
(ignore_fields
|
(ignore_fields
|
||||||
["js_of_ocaml"; "only_shared_object"; "review_help"; "skip_from_default"]
|
["js_of_ocaml"; "only_shared_object"; "review_help"; "skip_from_default"]
|
||||||
>>= fun () ->
|
>>= fun () ->
|
||||||
|
Buildable.t >>= fun buildable ->
|
||||||
field "names" (list string) >>= fun names ->
|
field "names" (list string) >>= fun names ->
|
||||||
field_o "object_public_name" string >>= fun object_public_name ->
|
field_o "object_public_name" string >>= fun object_public_name ->
|
||||||
field_o "synopsis" string >>= fun synopsis ->
|
field_o "synopsis" string >>= fun synopsis ->
|
||||||
field "link_executables" bool ~default:true >>= fun link_executables ->
|
field "link_executables" bool ~default:true >>= fun link_executables ->
|
||||||
field "libraries" (list Lib_dep.t) >>= fun libraries ->
|
|
||||||
field "link_flags" (list string) ~default:[] >>= fun link_flags ->
|
field "link_flags" (list string) ~default:[] >>= fun link_flags ->
|
||||||
field_modules >>= fun modules ->
|
|
||||||
field_pp "preprocess" >>= fun preprocess ->
|
|
||||||
field_osl "flags" >>= fun flags ->
|
|
||||||
field_osl "ocamlc_flags" >>= fun ocamlc_flags ->
|
|
||||||
field_osl "ocamlopt_flags" >>= fun ocamlopt_flags ->
|
|
||||||
return
|
return
|
||||||
{ names
|
{ names
|
||||||
; object_public_name
|
; object_public_name
|
||||||
; synopsis
|
; synopsis
|
||||||
; link_executables
|
; link_executables
|
||||||
; libraries
|
|
||||||
; link_flags
|
; link_flags
|
||||||
; modules
|
; buildable
|
||||||
; preprocess
|
|
||||||
; flags
|
|
||||||
; ocamlc_flags
|
|
||||||
; ocamlopt_flags
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ module Local_closure = Top_closure.Make(String)(struct
|
||||||
type t = Lib.Internal.t
|
type t = Lib.Internal.t
|
||||||
let key ((_, lib) : t) = lib.name
|
let key ((_, lib) : t) = lib.name
|
||||||
let deps ((_, lib) : Lib.Internal.t) graph =
|
let deps ((_, lib) : Lib.Internal.t) graph =
|
||||||
List.concat_map lib.libraries ~f:(fun dep ->
|
List.concat_map lib.buildable.libraries ~f:(fun dep ->
|
||||||
List.filter_map (Lib_dep.to_lib_names dep) ~f:(find_internal graph))
|
List.filter_map (Lib_dep.to_lib_names dep) ~f:(find_internal graph))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue