-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Hello,
I am building zlib for several plarforms and have few issues.
In particular, the emscripten compiler (for doing WebAssembly from C++) does not support shared libraries, only static.
Then the following line in the cmake raises a warning:
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
because SHARED is not possible.
After the warning, CMake forces the lib to be built as STATIC instead of SHARED but then it creates another error stating that multiple targets generate the same object (because, at the end, the other line add_library(zlibstatic STATIC will generate the same) .
In my opinion, SHARED or STATIC should be a developer selection, or should be based on BUILD_SHARED_LIBS which is a standard CMake variable for this.
It is related to #575