mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 06:41:41 +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
|
# Non-Windows version also needs SDL except native OS X backend
|
||||||
if( NOT APPLE OR NOT OSX_COCOA_BACKEND )
|
if( NOT APPLE OR NOT OSX_COCOA_BACKEND )
|
||||||
find_package( SDL2 REQUIRED CONFIG )
|
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()
|
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)
|
#if SDL_VERSION_ATLEAST(2, 0, 6)
|
||||||
#error \"Only SDL 2.0.6 or later is supported.\"
|
int main() {}
|
||||||
#endif
|
#endif" SDL2_MIN_VERSION )
|
||||||
return 0;
|
|
||||||
}" SDL2_MIN_VERSION )
|
if ( NOT SDL2_MIN_VERSION )
|
||||||
if (NOT SDL2_MIN_VERSION)
|
message( SEND_ERROR "Only SDL 2.0.6 or later is supported." )
|
||||||
message(SEND_ERROR "Only SDL 2.0.6 or later is supported.")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include_directories( "${SDL2_INCLUDE_DIRS}" )
|
||||||
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${SDL2_LIBRARIES}" )
|
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${SDL2_LIBRARIES}" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue