The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.1 KiB
3.1 KiB
Pkgconfig module
This module is a simple generator for pkg-config files.
Usage
To use this module, just do: pkg = import('pkgconfig')
. The
following function will then be available as pkg.generate()
. You
can, of course, replace the name pkg
with anything else.
pkg.generate()
The generated file's properties are specified with the following keyword arguments.
description
a string describing the library, used to set theDescription:
fieldextra_cflags
a list of extra compiler flags to be added to theCflags
field after the header search pathfilebase
the base name to use for the pkg-config file; as an example, the value oflibfoo
would produce a pkg-config file calledlibfoo.pc
install_dir
the directory to install to, defaults to the value of optionlibdir
followed by/pkgconfig
libraries
a list of built libraries (usually results of shared_library) that the user needs to link against. Arbitrary strings can also be provided and they will be added into theLibs
field. Since 0.45.0 dependencies of built libraries will be automatically added toLibs.private
field. If a dependency is provided by pkg-config then it will be added inRequires.private
instead. Other type of dependency objects can also be passed and will result in theirlink_args
andcompile_args
to be added toLibs
andCflags
fields.libraries_private
list of built libraries or strings to put in theLibs.private
field. Since 0.45.0 it can also contain dependency objects, theirlink_args
will be added toLibs.private
.name
the name of this library, used to set theName:
fieldsubdirs
which subdirs ofinclude
should be added to the header search path, for example if you install headers into${PREFIX}/include/foobar-1
, the correct value for this argument would befoobar-1
requires
list of strings, pkgconfig-dependencies or libraries thatpkgconfig.generate()
was used on to put in theRequires
fieldrequires_private
same asrequires
but forRequires.private
field fieldurl
a string with a url for the libraryvariables
a list of strings with custom variables to add to the generated file. The strings must be in the formname=value
and may reference other pkgconfig variables, e.g.datadir=${prefix}/share
. The namesprefix
,libdir
andinstalldir
are reserved and may not be used.version
a string describing the version of this library, used to set theVersion:
field. Defaults to the project version if unspecified.d_module_versions
a list of module version flags used when compiling D sources referred to by this pkg-config file
Since 0.46 a StaticLibrary
or SharedLibrary
object can optionally be passed
as first positional argument. If one is provided a default value will be
provided for all required fields of the pc file:
install_dir
is set topkgconfig
folder in the same location than the provided library.description
is set to the project's name followed by the library's name.name
is set to the library's name.