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
This commit is contained in:
Anonymous Maarten 2022-07-27 15:05:41 +02:00 committed by Sam Lantinga
parent 5da85376b9
commit 02c8747176
1 changed files with 1 additions and 1 deletions

View File

@ -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()