From 0f9b923ff495f21e6a0bb1de1acd32b1c3d65236 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 7 Jan 2023 14:25:04 +0300
Subject: [PATCH] cmake: fix detection of math library functions.
Fixes https://github.com/libsdl-org/SDL/issues/7011
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49f1bfbff5a9..84d0820e251a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1057,6 +1057,7 @@ if(SDL_LIBC)
check_library_exists(m pow "" HAVE_LIBM)
if(HAVE_LIBM)
cmake_push_check_state()
+ list(APPEND CMAKE_REQUIRED_LIBRARIES m)
foreach(_FN
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f