mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-05 09:50:15 +08:00
cmake: treat linker warnings as errors when configuring with SDL_WERROR=ON
This commit is contained in:
committed by
Anonymous Maarten
parent
997a168e00
commit
e338287e64
@@ -155,6 +155,18 @@ function(SDL_AddCommonCompilerFlags TARGET)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT (APPLE OR MSVC))
|
||||
if(SDL_WERROR)
|
||||
get_property(target_type TARGET ${TARGET} PROPERTY TYPE)
|
||||
if(target_type MATCHES "SHARED_LIBRARY|MODULE_LIBRARY")
|
||||
check_linker_flag(C "-Wl,-fatal-warnings" LINKER_SUPPORTS_WL_FATAL_WARNINGS)
|
||||
if(LINKER_SUPPORTS_WL_FATAL_WARNINGS)
|
||||
target_link_options(${TARGET} PRIVATE "-Wl,-fatal-warnings")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_CLANG)
|
||||
|
||||
Reference in New Issue
Block a user