emcmake find_library MATH

9 views
Skip to first unread message

Sergio González

unread,
Jul 5, 2023, 10:43:20 AM7/5/23
to emscripten-discuss
Hello,

I am using emcmake to build a c++ project as a wasm library. I am facing an issue where in the CMakeLists file I try to get the libm package using `find_library(MATH m)` but I get an error saying that the `MATH` variable is set to NOTFOUND.

Is there a flag that I need to provide somewhere in order to find MATH with emcmake?

Cheers!
Sergio

Sam Clegg

unread,
Jul 5, 2023, 10:54:21 AM7/5/23
to emscripte...@googlegroups.com
Emscripten uses musl libc, which doesn't have a separate math library (its just part of `-lc`).    I'm not sure setting `MATH` to `NOTFOUND` is the desired behaviour in this case but it seems reasonable.    What happens if you try building your project on a musl-based linux distro such as alpine linux?

cheers,
sam

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/89d45c45-245c-4375-b71e-543cf144a48an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages