Module B0_ocaml.Lib

Library information.

An OCaml library is a directory with interfaces and object files. OCaml libraries are resolved by name using a Libresolver.


type t

The type for libraries.

val make : libname:Libname.t -> requires:Libname.t list -> exports:Libname.t list -> dir:B0_std.Fpath.t -> cmis:B0_std.Fpath.t list -> cmxs:B0_std.Fpath.t list -> cma:B0_std.Fpath.t option -> cmxa:B0_std.Fpath.t option -> c_archive:B0_std.Fpath.t option -> c_stubs:B0_std.Fpath.t list -> js_stubs:B0_std.Fpath.t list -> warning:string option -> t

make is a library with given properties. See corresponding accessors for semantics.

val of_dir : B0_memo.t -> clib_ext:B0_std.Fpath.ext -> libname:Libname.t -> requires:Libname.t list -> exports:Libname.t list -> dir:B0_std.Fpath.t -> archive:string option -> js_stubs:B0_std.Fpath.t list -> warning:string option -> (t, string) Stdlib.result

of_dir is a library with given properties, looked up in dir using clib_ext for the platform specific extension for C libraries. The basename without extension of the library's archives is archive and the JavaScript stubs are js_stubs. This looks up all library files in dir and makes them ready in m along with js_stubs.

Note. If dir doesn't follow the one library per directory convention this over-approximate cmis, cmxs and c_stubs files.

key stores the library definition of a unit.

val of_unit : B0_build.t -> B0_unit.t -> t option B0_std.Fut.t

lib_of_unit b ocaml_conf u defines a library from unit u by consulting key. As a side effect this B0_build.requiress u.


val libname : t -> Libname.t

libname l is the library name of l.

val requires : t -> Libname.t list

requires l are the libraries that are required by l.

val exports : t -> Libname.t list

exports l are the libraries that are represented by l.

val dir : t -> B0_std.Fpath.t

dir l is the library directory of l.

val cmis : t -> B0_std.Fpath.t list

cmis l is the list of cmis of l.

val cmxs : t -> B0_std.Fpath.t list

cmxs l is the list of cmxs of l.

val cma : t -> B0_std.Fpath.t option

cma l is the cma file of l (if any).

val cmxa : t -> B0_std.Fpath.t option

cmxa l is the cmxa file of l (if any).

val c_archive : t -> B0_std.Fpath.t option

c_archive l is the cmxa's companion C archive of l. Must exist if the cmxa exists and, since 4.12 if cmxa is not empty.

val c_stubs : t -> B0_std.Fpath.t list

c_stubs l is the C stubs archives of l (if any).

val js_stubs : t -> B0_std.Fpath.t list

js_stubs l is the list of JavaScript stubs of l (if any).

val warning : t -> string option

warning l is the usage warning of l (if any).