aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-05-09 23:11:57 +0200
committerGitHub <noreply@github.com>2018-05-09 23:11:57 +0200
commit05e4298dc5f20ddc4bf8702c1fbedb21986c2a4c (patch)
treeff3477c59509d81564a4310ddcd49b27439ac801 /mesonbuild
parented701b5cb0b628c632a916defcbdda312cb00197 (diff)
parent86cc4f27072bede2a6f7ed2879b2786529e3204f (diff)
downloadmeson-05e4298dc5f20ddc4bf8702c1fbedb21986c2a4c.zip
meson-05e4298dc5f20ddc4bf8702c1fbedb21986c2a4c.tar.gz
meson-05e4298dc5f20ddc4bf8702c1fbedb21986c2a4c.tar.bz2
Merge pull request #3539 from mesonbuild/nirbheek/fix-gtkdoc-content-files-File
gnome: some gtk-doc and gdbus-codegen issues
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mintro.py9
-rw-r--r--mesonbuild/modules/gnome.py18
-rw-r--r--mesonbuild/scripts/gtkdochelper.py9
3 files changed, 25 insertions, 11 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 5a9d4cf..81c70ed 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -21,6 +21,7 @@ project files and don't need this info."""
import json
from . import build, mtest, coredata as cdata
+from . import mesonlib
from .backend import ninjabackend
import argparse
import sys, os
@@ -118,8 +119,12 @@ def list_target_files(target_name, coredata, builddata):
except KeyError:
print("Unknown target %s." % target_name)
sys.exit(1)
- sources = [os.path.join(i.subdir, i.fname) for i in sources]
- print(json.dumps(sources))
+ out = []
+ for i in sources:
+ if isinstance(i, mesonlib.File):
+ i = os.path.join(i.subdir, i.fname)
+ out.append(i)
+ print(json.dumps(out))
def list_buildoptions(coredata, builddata):
optlist = []
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 12f6412..da72a1f 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -793,11 +793,13 @@ This will become a hard error in the future.''')
s = s.held_object
if isinstance(s, (build.CustomTarget, build.CustomTargetIndex)):
depends.append(s)
- content_files.append(os.path.join(state.environment.get_build_dir(),
- state.backend.get_target_dir(s),
- s.get_outputs()[0]))
+ for o in s.get_outputs():
+ content_files.append(os.path.join(state.environment.get_build_dir(),
+ state.backend.get_target_dir(s),
+ o))
elif isinstance(s, mesonlib.File):
- content_files.append(os.path.join(state.environment.get_build_dir(), s.subdir, s.fname))
+ content_files.append(s.absolute_path(state.environment.get_source_dir(),
+ state.environment.get_build_dir()))
elif isinstance(s, build.GeneratedList):
depends.append(s)
for gen_src in s.get_outputs():
@@ -879,7 +881,7 @@ This will become a hard error in the future.''')
if len(args) not in (1, 2):
raise MesonException('Gdbus_codegen takes at most two arguments, name and xml file.')
namebase = args[0]
- xml_files = [args[1:]]
+ xml_files = args[1:]
target_name = namebase + '-gdbus'
cmd = [self.interpreter.find_program_impl('gdbus-codegen')]
if 'interface_prefix' in kwargs:
@@ -936,9 +938,13 @@ This will become a hard error in the future.''')
docbook_cmd = cmd + ['--output-directory', '@OUTDIR@', '--generate-docbook', docbook, '@INPUT@']
+ # The docbook output is always ${docbook}-${name_of_xml_file}
output = namebase + '-docbook'
+ outputs = []
+ for f in xml_files:
+ outputs.append('{}-{}'.format(docbook, f))
custom_kwargs = {'input': xml_files,
- 'output': output,
+ 'output': outputs,
'command': docbook_cmd,
'build_by_default': build_by_default
}
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
index 3fe7fb7..2895991 100644
--- a/mesonbuild/scripts/gtkdochelper.py
+++ b/mesonbuild/scripts/gtkdochelper.py
@@ -93,9 +93,12 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
# Copy files to build directory
for f in content_files:
- f_abs = os.path.join(doc_src, f)
- shutil.copyfile(f_abs, os.path.join(
- abs_out, os.path.basename(f_abs)))
+ # FIXME: Use mesonlib.File objects so we don't need to do this
+ if not os.path.isabs(f):
+ f = os.path.join(doc_src, f)
+ elif os.path.commonpath([f, build_root]) == build_root:
+ continue
+ shutil.copyfile(f, os.path.join(abs_out, os.path.basename(f)))
shutil.rmtree(htmldir, ignore_errors=True)
try: