Linking a static library into a binary doesn't do anything if none of the symbols are used. For some combinations of plugin/host binary, we apparently get lucky (I think due to inline definitions from headers). But in general, it won't work.
To make sure this works properly, use an object library from CMake.
This is a bit hacky; suggestions welcome for a better way to solve the issue.