diff --git a/CMakeLists.txt b/CMakeLists.txt index 2103ab13c12..91c0bad2423 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,6 @@ option(ENABLE_CAMPAIGN_SERVER "Enable compilation of campaign server") option(ENABLE_SERVER "Enable compilation of server" ON) option(ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers") option(ENABLE_SDL2_TOOLS "Enable building and installation of tools for testing with SDL2" OFF) -option(ENABLE_SDL2 "Enable building the game with SDL2" ON) option(ENABLE_TESTS "Build unit tests") option(ENABLE_NLS "Enable building of translations" ON) option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF) @@ -60,15 +59,12 @@ option(ENABLE_LIBPNG "Enable support for writing png files (screenshots, images) option(ENABLE_LIBINTL "Enable using libintl for translations instead of Boost.Locale library (not recommended)" OFF) 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) find_package(Boost 1.36 REQUIRED COMPONENTS iostreams program_options regex system) find_package(Boost 1.40 REQUIRED COMPONENTS random) @@ -79,17 +75,10 @@ find_package(Gettext) find_package(X11) if(NOT MSVC) - if(ENABLE_SDL2) - #needed to get some SDL2 defines in... (as of rev31694 -D_GNU_SOURCE=1 is required!) - set(SDL2_CONFIG "sdl2-config" CACHE STRING "Path to sdl2-config script") - exec_program(${SDL2_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE SDL2_CFLAGS) - add_definitions(${SDL2_CFLAGS}) - else(ENABLE_SDL2) - #needed to get some SDL defines in... (as of rev31694 -D_GNU_SOURCE=1 is required!) - set(SDL_CONFIG "sdl-config" CACHE STRING "Path to sdl-config script") - exec_program(${SDL_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE SDL_CFLAGS) - add_definitions(${SDL_CFLAGS}) - endif(ENABLE_SDL2) + #needed to get some SDL2 defines in... (as of rev31694 -D_GNU_SOURCE=1 is required!) + set(SDL2_CONFIG "sdl2-config" CACHE STRING "Path to sdl2-config script") + exec_program(${SDL2_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE SDL2_CFLAGS) + add_definitions(${SDL2_CFLAGS}) endif(NOT MSVC) if(NOT WIN32) @@ -570,20 +559,11 @@ endif(ENABLE_DEBUG_WINDOW_LAYOUT) # if(ENABLE_TOOLS OR ENABLE_GAME OR ENABLE_TESTS) - if(ENABLE_SDL2) - find_package( SDL2_image 2.0.0 REQUIRED ) - else(ENABLE_SDL2) - find_package( SDL_image 1.2 REQUIRED ) - endif(ENABLE_SDL2) + find_package( SDL2_image 2.0.0 REQUIRED ) endif(ENABLE_TOOLS OR ENABLE_GAME OR ENABLE_TESTS) if(ENABLE_GAME OR ENABLE_TESTS) - if(ENABLE_SDL2) - find_package( SDL2_mixer 2.0.0 REQUIRED ) - find_package( SDL2_ttf 2.0.8 REQUIRED ) - else(ENABLE_SDL2) - find_package( SDL_mixer 1.2.12 REQUIRED ) - find_package( SDL_ttf 2.0.8 REQUIRED ) - endif(ENABLE_SDL2) + find_package( SDL2_mixer 2.0.0 REQUIRED ) + find_package( SDL2_ttf 2.0.8 REQUIRED ) if(NOT MSVC) find_package(VorbisFile REQUIRED) find_package( PkgConfig REQUIRED ) @@ -594,11 +574,7 @@ if(ENABLE_GAME OR ENABLE_TESTS) endif(ENABLE_GAME OR ENABLE_TESTS) if(ENABLE_GAME OR ENABLE_SERVER OR ENABLE_CAMPAIGN_SERVER OR ENABLE_TESTS) - if(ENABLE_SDL2) - find_package( SDL2_net 2.0.0 REQUIRED ) - else(ENABLE_SDL2) - find_package( SDL_net REQUIRED ) - endif(ENABLE_SDL2) + find_package( SDL2_net 2.0.0 REQUIRED ) endif(ENABLE_GAME OR ENABLE_SERVER OR ENABLE_CAMPAIGN_SERVER OR ENABLE_TESTS) if(ENABLE_TOOLS) find_package( ZLIB REQUIRED ) diff --git a/SConstruct b/SConstruct index 73504d96e16..e8d2b0c36bd 100755 --- a/SConstruct +++ b/SConstruct @@ -108,8 +108,7 @@ opts.AddVariables( BoolVariable("fast", "Make scons faster at cost of less precise dependency tracking.", False), BoolVariable("lockfile", "Create a lockfile to prevent multiple instances of scons from being run at the same time on this working copy.", False), BoolVariable("OS_ENV", "Forward the entire OS environment to scons", False), - BoolVariable("history", "Clear to disable GNU history support in lua console", True), - BoolVariable("sdl2", "Build with SDL2 support (experimental!)", True) + BoolVariable("history", "Clear to disable GNU history support in lua console", True) ) # @@ -364,31 +363,19 @@ if env["prereqs"]: conf.CheckLib("vorbis") conf.CheckLib("mikmod") - if env['sdl2']: - def have_sdl_net(): - return \ - conf.CheckSDL(require_version = SDL2_version) & \ - conf.CheckSDL("SDL2_net", header_file = "SDL_net") - def have_sdl_other(): - return \ - 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") + def have_sdl_net(): + return \ + conf.CheckSDL(require_version = SDL2_version) & \ + conf.CheckSDL("SDL2_net", header_file = "SDL_net") - else: - def have_sdl_net(): - return \ - conf.CheckSDL(require_version = '1.2.10') & \ - conf.CheckSDL('SDL_net') + def have_sdl_other(): + return \ + 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") - def have_sdl_other(): - return \ - conf.CheckSDL(require_version = '1.2.10') & \ - conf.CheckSDL("SDL_ttf", require_version = "2.0.8") & \ - conf.CheckSDL("SDL_mixer", require_version = '1.2.12') & \ - conf.CheckSDL("SDL_image", require_version = '1.2.0') if env["libintl"]: def have_i18n_prereqs(): diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 63c9351cbfb..ec77b0eb029 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,49 +21,27 @@ include_directories(SYSTEM ${LIBDBUS_INCLUDE_DIRS} ) include_directories(SYSTEM ${LIBINTL_INCLUDE_DIR} ) include_directories(SYSTEM ${VORBISFILE_INCLUDE_DIR} ) -if(ENABLE_SDL2) - include_directories(SYSTEM ${SDL2_INCLUDE_DIR} ) - set(sdl-lib ${SDL2_LIBRARY}) - set(sdlmain-lib ${SDL2MAIN_LIBRARY}) - #optional dependencies - if(SDL2IMAGE_INCLUDE_DIR) - include_directories(SYSTEM ${SDL2IMAGE_INCLUDE_DIR} ) - set(sdl_image-lib ${SDL2_IMAGE_LIBRARY}) - endif() - if(SDL2MIXER_INCLUDE_DIR) - include_directories(SYSTEM ${SDL2MIXER_INCLUDE_DIR} ) - set(sdl_mixer-lib ${SDL2_MIXER_LIBRARY}) - endif() - if(SDL2NET_INCLUDE_DIR) - include_directories(SYSTEM ${SDL2NET_INCLUDE_DIR} ) - set(sdl_net-lib ${SDL2_NET_LIBRARY}) - endif() - if(SDL2TTF_INCLUDE_DIR) - include_directories(SYSTEM ${SDL2TTF_INCLUDE_DIR} ) - set(sdl_ttf-lib ${SDL2_TTF_LIBRARY}) - endif() -else(ENABLE_SDL2) - include_directories(SYSTEM ${SDL_INCLUDE_DIR} ) - set(sdl-lib ${SDL_LIBRARY}) - set(sdlmain-lib ${SDLMAIN_LIBRARY}) - #optional dependencies - if(SDLIMAGE_INCLUDE_DIR) - include_directories(SYSTEM ${SDLIMAGE_INCLUDE_DIR} ) - set(sdl_image-lib ${SDLIMAGE_LIBRARY}) - endif() - if(SDLMIXER_INCLUDE_DIR) - include_directories(SYSTEM ${SDLMIXER_INCLUDE_DIR} ) - set(sdl_mixer-lib ${SDLMIXER_LIBRARY}) - endif() - if(SDLNET_INCLUDE_DIR) - include_directories(SYSTEM ${SDLNET_INCLUDE_DIR} ) - set(sdl_net-lib ${SDLNET_LIBRARY}) - endif() - if(SDLTTF_INCLUDE_DIR) - include_directories(SYSTEM ${SDLTTF_INCLUDE_DIR} ) - set(sdl_ttf-lib ${SDLTTF_LIBRARY}) - endif() -endif(ENABLE_SDL2) + +include_directories(SYSTEM ${SDL2_INCLUDE_DIR} ) +set(sdl-lib ${SDL2_LIBRARY}) +set(sdlmain-lib ${SDL2MAIN_LIBRARY}) +#optional dependencies +if(SDL2IMAGE_INCLUDE_DIR) + include_directories(SYSTEM ${SDL2IMAGE_INCLUDE_DIR} ) + set(sdl_image-lib ${SDL2_IMAGE_LIBRARY}) +endif() +if(SDL2MIXER_INCLUDE_DIR) + include_directories(SYSTEM ${SDL2MIXER_INCLUDE_DIR} ) + set(sdl_mixer-lib ${SDL2_MIXER_LIBRARY}) +endif() +if(SDL2NET_INCLUDE_DIR) + include_directories(SYSTEM ${SDL2NET_INCLUDE_DIR} ) + set(sdl_net-lib ${SDL2_NET_LIBRARY}) +endif() +if(SDL2TTF_INCLUDE_DIR) + include_directories(SYSTEM ${SDL2TTF_INCLUDE_DIR} ) + set(sdl_ttf-lib ${SDL2_TTF_LIBRARY}) +endif() if(ZLIB_INCLUDE_DIR) include_directories(SYSTEM ${ZLIB_INCLUDE_DIR} )