Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error with emscripten #1026

Open
JD31 opened this issue Dec 4, 2024 · 0 comments
Open

Build error with emscripten #1026

JD31 opened this issue Dec 4, 2024 · 0 comments

Comments

@JD31
Copy link

JD31 commented Dec 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant