8 def accept_command(commands):
9 """Search @commands and returns the first found absolute path."""
10 for command in commands:
11 command = shutil.which(command)
17 if __name__ == "__main__":
18 ninja = accept_command(["ninja", "ninja-build"])
19 buildroot = os.environ["MESON_BUILD_ROOT"]
22 if len(sys.argv) > 1 and sys.argv[1] == "bindinate":
25 print("Building all code")
26 subprocess.check_call([ninja, "-C", buildroot])
28 if 'gstreamer-sharp' in os.environ['MESON_SUBDIR']:
29 subproject_prefix = 'gstreamer-sharp@@'
31 subproject_prefix = ''
34 print("Bindinate GStreamer")
35 subprocess.check_call([ninja, "-C", buildroot, subproject_prefix + "bindinate_gstreamer"])
37 print("Update GStreamer bindings")
38 subprocess.check_call([ninja, "-C", buildroot, subproject_prefix + "update_gstreamer_code"])
41 print("Bindinate GES")
42 subprocess.check_call([ninja, "-C", buildroot, subproject_prefix + "bindinate_ges"])
43 print("Update GES bindings")
44 subprocess.check_call([ninja, "-C", buildroot, subproject_prefix + "update_ges_code"])
46 print("Building all code")
47 subprocess.check_call([ninja, "-C", buildroot])