doc: document pkgconfig (#6687)
parent
ce7da85166
commit
fbd193b27c
19
doc/docs.md
19
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.
|
||||
|
|
Loading…
Reference in New Issue