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
pull/2800/head
Ting-Wei Lan 7 years ago
parent fd66692f73
commit 08113da388
  1. 2
      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:

Loading…
Cancel
Save