aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-19 08:20:06 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-02-20 23:32:04 +0530
commitdabf0c1882772700fed2c6c18ca06919a8bc280d (patch)
tree2162f117ab22017d4c83016f8e6a2f116e76dc0c /mesonbuild/modules/gnome.py
parentcb0aa6a83a53afd61572219c1a81f1395d4c4603 (diff)
downloadmeson-dabf0c1882772700fed2c6c18ca06919a8bc280d.zip
meson-dabf0c1882772700fed2c6c18ca06919a8bc280d.tar.gz
meson-dabf0c1882772700fed2c6c18ca06919a8bc280d.tar.bz2
gnome: Support configure_file() output in compile_resources
We can't support generated XML files with custom_target() because the dependency scanning happens at configure time, but we *can* support generating them with configure_file(). Closes https://github.com/mesonbuild/meson/issues/1380
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r--mesonbuild/modules/gnome.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 7338205..4687e81 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -105,7 +105,13 @@ can not be used with the current version of glib-compiled-resources, due to
ifile = args[1]
if isinstance(ifile, mesonlib.File):
- ifile = os.path.join(ifile.subdir, ifile.fname)
+ # glib-compile-resources will be run inside the source dir,
+ # so we need either 'src_to_build' or the absolute path.
+ # Absolute path is the easiest choice.
+ if ifile.is_built:
+ ifile = os.path.join(state.environment.get_build_dir(), ifile.subdir, ifile.fname)
+ else:
+ ifile = os.path.join(ifile.subdir, ifile.fname)
elif isinstance(ifile, str):
ifile = os.path.join(state.subdir, ifile)
elif isinstance(ifile, (interpreter.CustomTargetHolder,
@@ -206,9 +212,10 @@ can not be used with the current version of glib-compiled-resources, due to
cmd += ['--sourcedir', os.path.join(state.subdir, source_dir)]
cmd += ['--sourcedir', state.subdir] # Current dir
- pc, stdout = Popen_safe(cmd, cwd=state.environment.get_source_dir())[0:2]
+ pc, stdout, stderr = Popen_safe(cmd, cwd=state.environment.get_source_dir())
if pc.returncode != 0:
- mlog.warning('glib-compile-resources has failed to get the dependencies for {}'.format(cmd[1]))
+ m = 'glib-compile-resources failed to get dependencies for {}:\n{}'
+ mlog.warning(m.format(cmd[1], stderr))
raise subprocess.CalledProcessError(pc.returncode, cmd)
dep_files = stdout.split('\n')[:-1]