Stored procedure compilation without main function

I’m trying to make a stored procedure for a database with the use of a large library (hence the need for cmake). The issue is that I’m hitting a undefined reference to 'main' error.

My stored procedures don’t need a main function but it seems like cmake is expecting one. Is there a way to build the binary without having to define a main function? I saw that there was a work around to define some dummy entry point in a separate file, but I’m wondering if there is a way around this?

Usually there are linker flags to do this; CMake has no abstraction for it though. I suspect you probably want module libraries (add_library(MODULE)) rather than executables (add_executable()) though.

Yes I have moved to using add_library now and it seemed to help me move forward to what it is that I am trying to accomplish, thanks.