idk icon indicating copy to clipboard operation
idk copied to clipboard

Fixing Windows builds when using `target_link_libraries()`

Open nickelpro opened this issue 2 years ago • 3 comments

The current cmake configuration for ztd.idk is not header-only, it produces a library from the files in the source directory.

This is a problem, because the API linkage flag that api.h expects to see (ZTD_DLL) isn't set by the build system, so the library is built without exporting any symbols. This makes the library unlinkable on Windows.

This is all fixable, but I need to know the intent. The docs refer to idk as header only and it appears to work entirely in header-only mode. So should we just not compile these files? Should we create two targets, one for header only and one that compiles and links the library correctly?

Once I know what the intent is I can handle fixing up the cmake stuff.

nickelpro avatar Apr 27 '22 13:04 nickelpro