cmake: fall back to -Wconversion if -Wfloat-conversion isn't available
... during checks for valid isinf/isinff/isnan/isnanf macros.
This commit is contained in:
@@ -1085,8 +1085,10 @@ if(SDL_LIBC)
|
|||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -we4244 -WX") # 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
string(APPEND CMAKE_REQUIRED_FLAGS " -we4244 -WX") # 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
||||||
else()
|
elseif(HAVE_GCC_WFLOAT_CONVERSION)
|
||||||
string(APPEND CMAKE_REQUIRED_FLAGS " -Wfloat-conversion -Werror")
|
string(APPEND CMAKE_REQUIRED_FLAGS " -Wfloat-conversion -Werror")
|
||||||
|
else()
|
||||||
|
string(APPEND CMAKE_REQUIRED_FLAGS " -Wconversion -Werror")
|
||||||
endif()
|
endif()
|
||||||
foreach(math_fn isinf isnan)
|
foreach(math_fn isinf isnan)
|
||||||
string(TOUPPER "${math_fn}" MATH_FN)
|
string(TOUPPER "${math_fn}" MATH_FN)
|
||||||
|
|||||||
Reference in New Issue
Block a user