meson: Add PYTHONPATH to load GDB helper module
authorXavier Claessens <xavier.claessens@collabora.com>
Fri, 25 Feb 2022 21:54:37 +0000 (16:54 -0500)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 22 Apr 2022 11:53:31 +0000 (11:53 +0000)
Meson generates a gdbinit file that will automatically load gstreamer
script. However that script uses a helper python module that needs
PYTHONPATH to be pointing into the right location in the source
tree to be able to find gst_gdb.py.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1796>

subprojects/gstreamer/libs/gst/helpers/meson.build

index 290c84bb0f7019c6300c0f618cbcc383f46c1448..4aeacd12174eda86e934bac9b515e19f5fa59ba1 100644 (file)
@@ -128,6 +128,11 @@ install_data(['gst_gdb.py', 'glib_gobject_helper.py'],
   install_dir : join_paths(get_option('datadir'), 'gstreamer-@0@'.format(apiversion), 'gdb'),
   install_tag : 'devel')
 
+# This is needed to make gdb find gst_gdb.py
+env = environment()
+env.prepend('PYTHONPATH', meson.current_source_dir())
+meson.add_devenv(env)
+
 gdbconf = configuration_data()
 gdbconf.set('GST_API_VERSION', apiversion)
 gdbconf.set('DATADIR', '@0@/@1@'.format(get_option('prefix'), get_option('datadir')))