I am writing a header-only library using C++17. I would like to include it in a "dummy" source file:
#include "my/library.h"
// EOF
The purpose is to ensure the library properly includes all of its dependencies. I also want to run static analyzers on it and compile it with as many compiler checks enabled as is practical.
To create a normal executable target I need to add the main()
function, otherwise the linking stage will fail.
I guess I can also create a static library target, which should work correctly, although it will create an artifact I do not need.
Is there any other alternative?