提交 ee7967ee 编写于 作者: C Cosmin Truta

CMakeLists: Fix detection of libm

Only use libm on Unix and Unix-like systems, except for Apple (where
it's unnecessary), and BeOS and Haiku (where it's unavailable).

Avoid searching for libm at explicit locations. They may be incorrect,
especially for cross-platform builds.
上级 a54a0562
......@@ -59,16 +59,10 @@ if(NOT PNG_BUILD_ZLIB)
include_directories(${ZLIB_INCLUDE_DIR})
endif()
if(NOT WIN32)
find_library(M_LIBRARY
NAMES m
PATHS /usr/lib /usr/local/lib)
if(NOT M_LIBRARY)
message(STATUS "math lib 'libm' not found; floating point support disabled")
set(M_LIBRARY "")
endif()
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
find_library(M_LIBRARY m)
else()
# not needed on windows
# libm is not needed and/or not available
set(M_LIBRARY "")
endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册