library_parameter¶
Warning
This feature is experimental and requires the compiler you are using to support parameterised libraries.
The library_parameter stanza describes a parameter interface defined in a single .mli file. To enable this feature,
you need to add (using oxcaml 0.1) extension in your dune-project file.
- (library_parameter ...)
Added in version 3.20.
Define a parameter.
- (name <parameter-name>)
parameter-nameis the name of the library parameter. It must be a valid OCaml module name as for library.This must be specified if no public_name is specified.
- (public_name ...)
The name under which the library parameter can be referred as a dependency when it’s not part of the current workspace, i.e., when it is installed. Without a
(public_name ...)field, the library parameter won’t be installed by Dune. The public name must start with the package name it’s part of and optionally followed by a dot, then anything else you want. The package name must also be one of the packages that Dune knows about, as determined by the logic described in Packages.
- (package <package>)
Installs a private library parameter under the specified package. Such a parameter is now usable by public libraries defined in the same project.
- (synopsis <string>)
A one-line description of the library parameter.
- (modules <modules>)
Specifies a specific module to select as a library_parameter.
<modules>uses the Ordered Set Language, where elements are module names and don’t need to start with an uppercase letter.The library parameter must only declare one
mlifile as part of its modules.
- (libraries <library-dependencies>)
Specifies the library parameter’s dependencies.
See Library Dependencies for more details.
- (preprocesss <preprocess-spec>)
Specifies how to preprocess files when needed.
The default is
no_preprocessing, and other options are described in Preprocessing Specification.
- (preprocessor_deps (<deps-conf list>))
Specifies extra preprocessor dependencies preprocessor, i.e., if the preprocessor reads a generated file.
The specification of dependencies is described in Dependency Specification.
- (flags ...)
See OCaml Flags.
- (ocamlc_flags ...)
See OCaml Flags.
- (ocamlopt_flags ...)
See OCaml Flags.
- (optional)
If present, it indicates that the library parameter should only be built and installed if all the dependencies are available, either in the workspace or in the installed world.
- (enabled_if <blang expression>)
Conditionally disables a library parameter.
A disabled library parameter cannot be built and will not be installed.
The condition is specified using the Boolean Language, and the field allows for the
%{os_type}variable, which is expanded to the type of OS being targeted by the current build. Its value is the same as the value of theos_typeparameter in the output ofocamlc -config.
- (allow_overlapping_dependencies)
Allows external dependencies to overlap with libraries that are present in the workspace.