From 02c874717648f1dd919eca9c39a8b2b0ebc73657 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 27 Jul 2022 15:05:41 +0200 Subject: [PATCH] math.h does not always provide M_PI This fixes the following error when building with SDL_LIBC: SDL\test\testautomation_math.c(1965): error C2065: 'M_PI': undeclared identifier --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2eec85cd..8fc50afcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -929,7 +929,7 @@ if(SDL_LIBC) set(HAVE_${_UPPER} 1) endforeach() set(HAVE_ALLOCA 1) - set(HAVE_M_PI 1) + check_symbol_exists(M_PI math.h HAVE_M_PI) target_compile_definitions(sdl-build-options INTERFACE "-D_USE_MATH_DEFINES") # needed for M_PI set(STDC_HEADERS 1) else()