소스 검색

cmake: check for math library functions even in the absence of libm

(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
Ozkan Sezer 2 년 전
부모
커밋
ca541789ea
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      CMakeLists.txt

+ 4 - 2
CMakeLists.txt

@@ -1041,7 +1041,8 @@ if(SDL_LIBC)
     if(HAVE_LIBM)
       cmake_push_check_state()
       list(APPEND CMAKE_REQUIRED_LIBRARIES m)
-      foreach(_FN
+    endif()
+    foreach(_FN
               atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
               exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
               lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt
@@ -1050,7 +1051,8 @@ if(SDL_LIBC)
         set(LIBC_HASVAR "LIBC_HAS_${_UPPER}")
         check_symbol_exists("${_FN}" "math.h" ${LIBC_HASVAR})
         set(HAVE_${_UPPER} ${${LIBC_HASVAR}})
-      endforeach()
+    endforeach()
+    if(HAVE_LIBM)
       cmake_pop_check_state()
       if(NOT VITA)
         list(APPEND EXTRA_LIBS m)