aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2017-12-18 17:46:25 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2018-01-07 01:45:47 +0800
commit08113da388f33fc85151d872f317bc2daacafba1 (patch)
treebedebafee66c8c60d68bd49aed3c7ad1a8c6fa9e /mesonbuild/modules
parentfd66692f73efb80783172b9d346ae4a5b6b6fa6d (diff)
downloadmeson-08113da388f33fc85151d872f317bc2daacafba1.zip
meson-08113da388f33fc85151d872f317bc2daacafba1.tar.gz
meson-08113da388f33fc85151d872f317bc2daacafba1.tar.bz2
gnome.gtkdoc: Pass *FLAGS set in the environment to gtkdoc-scangobj
GLib-based libraries and applications require gettext library to compile and link. On non-GNU systems such as FreeBSD, gettext is not included in libc and it is required to pass '-L/usr/local/lib -lintl' to the linker to satisfy the dependency on gettext. The pkg-config file provided by GLib already has '-lintl', but users still have to remember to put '-L/usr/local/lib' into LDFLAGS. If we don't pass LDFLAGS to gtkdoc-scangobj, the linker will not be able to find '-lintl' when no dependencies of the project provides '-L/usr/local/lib'. Since all *FLAGS are commonly used in many build systems, this commit adds support for not only LDFLAGS but also CFLAGS and CPPFLAGS. Fixes #1724
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/gnome.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index ad99c14..89210a9 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -823,6 +823,8 @@ This will become a hard error in the future.''')
raise MesonException(
'Gir include dirs should be include_directories().')
cflags.update(get_include_args(inc_dirs))
+ cflags.update(state.environment.coredata.external_args['c'])
+ ldflags.update(state.environment.coredata.external_link_args['c'])
if cflags:
args += ['--cflags=%s' % ' '.join(cflags)]
if ldflags: