I needed to build a shared library version of GDeflate to satisfy a dependency, but currently the CMake configuration only builds a static version. I was able to fix this by replacing
add_library(GDeflate STATIC ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
with
if(BUILD_SHARED_LIBS)
add_library(GDeflate SHARED ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
else()
add_library(GDeflate STATIC ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
endif()
I also had to change this in 3rdparty/libdeflate.cmake, ending up with two shared libraries. It's a small change but I wanted to propose a PR for it in case it would be useful for anyone else? Let me know what you think.