Module B0_ocaml.Build

module Build: sig .. end
OCaml build fragments.

Threads. FIXME the good strategy here is a bit unclear due to ocamlfind and ocaml interaction. In order to use OCaml POSIX or vm threads you should simply use the libraries thread.posix or thread.vm. We don't this for now but maybe we could: automatically add the needed -thread and -vmthread on the cli. The problem here is that we will compile many things that are not needed with these flags since we also use this to signal ocamlfind that the mt mt.posix are needed.



Build steps


val srcs : B0.Build.t -> dir:B0.Fpath.t -> B0.Fpath.t list * B0.Fpath.t list
src b dir is (ml_srcs, c_srcs) where ml_srcs are files ending up in .ml and .mli in dir and c_srcs the files ending up in .c and .h. All the resulting files are made ready in b.

A file named B0.ml is excluded from the list.

val compile : ?lib_deps:B0_ocaml.Lib.set ->
B0.Build.t -> B0_ocaml.conf -> B0_ocaml.Deps.t -> dst:B0.Fpath.t -> unit
val link : ?lib_deps:B0_ocaml.Lib.set ->
B0.Build.t ->
B0_ocaml.conf ->
B0_ocaml.Deps.t -> cobjs:B0.Fpath.t list -> dst:B0.Fpath.t -> string -> unit
val archive : B0.Build.t ->
B0_ocaml.conf ->
B0_ocaml.Deps.t -> cstubs:bool -> dst:B0.Fpath.t -> string -> unit

Combined steps


val exe : ?csrcs:B0.Fpath.t list ->
?lib_deps:B0_ocaml.Lib.set ->
B0.Build.t -> B0_ocaml.conf -> srcs:B0.Fpath.t list -> string -> unit
exe b c srcs name produces an executable with base name name by compiling and linking srcs along with libs. srcs are automatically sorted but must be made ready or built.
val lib : ?csrcs:B0.Fpath.t list ->
?lib_deps:B0_ocaml.Lib.set ->
B0.Build.t -> B0_ocaml.conf -> srcs:B0.Fpath.t list -> string -> unit
libs b c srcs name produces a library with base name base by compiling and srcs against libs. srcs are automatically sorted but must be made ready or built.
val tool : ?internal:B0.Tool.env_vars ->
?env_vars:B0.Tool.env_vars ->
?name:B0.Fpath.t ->
B0.build -> B0.Unit.t -> B0_ocaml.conf -> B0.Cmd.t -> B0.Build.run
tool ~name b u c args is a run for a tool named basename compiled via B0_ocaml.Build.exe in u with configuration c. This will automatically select the native tool if c allows and fallback to byte code otherwise.

FIXME Also lookup metadata in u for forced byte, also need something in bin.