Skip to content

Commit 57be51d

Browse files
authored
Merge pull request #330 from mrikola/multiple-appveyor-jobs
Separate CI jobs for 32 and 64 bits
2 parents bfe2223 + 8f513be commit 57be51d

18 files changed

+740
-73
lines changed

Diff for: .travis.yml

+24-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,34 @@ notifications:
44
email: false
55

66
env:
7-
- PACKAGE_NAME="shockolate-$TRAVIS_OS_NAME.tgz"
7+
- PACKAGE_NAME="shockolate-$TRAVIS_OS_NAME-${BITS}bit.tgz"
88

99
matrix:
1010
include:
11+
- os: linux
12+
dist: bionic
13+
sudo: required
14+
env:
15+
- SDL2_LIB=BUNDLED
16+
- SDL2_MIXER_LIB=BUNDLED
17+
- FLUIDSYNTH_LIB=BUNDLED
18+
- BITS=64
19+
addons:
20+
apt:
21+
packages:
22+
- cmake-data cmake libglu1-mesa-dev libgl1-mesa-dev # libfluidsynth-dev libsdl2-dev libsdl2-mixer-dev
23+
compiler: gcc
1124
- os: linux
1225
dist: trusty
1326
sudo: required
1427
env:
1528
- SDL2_LIB=BUNDLED
1629
- SDL2_MIXER_LIB=BUNDLED
1730
- FLUIDSYNTH_LIB=BUNDLED
31+
- CMAKE_LIBRARY_PATH=/usr/lib/i386-linux-gnu
32+
- BITS=32
33+
before_script:
34+
- cp osx-linux/CMakeLists.32bit.txt ./CMakeLists.txt
1835
addons:
1936
apt:
2037
packages:
@@ -26,26 +43,28 @@ matrix:
2643
- SDL2_LIB=BUNDLED
2744
- SDL2_MIXER_LIB=BUNDLED
2845
- FLUIDSYNTH_LIB=OFF # Bundled lib failed to compile
46+
- BITS=64
2947
- os: osx
3048
compiler: gcc
3149
env:
3250
- SDL2_LIB=BUNDLED
3351
- SDL2_MIXER_LIB=BUNDLED
3452
- FLUIDSYNTH_LIB=OFF # Bundled lib failed to compile
53+
- BITS=64
3554

