Skip to content

Commit

Permalink
math.h does not always provide M_PI
Browse files Browse the repository at this point in the history
This fixes the following error when building with SDL_LIBC:
SDL\test\testautomation_math.c(1965): error C2065: 'M_PI': undeclared identifier
  • Loading branch information
madebr authored and slouken committed Jul 27, 2022
1 parent 5da8537 commit 02c8747
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -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()
Expand Down

0 comments on commit 02c8747

Please sign in to comment.