Use Configurator.V1 in the docs as example for cstubs
Signed-off-by: Manas <prometheansacrifice@gmail.com>
This commit is contained in:
parent
753da98784
commit
f643fea885
|
@ -207,17 +207,13 @@ as well as this ``discover.ml`` file:
|
|||
|
||||
.. code:: ocaml
|
||||
|
||||
open Base
|
||||
open Stdio
|
||||
module C = Configurator
|
||||
|
||||
let write_sexp fn sexp =
|
||||
Out_channel.write_all fn ~data:(Sexp.to_string sexp)
|
||||
module C = Configurator.V1
|
||||
|
||||
let () =
|
||||
C.main ~name:"mylib" (fun c ->
|
||||
C.main ~name:"foo" (fun c ->
|
||||
let default : C.Pkg_config.package_conf =
|
||||
{ libs = ["-lblah"]
|
||||
{ libs = ["-lgst-editing-services-1.0"]
|
||||
; cflags = []
|
||||
}
|
||||
in
|
||||
|
@ -225,11 +221,15 @@ as well as this ``discover.ml`` file:
|
|||
match C.Pkg_config.get c with
|
||||
| None -> default
|
||||
| Some pc ->
|
||||
Option.value (C.Pkg_config.query pc ~package:"blah") ~default
|
||||
match (C.Pkg_config.query pc ~package:"gst-editing-services-1.0") with
|
||||
| None -> default
|
||||
| Some deps -> deps
|
||||
in
|
||||
|
||||
write_sexp "c_flags.sexp" (sexp_of_list sexp_of_string conf.cflags);
|
||||
write_sexp "c_library_flags.sexp" (sexp_of_list sexp_of_string conf.libs))
|
||||
|
||||
C.Flags.write_sexp "c_flags.sexp" conf.cflags;
|
||||
C.Flags.write_sexp "c_library_flags.sexp" conf.libs)
|
||||
|
||||
|
||||
Using a custom code generator
|
||||
=============================
|
||||
|
|
Loading…
Reference in New Issue