I would recommend looking at a plugin framework like Distrho which takes care of all sorts of stuff for you, like for example being able to compile the same sound engine as LV2, VST, CLAP, or whatever.
I’m more than happy to chat about how to get it all working and what I’ve run into trying to get it all together, but I’m far easier to get in #ardour or #lad on IRC