Skip to content

Commit

Permalink
Merge pull request #274 from mrikola/remove-findsdl
Browse files Browse the repository at this point in the history
Remove FindSDL2 scripts in favor of using our own
  • Loading branch information
Interrupt authored Mar 4, 2019
2 parents be55e08 + eb7ef68 commit 7e41355
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 346 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ addons:
- libgl1-mesa-dev:i386

script:
- sudo ./osx-linux/install_32bit_sdl.sh
- sudo TRAVIS=$TRAVIS ./osx-linux/install_32bit_sdl.sh
- cmake -DCMAKE_LIBRARY_PATH=/usr/lib/i386-linux-gnu .
- make -j2 systemshock

Expand All @@ -39,6 +39,8 @@ before_deploy:
- cp systemshock shockolate
- cp osx-linux/install_32bit_sdl.sh shockolate
- cp osx-linux/readme_osx_linux.md shockolate
- cp osx-linux/run_$TRAVIS_OS_NAME.sh shockolate/run.sh
- cat shockolate/run.sh
- cp -r shaders shockolate/
- cp readme/readme-linux.txt shockolate/readme.txt
- tar zcfv $PACKAGE_NAME shockolate
Expand Down
35 changes: 27 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,33 @@ if(OPENGL_FOUND)
add_definitions(-DUSE_OPENGL)
ENDIF(OPENGL_FOUND)

# Find SDL
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/findsdl2-cmake" ${CMAKE_MODULE_PATH})
find_package(SDL2 REQUIRED)
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
set(SDL2_LIBRARIES ${SDL2_LIBRARY})

# Try to find SDL_mixer, for sound
find_package(SDL2_mixer)
# set up SDL created by our build scripts
set(SDL2_DIR ${CMAKE_SOURCE_DIR}/build_ext/built_sdl)

set(SDL2_INCLUDE_DIRS ${SDL2_DIR}/include/SDL2)
find_library(SDL2_LIBRARY SDL2 PATHS ${SDL2_DIR}/lib)
find_library(SDL2MAIN_LIBRARY SDL2main PATHS ${SDL2_DIR}/lib)
set(SDL2_LIBRARIES "${SDL2MAIN_LIBRARY};${SDL2_LIBRARY}")


# and SDL mixer

set(SDL2_MIXER_DIR ${CMAKE_SOURCE_DIR}/build_ext/built_sdl_mixer)

set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_DIR}/include/SDL2)
find_library(SDL2_MIXER_LIBRARY SDL2_mixer PATHS ${SDL2_MIXER_DIR}/lib)
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})

add_definitions(-DUSE_SDL_MIXER=1)


# add MinGW library if necessary

if(MINGW)
set(SDL2_LIBRARIES "mingw32 ${SDL2_LIBRARIES}")
set(SDL2_MIXER_LIBRARIES "mingw32 ${SDL2_MIXER_LIBRARIES}")
endif(MINGW)


include_directories(
${SDL2_INCLUDE_DIRS}
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ environment:
# Avoid rebuilding external dependencies (ie. SDL and SDL_mixer)
# Uncache build_ext if external deps change
cache:
- res/music.sf2
- build_ext
# - res/music.sf2
# - build_ext

# Actual build script..
# Step 1: Git has to reside in a path without spaces because the SDL build script is weird like that.
Expand Down
188 changes: 0 additions & 188 deletions externals/findsdl2-cmake/FindSDL2.cmake

This file was deleted.

128 changes: 0 additions & 128 deletions externals/findsdl2-cmake/FindSDL2_mixer.cmake

This file was deleted.

Loading

0 comments on commit 7e41355

Please sign in to comment.