From adc52798db749627c824258237d11000bded9814 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 14 Apr 2019 13:32:33 +0100 Subject: [PATCH] README: mentions how to specify header/library path Closes #155 Signed-off-by: Yuxuan Shui --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6536a65..8ccea1b 100644 --- a/README.md +++ b/README.md @@ -54,14 +54,22 @@ $ meson --buildtype=release . build $ ninja -C build ``` -On FreeBSD, `ld` does not look by default in /usr/local/lib, and you will get errors about some libraries being not found. -To fix that, prepend `LDFLAGS="-L/usr/local/lib"`: +Built binary can be found in `build/src` + +If you have libraries and/or headers installed at non-default location (e.g. under `/usr/local/`), you might need to tell meson about them, since meson doesn't look for dependencies there by default. + +You can do that by setting the `CPPFLAGS` and `LDFLAGS` environment variables when running `meson`. Like this: + ```bash -$ LDFLAGS="-L/usr/local/lib" meson --buildtype=release . build -$ ninja -C build +$ LDFLAGS="-L/path/to/libraries" CPPFLAGS="-I/path/to/headers" meson --buildtype=release . build + ``` -Built binary can be found in `build/src` +As an example, on FreeBSD, you might have to run meson with: +```bash +$ LDFLAGS="-L/usr/local/include" CPPFLAGS="-I/usr/local/include" meson --buildtype=release . build +$ ninja -C build +``` ### To install