mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 20:20:11 +02:00
update SDL3 to latest commit
This commit is contained in:
@@ -29,6 +29,16 @@ endfunction()
|
||||
function(SDL_AddCommonCompilerFlags TARGET)
|
||||
option(SDL_WERROR "Enable -Werror" OFF)
|
||||
|
||||
get_property(TARGET_TYPE TARGET "${TARGET}" PROPERTY TYPE)
|
||||
if(MSVC)
|
||||
cmake_push_check_state()
|
||||
check_c_compiler_flag("/W3" COMPILER_SUPPORTS_W3)
|
||||
if(COMPILER_SUPPORTS_W3)
|
||||
target_compile_options(${TARGET} PRIVATE "/W3")
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
||||
if(MINGW)
|
||||
# See if GCC's -gdwarf-4 is supported
|
||||
@@ -59,6 +69,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")
|
||||
@@ -123,6 +138,13 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
if(HAVE_WERROR)
|
||||
sdl_target_compile_option_all_languages(${TARGET} "-Werror")
|
||||
endif()
|
||||
|
||||
if(TARGET_TYPE STREQUAL "SHARED_LIBRARY")
|
||||
check_linker_flag(C "-Wl,--no-undefined-version" LINKER_SUPPORTS_NO_UNDEFINED_VERSION)
|
||||
if(LINKER_SUPPORTS_NO_UNDEFINED_VERSION)
|
||||
target_link_options(${TARGET} PRIVATE "-Wl,--no-undefined-version")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user