From c1f275bfa644beafab9f8572351d4b64d61c148b Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 6 May 2018 20:09:49 +0530 Subject: gnome.gtkdoc: Allow passing file objects as xml_files If we pass a source files() object, we will look for it in the build directory, which is wrong. If we pass a build files() object (from configure_file()), we will find it in the build directory, and then try to copy it on top of itself in gtkdochelper.py getting a SameFileError. Add a test for it, and also properly iterate custom target outputs when adding to content files. --- mesonbuild/scripts/gtkdochelper.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mesonbuild/scripts/gtkdochelper.py') 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: -- cgit v1.1