[build2] Custom Configuration Variables for the Config Module

Markus Pawellek markus.pawellek at mailbox.org
Thu Jul 16 21:45:13 UTC 2020


Hello,

currently and as an exercise, I am porting the build system
of the GLFW library from CMake to build2 for Linux platforms.
Due to simplicity, I have only done this for X11 platforms
without the possibility of linking to the Vulkan library.
But I would like to add support for Vulkan and Wayland as
described in the official CMake files by the GLFW repository.
Both of these alternatives should be choose-able from the
outside via the config module of build2.

For this, I wanted to provide custom configuration variables,
like 'config.graphics.protocol = wayland / x11' and
'config.graphics.api = opengl / vulkan'.
Using only the syntax of the buildfile and the functionality
of build2 itself without the config module,
I was able to do this by always providing the respective
variables as command-line argument to 'b' as described in the
documentation for non-persistent builds.
Using the config module, manually adding custom variables to
the 'config.build' file of my project was working.
But the moment I changed the configuration with the command-line
tools, all custom variables vanished.

Is there already a better workaround to provide such custom variables?
Otherwise, would it be possible to provide this functionality?
In this case, maybe it would even be useful to have the same mechanism
for custom configuration variables as for the already given variable pairs,
such as 'config.cxx.poptions' and 'cxx.poptions'.
Thank you in advance.

- [GLFW Library](https://github.com/glfw/glfw)
- [build2-glfw](https://github.com/lyrahgames/build2-glfw)

Greetings
Markus



More information about the users mailing list