cmake: check for math library functions even in the absence of libm
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
This commit is contained in:
@@ -1041,6 +1041,7 @@ if(SDL_LIBC)
|
|||||||
if(HAVE_LIBM)
|
if(HAVE_LIBM)
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
|
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
|
||||||
|
endif()
|
||||||
foreach(_FN
|
foreach(_FN
|
||||||
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
|
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
|
||||||
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
|
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
|
||||||
@@ -1051,6 +1052,7 @@ if(SDL_LIBC)
|
|||||||
check_symbol_exists("${_FN}" "math.h" ${LIBC_HASVAR})
|
check_symbol_exists("${_FN}" "math.h" ${LIBC_HASVAR})
|
||||||
set(HAVE_${_UPPER} ${${LIBC_HASVAR}})
|
set(HAVE_${_UPPER} ${${LIBC_HASVAR}})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
if(HAVE_LIBM)
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
if(NOT VITA)
|
if(NOT VITA)
|
||||||
list(APPEND EXTRA_LIBS m)
|
list(APPEND EXTRA_LIBS m)
|
||||||
|
|||||||
Reference in New Issue
Block a user