gstreamer/scripts/generate_plugins_path.py
Thibault Saunier 802e18519b Avoid making a dependency between plugins and the build.ninja file
Basically meson detects that we pass file paths to run_command to regenerate the build.ninja file when those change
2019-05-15 23:23:46 -04:00

19 lines
572 B
Python

#!/usr/bin/env python3
import argparse
import os
import json
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--builddir", help="The meson build directory")
parser.add_argument(dest="plugins", help="The list of plugins")
options = parser.parse_args()
all_paths = set()
for plugin in options.plugins.split(os.pathsep):
all_paths.add(os.path.dirname(plugin))
with open(os.path.join(options.builddir, 'GstPluginsPath.json'), "w") as f:
json.dump(list(all_paths), f, indent=4, sort_keys=True)