GothicKit / ZenKit

A re-implementation of file formats used by the early 2000's ZenGin
http://zk.gothickit.dev/
MIT License
47 stars 10 forks source link

[v2.0.0] Update the CMake build (and library code) for easier distribution #47

Open lmichaelis opened 1 year ago

lmichaelis commented 1 year ago

Currently, the CMake build script is pretty bare-bones and does not allow for easy, clean distribution of the library code. This is due to being statically linked as well as pulling in 3rd-party libraries directly using target_link_libraries(... PUBLIC ...) which causes CMake's install process to malfunction by including 3rd-party library code in the installation.

This is unacceptable for installing phoenix into systems directly since the extra files might pollute existing installations of those libraries or could cause the package manager to break.

Things to do

DaDummy commented 1 year ago

Since you are building your own versions of the dependency libraries you probably should distribute them with phoenix builds for now.

The alternate approach would be to instead use find_package so the user can decide where to pull the dependencies from. This way preinstalled libraries may be used where applicable or libraries may be pulled from package managers such as conan and the user may decide whether to provide static or dynamic libraries.

This way the libraries would no longer be built during the build of phoenix and would therefore no longer get included with the install step.

Additionally I'd suggest turning the last task from this issue into a separate issue as dynamic linkage is not so much a CMake issue, but rather a question of adjusting the headers to set the correct export/import attributes on exported symbols for the different compilers.