diff --git a/doc/manual.org b/doc/manual.org index 444d3563..1344ac8f 100644 --- a/doc/manual.org +++ b/doc/manual.org @@ -375,6 +375,12 @@ the library and you are free to expose only the modules you want. =bar=, you should typically write =-lbar= here, or whatever flags are necessary to to link against this library. +- =(self_build_stubs_archive )= indicates to Jbuilder that + the library has stubs, but that the stubs are built manually. The + aim of the field is to embed a library written in foreign language + and/or building with another build system. It is not for casual + uses, see the [[https://github.com/janestreet/re2][re2 library]] for an example of use + Note that when binding C libraries, Jbuilder doesn't provide special support for tools such as =pkg-config=, however it integrates easily with [[https://github.com/janestreet/configurator][configurator]] by using =(c_flags (:include ...))= and diff --git a/src/jbuild_types.ml b/src/jbuild_types.ml index 46401c5c..d3776635 100644 --- a/src/jbuild_types.ml +++ b/src/jbuild_types.ml @@ -435,6 +435,7 @@ module Library = struct field "kind" Kind.t ~default:Kind.Normal >>= fun kind -> field "wrapped" bool ~default:true >>= fun wrapped -> field_b "optional" >>= fun optional -> + field "self_build_stubs_archive" (option string) ~default:None >>= fun self_build_stubs_archive -> return { name ; public @@ -450,7 +451,7 @@ module Library = struct ; includes = [] ; library_flags ; c_library_flags - ; self_build_stubs_archive = None + ; self_build_stubs_archive ; js_of_ocaml ; virtual_deps ; wrapped