B0_ocamlSourceOCaml B0 file support.
A few high-level build units.
libname n is n as an OCaml library name. This is shortcut for B00_ocaml.Lib.Name.v.
val exe :
?wrap:(B0_unit.proc -> B0_unit.proc) ->
?doc:string ->
?meta:B0_meta.t ->
?action:B0_unit.action ->
?c_requires:B0_std.Cmd.t ->
?requires:B00_ocaml.Lib.Name.t list ->
?name:string ->
string ->
srcs:B0_srcs.sels ->
B0_unit.texe n is a build unit for an executable named n (without the platform specific extension).
doc is the unit doc string.meta is the initial metadata.c_requires FIXME hack, something more sensitive should be done. This each of these options are passed as -cclib options.requires are the OCaml libraries required to compile the executable.name is the name of the unit (defaults to n).srcs are the executable sources. All files with extension .ml, .mli, .c and .h are considered for compiling and linking the executable.wrap allows to extend the build procedure you must call the given build procedure. TODO maybe remove once we have good Build fragments.val lib :
?wrap:(B0_unit.proc -> B0_unit.proc) ->
?doc:string ->
?meta:B0_meta.t ->
?action:B0_unit.action ->
?c_requires:B0_std.Cmd.t ->
?requires:B00_ocaml.Lib.Name.t list ->
?name:string ->
B00_ocaml.Lib.Name.t ->
srcs:B0_srcs.sels ->
B0_unit.tlib n ~srcs is a built unit for a library named l made of sources src.
doc is the unit doc string.meta is the initial metadata.c_requires FIXME hack, something more sensitive should be done. This each of these options are passed as -cclib options.requires are the OCaml libraries required to compile the library.name is the name of the build unit (default to n with . substituted by -)srcs are the library sources. extension .ml, .mli, .c and .h are considered for compiling and linking the executable.wrap allows to extend the build procedure you must call the given build procedure. TODO maybe remove once we have good Build fragments.conf is a memo key store with the OCaml configuration.
ocaml_version b gets B00_ocaml.Tool.Conf.version from conf.
In a build it is desirable to know which code is being produced because if both are produced the compilers may compete to produce some of the shared build artefacts. The following store keys allow to express build code desires and determine the actual decision. Note the desires may actually be altered units that may build FIXME maybe we should stick to must.
The type indicating which code is being built.
pp_built_code formats built_code values.
wanted_code indicates which code should be built, default determines to `Auto. If `Auto is used and no unit that may build has specific Meta.needs_code then `Native is used if ocamlopt can be found in the memo environment and `Byte otherwise.
build_code is a memo key indicating the built code. By default determines by consulting wanted_code.
See TODO.
tag indicates the entity is related to OCaml.
lib_resolver is the library resolver used by the build units defined by this module. See default_lib_resolver for the default.
default_lib_resolver determines the default value of lib_resolver. This resolver does the following:
lib_of_unit.B00_ocaml.Lib.Resolver.ocamlpath and B00_ocaml.Lib.Resolver.ocamlfind using the B0_build.shared_build_dir directory of the build.val lib_of_unit :
B0_build.t ->
B00_ocaml.Conf.t ->
B0_unit.t ->
B00_ocaml.Lib.t option B0_std.Fut.tlib_of_unit b ocaml_conf u defines a library from unit u by consulting Meta.requires, Meta.library and Meta.mod_srcs. As a side effect this B0_build.require u.
lib_resolver_build_scope b conf is a library resolver scope for OCaml libraries that can be built in b. For a unit u to be recognized as such it has to:
B0_build.may_build set of b.Meta.library and Meta.requires in its metadata.