Skip to content

Commit

Permalink
cmake: add -Wfloat-conversion compile flag
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jun 3, 2024
1 parent 396855f commit 8d02531
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/sdlcompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ function(SDL_AddCommonCompilerFlags TARGET)
sdl_target_compile_option_all_languages(${TARGET} "-Wundef")
endif()

check_c_compiler_flag(-Wfloat-conversion HAVE_GCC_WFLOAT_CONVERSION)
if(HAVE_GCC_WFLOAT_CONVERSION)
sdl_target_compile_option_all_languages(${TARGET} "-Wfloat-conversion")
endif()

check_c_compiler_flag(-fno-strict-aliasing HAVE_GCC_NO_STRICT_ALIASING)
if(HAVE_GCC_NO_STRICT_ALIASING)
sdl_target_compile_option_all_languages(${TARGET} "-fno-strict-aliasing")
Expand Down

0 comments on commit 8d02531

Please sign in to comment.