[cmake-developers] Using a custom DSL compiler in CMake

Chris Bieneman chris.bieneman at me.com
Tue Jun 21 14:18:51 EDT 2016


Hello cmake-developers,

I’m trying to find a solution to a long running problem in our build. In LLVM we have a domain specific language named TableGen that we use to generate header files used throughout the project. Our current solution to work with this tool in CMake is pretty terrible for a number of reasons.

The biggest problem is that we don’t have good dependency handling around the inputs and outputs from the DSL. Some of this is caused by our CMake targets not being granular (which I know how to fix). The harder part is that our DSL supports C-like includes.

Our DSL compiler can generate .d files, but hooking that up to CMake is a harder problem. My thought was to try and treat TableGen as a language. There are some complications with that because we don’t actually have a compiler for it at configuration time.

Any thoughts and guidance would be greatly appreciated. I feel as if I’m about to fall into a deep and scary rabbit hole.

Thanks,
-Chris


More information about the cmake-developers mailing list