Meson: Fix useless reconfigure when plugins libs change
authorXavier Claessens <xavier.claessens@collabora.com>
Wed, 11 Mar 2020 17:49:11 +0000 (13:49 -0400)
committerXavier Claessens <xavier.claessens@collabora.com>
Wed, 11 Mar 2020 17:49:11 +0000 (13:49 -0400)
This is a workaround for a Meson bug that incorrectly trigger
reconfigure when files change in build directory. This commit can be
reverted once GStreamer depends on Meson >=0.54.0.
See https://github.com/mesonbuild/meson/pull/6770

Fixes: #85

meson.build
scripts/generate_init_static_plugins.py
scripts/generate_plugins_path.py

index 1209c8b..4055415 100644 (file)
@@ -170,6 +170,9 @@ all_plugins_paths = []
 foreach plugin: all_plugins
   all_plugins_paths += plugin.full_path()
 endforeach
+# Work around meson bug: https://github.com/mesonbuild/meson/pull/6770
+pathsep = host_machine.system() == 'windows' ? ';' : ':'
+all_plugins_paths = pathsep.join(all_plugins_paths)
 
 generate_plugins_paths = find_program('scripts/generate_plugins_path.py')
 configure_file(
index d7a13e2..c2ed122 100644 (file)
@@ -19,12 +19,12 @@ gst_init_static_plugins (void)
 if __name__ == "__main__":
     parser = argparse.ArgumentParser()
     parser.add_argument(dest="output", help="Output file")
-    parser.add_argument(dest="plugins", nargs=argparse.REMAINDER, help="The list of plugins")
+    parser.add_argument(dest="plugins", help="The list of plugins")
 
     options = parser.parse_args()
 
     names = set()
-    for plugin in options.plugins:
+    for plugin in options.plugins.split(os.pathsep):
         filename = os.path.basename(plugin)
         if filename.startswith('libgst') and filename.endswith('.a'):
             names.add(filename[len('libgst'):-len('.a')])
index 17a38f1..d609639 100644 (file)
@@ -7,12 +7,12 @@ import json
 if __name__ == "__main__":
     parser = argparse.ArgumentParser()
     parser.add_argument(dest="output", help="Output file")
-    parser.add_argument(dest="plugins", nargs=argparse.REMAINDER, help="The list of plugins")
+    parser.add_argument(dest="plugins", help="The list of plugins")
 
     options = parser.parse_args()
 
     all_paths = set()
-    for plugin in options.plugins:
+    for plugin in options.plugins.split(os.pathsep):
         all_paths.add(os.path.dirname(plugin))
 
     with open(options.output, "w") as f: