-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Update CMakeLists.txt to support Emscripten #3852
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Could you add a small section showing how to use this to the docs in https://github.com/fmtlib/fmt/blob/master/doc/usage.rst?
CMakeLists.txt
Outdated
${FMT_SOURCES} | ||
${FMT_HEADERS} | ||
) | ||
add_executable(fmt_wasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it an executable and not a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emscripten requires executable code for wasm library for cmake is specified
https://stunlock.gg/posts/emscripten_with_cmake/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated Emscripten target cmake
@danoli3, could you add a small usage section per my earlier comment? |
|
I think @sykhro is right, at most you'd need to pass extra compile/link flags which can be done via CMake. We don't really need to introduce an extra target. But thanks for PR anyway. |
Allow for compile target for WASM Emscripten.
Thanks FMT is wicked !