Skip to content

Commit 98bed62

Browse files
committed
cmake: fall back to -Wconversion if -Wfloat-conversion isn't available
... during checks for valid isinf/isinff/isnan/isnanf macros.
1 parent c50e4b2 commit 98bed62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,10 @@ if(SDL_LIBC)
10851085
cmake_push_check_state()
10861086
if(MSVC)
10871087
string(APPEND CMAKE_REQUIRED_FLAGS " -we4244 -WX") # 'conversion' conversion from 'type1' to 'type2', possible loss of data
1088-
else()
1088+
elseif(HAVE_GCC_WFLOAT_CONVERSION)
10891089
string(APPEND CMAKE_REQUIRED_FLAGS " -Wfloat-conversion -Werror")
1090+
else()
1091+
string(APPEND CMAKE_REQUIRED_FLAGS " -Wconversion -Werror")
10901092
endif()
10911093
foreach(math_fn isinf isnan)
10921094
string(TOUPPER "${math_fn}" MATH_FN)

0 commit comments

Comments
 (0)