From fbd193b27c2d2e7eecff29db6af017230778f55d Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 29 Oct 2020 08:02:49 +0100 Subject: [PATCH] doc: document pkgconfig (#6687) --- doc/docs.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/docs.md b/doc/docs.md index ef8ea8bd51..ab08a8458e 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -2417,6 +2417,25 @@ NB: Each flag must go on its own line (for now) #flag linux -DIMGUI_IMPL_API= ``` +### #pkgconfig + +Add `#pkgconfig` directive is used to tell the compiler which modules should be used for compiling +and linking using the pkg-config files provided by the respective dependencies. + +As long as backticks can't be used in `#flag` and spawning processes is not desirable for security +and portability reasons, V uses its own pkgconfig library that is compatible with the standard +freedesktop one. + +If no flags are passed it will add `--cflags` and `--libs`, both lines below do the same: + +```v +#pkgconfig r_core +#pkgconfig --cflags --libs r_core +``` + +The `.pc` files are looked up into a hardcoded list of default pkg-config paths, the user can add +extra paths by using the `PKG_CONFIG_PATH` environment variable. Multiple modules can be passed. + ### Including C code You can also include C code directly in your V module.