From 12b128951920076f35e60e1b57d1132f6a2d4708 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 6 Apr 2017 00:25:31 +0200 Subject: [PATCH] uninstalled: use build and source root --- gst-uninstalled.py | 11 ++++++++++- meson.build | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gst-uninstalled.py b/gst-uninstalled.py index 22cbfae..0e34975 100755 --- a/gst-uninstalled.py +++ b/gst-uninstalled.py @@ -173,6 +173,9 @@ if __name__ == "__main__": parser.add_argument("--builddir", default=os.path.join(SCRIPTDIR, "build"), help="The meson build directory") + parser.add_argument("--srcdir", + default=SCRIPTDIR, + help="The top level source directory") parser.add_argument("--gst-version", default="master", help="The GStreamer major version") options, args = parser.parse_known_args() @@ -182,6 +185,11 @@ if __name__ == "__main__": options.builddir) exit(1) + if not os.path.exists(options.srcdir): + print("The specified source dir does not exist" % + options.srcdir) + exit(1) + if not args: if os.name is 'nt': args = [os.environ.get("COMSPEC", r"C:\WINDOWS\system32\cmd.exe")] @@ -200,7 +208,8 @@ if __name__ == "__main__": args.append(tmprc.name) python_set = python_env(options) try: - exit(subprocess.call(args, env=get_subprocess_env(options))) + exit(subprocess.call(args, cwd=options.srcdir, + env=get_subprocess_env(options))) except subprocess.CalledProcessError as e: exit(e.returncode) finally: diff --git a/meson.build b/meson.build index ea5d80d..6193f9b 100644 --- a/meson.build +++ b/meson.build @@ -110,7 +110,8 @@ foreach subproj: subprojects endforeach setenv = find_program('gst-uninstalled.py') -run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.current_build_dir()), +run_target('uninstalled', command : [setenv, '--builddir=@0@'.format(meson.build_root()), + '--srcdir=@0@'.format(meson.source_root()), '--gst-version=@0@'.format(gst_branch)]) update = find_program('git-update') -- 2.7.4