Xavier Claessens
April 18, 2023
Reading time:

Want to develop your Meson project in a modern IDE? Make sure to install Meson VSCode extension which is now fully functional with the recent release of Meson 1.1.0!
VSCode, like its fully open-source sibling VSCodium, is a popular IDE (integrated development environment) from Microsoft that is highly configurable with extensions. Meson is the open source build system used by most GNOME and Freedesktop projects. Meson provides introspection data to integrate your project into your IDE, for tasks such as building and running your project. Meson also provides an official VSCode extension that uses that information to provide all functionalities presented here.
Examples below require a recent version of Meson and its VSCode extension:
The extension provides complete Meson language grammar support for meson.build and meson_options.txt files.
The first time a Meson project is opened, VSCode will ask if you wish to configure it. By default it will run meson setup builddir, default options are configuration in the extension settings.
Once your project is configured, or if it was already configured manually in builddir/, the extension will:
All tasks can be found in Terminal → Run Task..., or with Ctrl+Shift+P shortcut, search for meson in the dropdown menu.
The default build task will (re)compile the whole project. It can be triggered with Ctrl+Shift+B shortcut.
In addition, individual targets can be compiled by simply clicking them in the Meson sidebar. At the top you'll find the main project targets; subproject targets can be found below.
Each target also has an open icon to open the meson.build file where that target is defined and a submenu that lists all source files used to build that target. This allows browsing the project source tree by targets instead of relying on the filesystem hierarchy.
Likewise, the sidebar contains all unit tests that are sorted per subproject. Clicking one of them will run it.
To run all tests from all subprojects at once, search Meson: Run tests in the Terminal → Run Task... menu, or Ctrl+Shift+P → Meson: Run Unit Tests → all.
If Microsoft's Intellisense extension is installed, it will be automatically configured to use the compile_commands.json file generated by Meson in your build directory. This allows VSCode's C and C++ syntax analyzer to find and include the paths and CFLAGS needed.
Meson provides a developer environment to run executables from your project without installing it. It consists on a set of environment variables that needs to be set in order to properly run the project, such as LD_LIBRARY_PATH, GST_PLUGIN_PATH (GStreamer), etc.
The Meson VSCode extension exports that environment into a file that can be used by VSCode's launch.json file's envFile attribute.
If your project provides a .vscode/launch.json file, F5 will run the program in the debugger, allowing you to inspect a variable's value and step line by line into your code directly in VSCode.
See GStreamer's launch.json file as example: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/.vscode/launch.json.
07/05/2026
A complete breakdown of Mesa’s NIR compiler detailing how it optimizes shader memory access with SSA promotion, deref analysis, copy propagation,…
05/05/2026
Collabora brought Bluetooth Auracast broadcasting to MediaTek Genio 700 for Embedded World 2026. Here's the complete, fully Open Source…
22/04/2026
Using our XR expertise, Collabora created a standalone XR experience for our 1% for the Planet partner, SOMAR, to showcase the direct impact…
17/04/2026
BitNet-style ternary brings LLM inference to ExecuTorch via its Vulkan backend, enabling much smaller, bandwidth-efficient models with portable…
23/03/2026
PanVK’s new framebuffer abstraction for Mali GPUs removes OpenGL-specific constraints, unlocking more flexible tiled rendering features…
02/03/2026
Get the recap of Nicolas Frattaroli's FOSDEM talk detailing Rockchip’s mainline progress, including Vulkan 1.4 and NPU support as a vital…