Godbolt examples in CMake documentation

The Godbolt compiler explorer has gained an IDE tree ability not that long, which I think could be used to host examples embedded in the CMake documentation. Here is one example: Compiler Explorer

People often complain about the lack of extensive examples in the CMake docs and I think this would be an ideal way to address that, since people can take these examples and toy with them from the comfort of their browsers.

I haven’t looked at it more closely, but I’m sure there is an API to programmatically create godbolt links with a desired layout.

I’m curious what people’s opinion on this is.

2 Likes

I found some elements of an API in this project. The docs are here but they don’t seem to be enough for CMake code and sources to be added.

It seems something that’d be handy to have though.