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.
This commit is contained in:
Simon Hausmann 2019-08-30 10:07:09 +02:00 committed by Cosmin Truta
parent a6fc80300f
commit 6842c58adc

View File

@ -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 @@ if(NOT PNG_BUILD_ZLIB)
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