Skip to content

Adapt CMake scripts for WebAssembly compilation#344

Merged
bramton merged 2 commits intolibharu:masterfrom
thegrizzlylabs:adapt-cmake-for-emscripten
Jul 9, 2025
Merged

Adapt CMake scripts for WebAssembly compilation#344
bramton merged 2 commits intolibharu:masterfrom
thegrizzlylabs:adapt-cmake-for-emscripten

Conversation

@guillaume-tgl
Copy link
Copy Markdown
Contributor

When building the library with emscripten for WebAssembly, the only issue is that the current CMake script requires the math library, which is already provided by the system.

This script doesn't seem to be used as the MATH_LIB variable is never used elsewhere and there's another `find_library` call for the math library in the root `CMakeLists.txt`.
Plus, this script incorrectly errors out in case of a compilation for WebAssembly.
Don't try to link the Math library when compiling with emscripten, as it's already provided by the system (Compiler throws warnings for missing linked libraries unless compiling to JS emscripten-core/emscripten#2600).
Also added some additional details to CMake summary related with this change.
@bramton bramton merged commit eaa0d8c into libharu:master Jul 9, 2025
@guillaume-tgl guillaume-tgl deleted the adapt-cmake-for-emscripten branch July 9, 2025 13:30
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

Successfully merging this pull request may close these issues.

2 participants