Skip to content

Add Visual Studio Code integration

Andoni Morales Alastruey requested to merge ylatuya/gstreamer:vscode into main

This MR adds Visual Studio Code integration though launch.json to build and debug GStreamer directly from VSCode. Most of the work originally proposed in this MR is now done by the meson VSCode extension.

It contains the following elements:

  • tasks.json: defines the meson configure and the ninja build tasks
  • launch.json: configure how the application is launched and debugged
  • c_cpp_properties.json: configure the compiler for static analysis
  • generate_ide_env_file.py: create a file with the env variables needed to run uninstalled
  • start-vscode.cmd: helper script to launch VSCode in Windows

A new GstIDEEnv file is generated in the build directory. This file includes the environment variables needed to run GStreamer uninstalled using the envFile property in launch.json. In Windows this property doesn't work, we instead provide a launcher script that starts VSCode with the Visual Studio build tools environment and the GStreamer environment set.

In macOS, VSCode needs to be started from the command line using gst-env.py until https://github.com/lldb-tools/lldb-mi/pull/87 is merged.

I couldn't test it in Linux yet, some help would be useful.

Edited by Andoni Morales Alastruey

Merge request reports