mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- cleaned and minimized SDL2 version check
This commit is contained in:
parent
e4ada10e78
commit
1efb9f4def
1 changed files with 10 additions and 12 deletions
|
@ -178,20 +178,18 @@ else()
|
|||
# Non-Windows version also needs SDL except native OS X backend
|
||||
if( NOT APPLE OR NOT OSX_COCOA_BACKEND )
|
||||
find_package( SDL2 REQUIRED CONFIG )
|
||||
include_directories( "${SDL2_INCLUDE_DIRS}" )
|
||||
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}" "${SDL2_INCLUDE_DIRS}")
|
||||
CHECK_CXX_SOURCE_COMPILES("#include <SDL_version.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
#if !SDL_VERSION_ATLEAST(2, 0, 6)
|
||||
#error \"Only SDL 2.0.6 or later is supported.\"
|
||||
#endif
|
||||
return 0;
|
||||
}" SDL2_MIN_VERSION )
|
||||
if (NOT SDL2_MIN_VERSION)
|
||||
message(SEND_ERROR "Only SDL 2.0.6 or later is supported.")
|
||||
set( CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}" "${SDL2_INCLUDE_DIRS}" )
|
||||
CHECK_CXX_SOURCE_COMPILES( "#include <SDL_version.h>
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 6)
|
||||
int main() {}
|
||||
#endif" SDL2_MIN_VERSION )
|
||||
|
||||
if ( NOT SDL2_MIN_VERSION )
|
||||
message( SEND_ERROR "Only SDL 2.0.6 or later is supported." )
|
||||
endif()
|
||||
|
||||
include_directories( "${SDL2_INCLUDE_DIRS}" )
|
||||
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${SDL2_LIBRARIES}" )
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in a new issue