uninstalled: use build and source root

This commit is contained in:
Mathieu Duponchelle 2017-04-06 00:25:31 +02:00
parent 4df327a69b
commit 12b1289519
2 changed files with 12 additions and 2 deletions

View file

@ -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:

View file

@ -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')