mirror of
https://github.com/minetest/minetest.git
synced 2024-12-27 16:37:30 +01:00
Build for win32 & win64 on Travis too
This commit is contained in:
parent
5062b99cb0
commit
04a1a446cf
19
.travis.yml
19
.travis.yml
@ -2,15 +2,18 @@ language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
before_install:
|
||||
- if [ $CC = "clang" ]; then export PATH="/usr/bin/:$PATH"; sudo sh -c 'echo "deb http://ppa.launchpad.net/eudoxos/llvm-3.1/ubuntu precise main" >> /etc/apt/sources.list'; sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 92DE8183; sudo apt-get update; sudo apt-get install llvm-3.1; sudo apt-get install clang; fi
|
||||
- sudo apt-get install libirrlicht-dev cmake libbz2-dev libpng12-dev libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev gettext
|
||||
script:
|
||||
- mkdir -p travisbuild
|
||||
- cd travisbuild
|
||||
- cmake -DENABLE_GETTEXT=1 ..
|
||||
- make -j2
|
||||
env:
|
||||
- WINDOWS=32
|
||||
- WINDOWS=64
|
||||
- WINDOWS=no
|
||||
before_install: ./util/travis/before_install.sh
|
||||
script: ./util/travis/script.sh
|
||||
notifications:
|
||||
email: false
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- env: WINDOWS=32
|
||||
compiler: clang
|
||||
- env: WINDOWS=64
|
||||
compiler: clang
|
||||
|
@ -71,13 +71,19 @@ cd $libdir
|
||||
|
||||
# Get minetest
|
||||
cd $builddir
|
||||
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
|
||||
if [ -d $EXISTING_MINETEST_DIR ]; then
|
||||
ln -s $EXISTING_MINETEST_DIR minetest
|
||||
else
|
||||
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
|
||||
fi
|
||||
cd minetest
|
||||
git_hash=`git show | head -c14 | tail -c7`
|
||||
|
||||
# Get minetest_game
|
||||
cd games
|
||||
[ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
|
||||
if [ "x$NO_MINETEST_GAME" = "x" ]; then
|
||||
[ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
# Build the thing
|
||||
|
@ -66,13 +66,19 @@ cd $libdir
|
||||
|
||||
# Get minetest
|
||||
cd $builddir
|
||||
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
|
||||
if [ -d $EXISTING_MINETEST_DIR ]; then
|
||||
ln -s $EXISTING_MINETEST_DIR minetest
|
||||
else
|
||||
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
|
||||
fi
|
||||
cd minetest
|
||||
git_hash=`git show | head -c14 | tail -c7`
|
||||
|
||||
# Get minetest_game
|
||||
cd games
|
||||
[ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
|
||||
if [ "x$NO_MINETEST_GAME" = "x" ]; then
|
||||
[ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
# Build the thing
|
||||
|
29
util/travis/before_install.sh
Executable file
29
util/travis/before_install.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
if [ $CC = "clang" ]; then
|
||||
export PATH="/usr/bin/:$PATH"
|
||||
sudo sh -c 'echo "deb http://ppa.launchpad.net/eudoxos/llvm-3.1/ubuntu precise main" >> /etc/apt/sources.list'
|
||||
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 92DE8183
|
||||
sudo apt-get update
|
||||
sudo apt-get install llvm-3.1
|
||||
sudo apt-get install clang
|
||||
fi
|
||||
if [ $WINDOWS = "no" ]; then
|
||||
sudo apt-get install libirrlicht-dev cmake libbz2-dev libpng12-dev \
|
||||
libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev \
|
||||
libvorbis-dev libopenal-dev gettext
|
||||
else
|
||||
sudo apt-get install p7zip-full
|
||||
if [ $WINDOWS = "32" ]; then
|
||||
wget http://meow.minetest.net/mingw_w64_i686_ubuntu12.04_4.9.1.7z -O mingw.7z
|
||||
sed -e "s|%PREFIX%|i686-w64-mingw32|" \
|
||||
-e "s|%ROOTPATH%|/usr/i686-w64-mingw32|" \
|
||||
< util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw.cmake
|
||||
elif [ $WINDOWS = "64" ]; then
|
||||
wget http://meow.minetest.net/mingw_w64_x86_64_ubuntu12.04_4.9.1.7z -O mingw.7z
|
||||
sed -e "s|%PREFIX%|x86_64-w64-mingw32|" \
|
||||
-e "s|%ROOTPATH%|/usr/x86_64-w64-mingw32|" \
|
||||
< util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw64.cmake
|
||||
fi
|
||||
sudo 7z x -y -o/usr mingw.7z
|
||||
fi
|
24
util/travis/script.sh
Executable file
24
util/travis/script.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
if [ $WINDOWS = "no" ]; then
|
||||
mkdir -p travisbuild
|
||||
cd travisbuild
|
||||
cmake -DENABLE_GETTEXT=1 ..
|
||||
make -j2
|
||||
else
|
||||
[ $CC = "clang" ] && exit 1 # Not supposed to happen
|
||||
# We need to have our build directory outside of the minetest directory because
|
||||
# CMake will otherwise get very very confused with symlinks and complain that
|
||||
# something is not a subdirectory of something even if it actually is.
|
||||
# e.g.:
|
||||
# /home/travis/minetest/minetest/travisbuild/minetest
|
||||
# \/ \/ \/
|
||||
# /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest
|
||||
# \/ \/ \/
|
||||
# /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest/travisbuild/minetest
|
||||
# You get the idea.
|
||||
OLDDIR=`pwd`
|
||||
cd ..
|
||||
[ $WINDOWS = "32" ] && EXISTING_MINETEST_DIR=$OLDDIR NO_MINETEST_GAME=1 $OLDDIR/util/buildbot/buildwin32.sh travisbuild && exit 0
|
||||
[ $WINDOWS = "64" ] && EXISTING_MINETEST_DIR=$OLDDIR NO_MINETEST_GAME=1 $OLDDIR/util/buildbot/buildwin64.sh travisbuild && exit 0
|
||||
fi
|
17
util/travis/toolchain_mingw.cmake.in
Normal file
17
util/travis/toolchain_mingw.cmake.in
Normal file
@ -0,0 +1,17 @@
|
||||
# name of the target operating system
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
# which compilers to use for C and C++
|
||||
SET(CMAKE_C_COMPILER %PREFIX%-gcc)
|
||||
SET(CMAKE_CXX_COMPILER %PREFIX%-g++)
|
||||
SET(CMAKE_RC_COMPILER %PREFIX%-windres)
|
||||
|
||||
# here is the target environment located
|
||||
SET(CMAKE_FIND_ROOT_PATH %ROOTPATH%)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
Loading…
Reference in New Issue
Block a user