aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-06-18 11:22:46 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-19 12:06:43 +0000
commit737f61792cc33dd5f234c961bc2ab850be3f9959 (patch)
treee2f7298321649d3b68ccfb49f374341b49fd40ee
parent4aa848d5d6b5d85aa02abcdd445770db801e0b0c (diff)
downloadmeson-737f61792cc33dd5f234c961bc2ab850be3f9959.zip
meson-737f61792cc33dd5f234c961bc2ab850be3f9959.tar.gz
meson-737f61792cc33dd5f234c961bc2ab850be3f9959.tar.bz2
gtkdoc: Fix dependencies not being built before invoking gtkdoc
In GLib when running "ninja gio-doc" without doing a full build first, it won't build libraries and the generated gio-scan.c gets linked against system libgio instead. This fix 2 bugs: gtkdoc() was not passing 'depends' variable down to _get_dependencies_flags(), and many places had 'if depends' which is False when 'depends' is an empty list and not only when it's None. There is no reason for that argument to be optional, we always want to collect dependencies.
-rw-r--r--mesonbuild/modules/gnome.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index ef849cd..6a0108a 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -288,7 +288,7 @@ class GnomeModule(ExtensionModule):
dep_files.append(f)
return dep_files, depends, subdirs
- def _get_link_args(self, state, lib, depends=None, include_rpath=False,
+ def _get_link_args(self, state, lib, depends, include_rpath=False,
use_gir_args=False):
link_command = []
# Construct link args
@@ -306,15 +306,14 @@ class GnomeModule(ExtensionModule):
link_command.append('-Wl,-rpath,' + d)
if include_rpath:
link_command.append('-Wl,-rpath,' + libdir)
- if depends:
- depends.append(lib)
+ depends.append(lib)
if gir_has_extra_lib_arg(self.interpreter) and use_gir_args:
link_command.append('--extra-library=' + lib.name)
else:
link_command.append('-l' + lib.name)
return link_command
- def _get_dependencies_flags(self, deps, state, depends=None, include_rpath=False,
+ def _get_dependencies_flags(self, deps, state, depends, include_rpath=False,
use_gir_args=False):
cflags = OrderedSet()
ldflags = OrderedSet()
@@ -371,6 +370,7 @@ class GnomeModule(ExtensionModule):
gi_includes.update([girdir])
elif isinstance(dep, (build.StaticLibrary, build.SharedLibrary)):
cflags.update(get_include_args(dep.get_include_dirs()))
+ depends.append(dep)
else:
mlog.log('dependency {!r} not handled to build gir files'.format(dep))
continue
@@ -823,16 +823,16 @@ This will become a hard error in the future.''')
args += self._unpack_args('--expand-content-files=', 'expand_content_files', kwargs, state)
args += self._unpack_args('--ignore-headers=', 'ignore_headers', kwargs)
args += self._unpack_args('--installdir=', 'install_dir', kwargs, state)
- args += self._get_build_args(kwargs, state)
+ args += self._get_build_args(kwargs, state, depends)
res = [build.RunTarget(targetname, command[0], command[1:] + args, depends, state.subdir, state.subproject)]
if kwargs.get('install', True):
res.append(build.RunScript(command, args))
return ModuleReturnValue(None, res)
- def _get_build_args(self, kwargs, state):
+ def _get_build_args(self, kwargs, state, depends):
args = []
deps = extract_as_list(kwargs, 'dependencies', unholder=True)
- cflags, ldflags, gi_includes = self._get_dependencies_flags(deps, state, include_rpath=True)
+ cflags, ldflags, gi_includes = self._get_dependencies_flags(deps, state, depends, include_rpath=True)
inc_dirs = mesonlib.extract_as_list(kwargs, 'include_directories')
for incd in inc_dirs:
if not isinstance(incd.held_object, (str, build.IncludeDirs)):