Module PLUGIN.Findlib

Findlib / Ocamlfind tools.

type command_spec = Command.spec
type error =
| Cannot_run_ocamlfind
| Dependency_not_found of string * string
| Package_not_found of string
| Cannot_parse_query of string * string
exception Findlib_error of error
val string_of_error : error -> string

Return a string message describing an error.

val report_error : error -> 'a

Report an error on the standard error and exit with code 2.

type package = {
name : string;
description : string;
version : string;
archives_byte : string;(*

Archive names, with the .cma extension, but without the directory.

*)
archives_native : string;(*

Archive names, with the .cmxa extension, but without the directory.

*)
location : string;
dependencies : package list;(*

Transitive closure, as returned by ocamlfind query -r.

*)
}

Package information.

val query : string -> package

Query information about a package, given its name. May raise Not_found.

val list : unit -> string list

Return the names of all known packages.

val topological_closure : package list -> package list

Computes the transitive closure of a list of packages and sort them in topological order. Given any list of package l, topological_closure l returns a list of packages including l and their dependencies, in an order where any element may only depend on the previous ones.

val include_flags : package list -> command_spec

Return the list of include directories.

val compile_flags_byte : package list -> command_spec

Return the flags to add when compiling in byte mode (include directories).

val compile_flags_native : package list -> command_spec

Same as compile_flags_byte but for native mode.

Return the flags to add when linking in byte mode. It includes: include directories, libraries and special link options.

Same as link_flags_byte but for native mode.