Skip to content

Commit 7e41355

Browse files
authored
Merge pull request #274 from mrikola/remove-findsdl
Remove FindSDL2 scripts in favor of using our own
2 parents be55e08 + eb7ef68 commit 7e41355

12 files changed

+106
-346
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ addons:
3030
- libgl1-mesa-dev:i386
3131

3232
script:
33-
- sudo ./osx-linux/install_32bit_sdl.sh
33+
- sudo TRAVIS=$TRAVIS ./osx-linux/install_32bit_sdl.sh
3434
- cmake -DCMAKE_LIBRARY_PATH=/usr/lib/i386-linux-gnu .
3535
- make -j2 systemshock
3636

@@ -39,6 +39,8 @@ before_deploy:
3939
- cp systemshock shockolate
4040
- cp osx-linux/install_32bit_sdl.sh shockolate
4141
- cp osx-linux/readme_osx_linux.md shockolate
42+
- cp osx-linux/run_$TRAVIS_OS_NAME.sh shockolate/run.sh
43+
- cat shockolate/run.sh
4244
- cp -r shaders shockolate/
4345
- cp readme/readme-linux.txt shockolate/readme.txt
4446
- tar zcfv $PACKAGE_NAME shockolate

CMakeLists.txt

+27-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,33 @@ if(OPENGL_FOUND)
3737
add_definitions(-DUSE_OPENGL)
3838
ENDIF(OPENGL_FOUND)
3939

40-
# Find SDL
41-
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/findsdl2-cmake" ${CMAKE_MODULE_PATH})
42-
find_package(SDL2 REQUIRED)
43-
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
44-
set(SDL2_LIBRARIES ${SDL2_LIBRARY})
45-
46-
# Try to find SDL_mixer, for sound
47-
find_package(SDL2_mixer)
40+
# set up SDL created by our build scripts
41+
set(SDL2_DIR ${CMAKE_SOURCE_DIR}/build_ext/built_sdl)
42+
43+
set(SDL2_INCLUDE_DIRS ${SDL2_DIR}/include/SDL2)
44+
find_library(SDL2_LIBRARY SDL2 PATHS ${SDL2_DIR}/lib)
45+
find_library(SDL2MAIN_LIBRARY SDL2main PATHS ${SDL2_DIR}/lib)
46+
set(SDL2_LIBRARIES "${SDL2MAIN_LIBRARY};${SDL2_LIBRARY}")
47+
48+
49+
# and SDL mixer
50+
51+
set(SDL2_MIXER_DIR ${CMAKE_SOURCE_DIR}/build_ext/built_sdl_mixer)
52+
53+
set(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_DIR}/include/SDL2)
54+
find_library(SDL2_MIXER_LIBRARY SDL2_mixer PATHS ${SDL2_MIXER_DIR}/lib)
55+
set(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})
56+
57+
add_definitions(-DUSE_SDL_MIXER=1)
58+
59+
60+
# add MinGW library if necessary
61+
62+
if(MINGW)
63+
set(SDL2_LIBRARIES "mingw32 ${SDL2_LIBRARIES}")
64+
set(SDL2_MIXER_LIBRARIES "mingw32 ${SDL2_MIXER_LIBRARIES}")
65+
endif(MINGW)
66+
4867

4968
include_directories(
5069
${SDL2_INCLUDE_DIRS}

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ environment:
1313
# Avoid rebuilding external dependencies (ie. SDL and SDL_mixer)
1414
# Uncache build_ext if external deps change
1515
cache:
16-
- res/music.sf2
17-
- build_ext
16+
# - res/music.sf2
17+
# - build_ext
1818

1919
# Actual build script..
2020
# Step 1: Git has to reside in a path without spaces because the SDL build script is weird like that.

externals/findsdl2-cmake/FindSDL2.cmake

-188
This file was deleted.

externals/findsdl2-cmake/FindSDL2_mixer.cmake

-128
This file was deleted.

0 commit comments

Comments
 (0)