3655
script:
37-
- sudo TRAVIS=$TRAVIS ./osx-linux/install_32bit_sdl.sh
38-
- cmake -DCMAKE_LIBRARY_PATH=/usr/lib/i386-linux-gnu -DENABLE_SDL2=${SDL2_LIB} -DENABLE_SOUND=${SDL2_MIXER_LIB} -DENABLE_FLUIDSYNTH=${FLUIDSYNTH_LIB} .
56+
- chmod a+rx ./osx-linux/*.sh
57+
- sudo TRAVIS=$TRAVIS ./osx-linux/install_${BITS}bit_sdl.sh
58+
- cmake -DENABLE_SDL2=${SDL2_LIB} -DENABLE_SOUND=${SDL2_MIXER_LIB} -DENABLE_FLUIDSYNTH=${FLUIDSYNTH_LIB} .
3959
- make -j2 systemshock
4060

4161
before_deploy:
4262
- mkdir -p shockolate
4363
- cp systemshock shockolate
44-
- cp osx-linux/install_32bit_sdl.sh shockolate
64+
- cp osx-linux/install_${BITS}bit_sdl.sh shockolate/install_sdl.sh
4565
- cp osx-linux/readme_osx_linux.md shockolate
4666
- cp osx-linux/run_$TRAVIS_OS_NAME.sh shockolate/run.sh
4767
- cp -r shaders shockolate/
48-
- cp -r lib shockolate/
4968
- cp -r res shockolate/
5069
- cp readme/readme-$TRAVIS_OS_NAME.txt shockolate/readme.txt
5170
- tar zcfv $PACKAGE_NAME shockolate

Diff for: CMakeLists.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ project(shockolate VERSION 0.7.8)
44

55
include(FeatureSummary)
66

7-
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
8-
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS ON)
7+
#set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
8+
#set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS ON)
9+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS OFF)
10+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
911

1012
# Required for stdbool.h
1113
set(CMAKE_C_STANDARD 99)
1214
# For nullptr in C++
1315
set(CMAKE_CXX_STANDARD 11)
1416
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1517

16-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
17-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -D__STDC_LIMIT_MACROS")
18+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g ")
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -D__STDC_LIMIT_MACROS")
1820

1921
option(ENABLE_EXAMPLES "Enable example applications" OFF)
2022
add_feature_info(ENABLE_EXAMPLES ENABLE_EXAMPLES "Enable example application (can be broken!)")
@@ -42,7 +44,7 @@ if(ENABLE_DEBUG_BLIT)
4244
add_definitions(-DDEBUGGING_BLIT)
4345
endif()
4446

45-
add_compile_options(-fsigned-char -fno-strict-aliasing -Werror=implicit-function-declaration)
47+
add_compile_options(-fsigned-char -fno-strict-aliasing)
4648

4749
# Find OpenGL
4850
if(ENABLE_OPENGL)

Diff for: appveyor.yml

+34-6
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,52 @@ image: Visual Studio 2015
1010
environment:
1111
APPVEYOR: TRUE
1212

13+
platform:
14+
- x64
15+
- x86
16+
1317
# Avoid rebuilding external dependencies (ie. SDL and SDL_mixer)
1418
# Uncache build_ext if external deps change
1519
cache:
1620
# - res/music.sf2
1721
# - build_ext
1822

23+
# Set up environment variable values for 32 and 64 bit builds
24+
25+
for:
26+
-
27+
matrix:
28+
only:
29+
- platform: x86
30+
before_build:
31+
- set BUILD_SCRIPT=build_win32.sh
32+
- set ARTIFACT=systemshock-x86.zip
33+
- set MINGW_PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\
34+
-
35+
matrix:
36+
only:
37+
- platform: x64
38+
before_build:
39+
- set BUILD_SCRIPT=build_win64.sh
40+
- set ARTIFACT=systemshock-x64.zip
41+
- set MINGW_PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin\
42+
1943
# Actual build script..
2044
# Step 1: Git has to reside in a path without spaces because the SDL build script is weird like that.
2145
# So we create a symlink to the real Git, remove it from PATH and add our own.
2246
# Step 2: We need to use our own make.exe to build stuff, so we add that
2347
# Step 3: Do the actual building
48+
2449
build_script:
2550
- mklink /D c:\git "C:\Program Files\Git"
2651
- set PATH=%PATH:C:\Program Files (x86)\Git\bin;=%
27-
- set PATH=c:\git\usr\bin;%PATH%;C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\
52+
- set PATH=c:\git\usr\bin;%PATH%;%MINGW_PATH%
2853
- copy windows\make.exe \git\usr\bin
2954
- set CMAKE_MAKE_PROGRAM=c:\git\usr\bin\make.exe
30-
- sh build_windows.sh
55+
- sh %BUILD_SCRIPT%
3156
- build.bat
3257

58+
3359
# For now, we don't have any automatic tests to run
3460
test: off
3561

@@ -42,11 +68,13 @@ after_build:
4268
- copy build_ext\built_glew\lib\glew32.dll .
4369
- copy build_ext\fluidsynth-lite\src\libfluidsynth.dll .
4470
- copy readme\readme-windows.txt readme.txt
45-
- 7z a systemshock-windows.zip systemshock.exe *.dll readme.txt shaders/ res/
71+
- 7z a %ARTIFACT% systemshock.exe *.dll readme.txt shaders/ res/
4672

4773
artifacts:
48-
- path: systemshock-windows.zip
49-
name: Shockolate
74+
- path: systemshock-x86.zip
75+
name: Shockolate (32bit)
76+
- path: systemshock-x64.zip
77+
name: Shockolate (64bit)
5078

5179
version: '0.5.{build}'
5280

@@ -58,7 +86,7 @@ deploy:
5886
- provider: GitHub
5987
release: $(appveyor_repo_tag_name)
6088
description: 'Latest release build of Shockolate'
61-
artifact: systemshock-windows.zip
89+
artifact: systemshock-x86.zip, systemshock-x64.zip
6290
auth_token:
6391
secure: P1kIk8rRxKAYHqDrOWf0Zf5spfR+N86E0lO8VBu99vHtECJgPLn/Z6tBmL9cxPah
6492
on:

Diff for: build_deps.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function build_sdl {
2424
tar xvf SDL2-${SDL_version}.tar.gz
2525
pushd SDL2-${SDL_version}
2626

27-
./configure "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --prefix=${install_dir}/built_sdl
27+
./configure --prefix=${install_dir}/built_sdl
2828
make
2929
make install
3030

@@ -37,7 +37,7 @@ function build_sdl_mixer {
3737
pushd SDL2_mixer-${SDL2_mixer_version}
3838

3939
export SDL2_CONFIG="${install_dir}/built_sdl/bin/sdl2-config"
40-
./configure "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --prefix=${install_dir}/built_sdl_mixer
40+
./configure --prefix=${install_dir}/built_sdl_mixer
4141
make
4242
make install
4343

@@ -51,8 +51,8 @@ function build_fluidsynth {
5151
# if building fluidsynth fails, move on without it
5252
set +e
5353

54-
export CFLAGS="-m32"
55-
export CXXFLAGS="-m32"
54+
#export CFLAGS="-m32"
55+
#export CXXFLAGS="-m32"
5656

5757
cmake .
5858
cmake --build .

Diff for: build_windows.sh renamed to build_win32.sh

File renamed without changes.

Diff for: build_win64.sh

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SDL_version=2.0.10
5+
SDL2_mixer_version=2.0.4
6+
GLEW_version=2.1.0
7+
CMAKE_version=3.11.3
8+
CMAKE_architecture=win64-x64
9+
#CMAKE_architecture=win32-x86
10+
CMAKE_target=Unix\ Makefiles
11+
12+
# Removing the mwindows linker option lets us get console output
13+
function remove_mwindows {
14+
sed -i -e "s/ \-mwindows//g" Makefile
15+
}
16+
17+
function build_sdl {
18+
curl -O https://www.libsdl.org/release/SDL2-devel-${SDL_version}-mingw.tar.gz
19+
tar xvf SDL2-devel-${SDL_version}-mingw.tar.gz
20+
cp -r SDL2-${SDL_version}/x86_64-w64-mingw32/ built_sdl/
21+
}
22+
23+
function build_sdl_mixer {
24+
curl -O https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-${SDL2_mixer_version}-mingw.tar.gz
25+
tar xf SDL2_mixer-devel-${SDL2_mixer_version}-mingw.tar.gz --exclude=Xcode
26+
cp -r SDL2_mixer-${SDL2_mixer_version}/x86_64-w64-mingw32/ built_sdl_mixer/
27+
}
28+
29+
function build_glew {
30+
curl -O https://netcologne.dl.sourceforge.net/project/glew/glew/${GLEW_version}/glew-${GLEW_version}.tgz
31+
tar xvf glew-${GLEW_version}.tgz
32+
mv glew-${GLEW_version}/ built_glew/
33+
pushd built_glew
34+
mingw32-make glew.lib
35+
popd
36+
}
37+
38+
function build_fluidsynth {
39+
git clone https://github.com/Doom64/fluidsynth-lite.git
40+
pushd fluidsynth-lite
41+
sed -i 's/DLL"\ off/DLL"\ on/' CMakeLists.txt
42+
# if building fluidsynth fails, move on without it
43+
set +e
44+
cmake -G "${CMAKE_target}" .
45+
cmake --build .
46+
47+
# download a soundfont that's close to the Windows default everyone knows
48+
curl -o music.sf2 http://rancid.kapsi.fi/windows.sf2
49+
set -e
50+
popd
51+
}
52+
53+
function get_cmake {
54+
curl -O https://cmake.org/files/v3.11/cmake-${CMAKE_version}-${CMAKE_architecture}.zip
55+
unzip cmake-${CMAKE_version}-${CMAKE_architecture}.zip
56+
pushd cmake-${CMAKE_version}-${CMAKE_architecture}/bin
57+
CMAKE_ROOT=`pwd -W`/
58+
popd
59+
}
60+
61+
## Actual building starts here
62+
63+
if [ -d ./build_ext/ ]; then
64+
echo A directory named build_ext already exists.
65+
echo Please remove it if you want to recompile.
66+
exit
67+
fi
68+
69+
rm -rf CMakeFiles/
70+
rm -rf CMakeCache.txt
71+
72+
cp windows/make.exe /usr/bin/
73+
74+
if [ ! -d ./res/ ]; then
75+
mkdir ./res/
76+
fi
77+
78+
mkdir ./build_ext/
79+
cd ./build_ext/
80+
install_dir=`pwd -W`
81+
82+
if ! [ -x "$(command -v cmake)" ]; then
83+
echo "Getting CMake"
84+
get_cmake
85+
fi
86+
87+
88+
build_sdl
89+
build_sdl_mixer
90+
build_glew
91+
build_fluidsynth
92+
93+
94+
# Back to the root directory, copy required DLL files for the executable
95+
cd ..
96+
cp build_ext/built_sdl/bin/SDL*.dll .
97+
cp build_ext/built_sdl_mixer/bin/SDL*.dll .
98+
cp build_ext/built_glew/lib/*.dll .
99+
cp build_ext/fluidsynth-lite/src/*.dll .
100+
101+
# move the soundfont to the correct place if we successfully built fluidsynth
102+
mv build_ext/fluidsynth-lite/*.sf2 ./res
103+
104+
# Set up build.bat
105+
if [[ -z "${APPVEYOR}" ]]; then
106+
echo "Normal build"
107+
echo "@echo off
108+
set PATH=%PATH%;${CMAKE_ROOT}
109+
cmake -G \"${CMAKE_target}\" .
110+
mingw32-make systemshock" >build.bat
111+
else
112+
echo "Appveyor"
113+
echo "cmake -G \"${CMAKE_target}\" .
114+
make systemshock" >build.bat
115+
fi
116+
117+
echo "Our work here is done. Run BUILD.BAT in a Windows shell to build the actual source."

0 commit comments

Comments
 (0)