Fix CMake build with Emscripten
When building with Emscripten, linkage to libm is neither required
nor working. As find_library will fail, M_LIBRARY will be set to
NOTFOUND and the build would fail later. The build works just fine
without libm linkage.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c85aa74..013f76e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,7 @@
# Revised by Kyle Bentley, 2018
# Revised by David Callu, 2020
# Revised by Steve Robinson, 2020
+# Revised by Simon Hausmann, 2020
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -45,7 +46,7 @@
include_directories(${ZLIB_INCLUDE_DIRS})
endif()
-if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
+if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU AND NOT EMSCRIPTEN)
find_library(M_LIBRARY m)
else()
# libm is not needed and/or not available