Correct SDL2 versions for linux/win32/osx in build scripts
Codify the requirements set forth in the INSTALL file in scons and cmake as they are used on other platforms that Linux and * BSD.
This commit is contained in:
parent
d161d6c8ba
commit
9b5870e14b
2 changed files with 12 additions and 2 deletions
|
@ -61,7 +61,11 @@ option(ENABLE_LIBINTL "Enable using libintl for translations instead of Boost.Lo
|
|||
option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON)
|
||||
|
||||
if(ENABLE_SDL2)
|
||||
if(UNIX AND NOT APPLE AND NOT CYGWIN)
|
||||
find_package(SDL2 2.0.2 REQUIRED)
|
||||
else (UNIX AND NOT APPLE AND NOT CYGWIN)
|
||||
find_package(SDL2 2.0.4 REQUIRED)
|
||||
endif (UNIX AND NOT APPLE AND NOT CYGWIN)
|
||||
else(ENABLE_SDL2)
|
||||
find_package(SDL 1.2.7 REQUIRED)
|
||||
endif(ENABLE_SDL2)
|
||||
|
|
10
SConstruct
10
SConstruct
|
@ -179,6 +179,12 @@ if env['distcc']:
|
|||
|
||||
if env['ccache']: env.Tool('ccache')
|
||||
|
||||
SDL2_version = '';
|
||||
if env["PLATFORM"] is "win32" or env["PLATFORM"] is "cygwin" or env["PLATFORM"] is "darwin":
|
||||
SDL2_version = '2.0.4';
|
||||
else:
|
||||
SDL2_version = '2.0.2';
|
||||
|
||||
|
||||
Help("""Arguments may be a mixture of switches and targets in any order.
|
||||
Switches apply to the entire build regardless of where they are in the order.
|
||||
|
@ -360,12 +366,12 @@ if env["prereqs"]:
|
|||
if env['sdl2']:
|
||||
def have_sdl_net():
|
||||
return \
|
||||
conf.CheckSDL(require_version = '2.0.2') & \
|
||||
conf.CheckSDL(require_version = SDL2_version) & \
|
||||
conf.CheckSDL("SDL2_net", header_file = "SDL_net")
|
||||
|
||||
def have_sdl_other():
|
||||
return \
|
||||
conf.CheckSDL(require_version = '2.0.2') & \
|
||||
conf.CheckSDL(require_version = SDL2_version) & \
|
||||
conf.CheckSDL("SDL2_ttf", header_file = "SDL_ttf") & \
|
||||
conf.CheckSDL("SDL2_mixer", header_file = "SDL_mixer") & \
|
||||
conf.CheckSDL("SDL2_image", header_file = "SDL_image")
|
||||
|
|
Loading…
Add table
Reference in a new issue