Adventures with the Meson Build System and a GTK Playground
This post describes some of my experience with the Meson Build system. Also I have created a playground for GTK which I use to create simple protoypes with some functionality. The really nice thing about Meson is its python-ish/lua-ish syntax. The other thing is that it is really fast.
My experience #
As a newbie I found Automake unfriendly (maybe because of its primitive m4 macro system). So I was looking for something quick to learn for building my LibGamepad library. Initially I opted for the awesome Autovala. But then I realized that while super-easy, it was not flexible. I wanted conditional compilation (per-platform) but could not do it. Then while I was looking at the CMake files generated by Autovala, they too felt kind of cryptic, so I decided to start from scratch and write the CMake files on my own. Still even CMake's syntax was kind of weird and macro-ish. Then I tried a hand at Meson. Surprisingly I was able to easily build simple Vala programs without giving it much time.
The neat language #
In Meson, you feel like you are interacting with a higher-order language. You get immutable arrays and strings. Your interaction with the compiler modules is through objects. In short, its just amazing. I could have elaborated this section and written some features, but then you can find it on the Meson Wiki.
Some reference links #
- Tutorial: https://github.com/mesonbuild/meson/wiki/Tutorial
- Indepth Tutorial: https://github.com/mesonbuild/meson/wiki/IndepthTutorial
- Vala example: https://github.com/mesonbuild/meson/wiki/Vala
- GNOME module: https://github.com/mesonbuild/meson/wiki/Gnome-module
- Reference Manual: https://github.com/mesonbuild/meson/wiki/Reference-Manual
- Note: On Fedora it is
ninja-build
and notninja
A GTK Playground / A starter kit #
Ever want to prototype some mockup without fiddling with your main application? I created a small playground which I use for creating prototypes https://github.com/meghprkh/valagtk . You can simply open Glade, create your prototype and add some interactivity using GtkTemplate in your Vala code and BOOM! This uses the Meson build system to give you an easy-to-extend starter along with super-fast builds.
Please leave your comments in the comments section =).
- Previous: GSoC - Progress so far
- Next: The state of gamepad support in Games