Add Windows tests to Travis
parent
273e342ba0
commit
b90a211f97
19
.travis.yml
19
.travis.yml
|
@ -2,9 +2,16 @@ 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 keyserver.ubuntu.com --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 libpng12-dev libbz2-dev libjpeg8-dev libgl1-mesa-dev libxxf86vm-dev libgl1-mesa-dev
|
||||
script: cmake . && make
|
||||
notifications:
|
||||
email: false
|
||||
env:
|
||||
- PLATFORM=Win32
|
||||
- PLATFORM=Win64
|
||||
- PLATFORM=Linux
|
||||
before_install: ./util/travis/before_install.sh
|
||||
script: ./util/travis/script.sh
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- env: PLATFORM=Win32
|
||||
compiler: clang
|
||||
- env: PLATFORM=Win64
|
||||
compiler: clang
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
# Set up project
|
||||
#
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(NodeBoxEditor)
|
||||
project(nodeboxeditor)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
||||
|
||||
#
|
||||
# Configuration
|
||||
#
|
||||
|
||||
set(NBE_MAJOR_VERSION 0)
|
||||
set(NBE_MINOR_VERSION 8)
|
||||
set(NBE_PATCH_VERSION 1)
|
||||
|
@ -108,12 +109,9 @@ endif(UNIX)
|
|||
# Executable
|
||||
#
|
||||
file(MAKE_DIRECTORY "bin")
|
||||
SET(CMAKE_CXX_FLAGS
|
||||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -pthread")
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME bin/nodeboxeditor
|
||||
)
|
||||
|
||||
#
|
||||
# Installation
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
#!/bin/bash
|
||||
# Taken from https://github.com/minetest/minetest LGPL 2.1 or later
|
||||
|
||||
set -e
|
||||
|
||||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <build directory>"
|
||||
exit 1
|
||||
fi
|
||||
builddir=$1
|
||||
mkdir -p $builddir
|
||||
mkdir -p $builddir/bin
|
||||
builddir="$( cd "$builddir" && pwd )"
|
||||
packagedir=$builddir/packages
|
||||
libdir=$builddir/libs
|
||||
|
||||
toolchain_file=$dir/toolchain_mingw.cmake
|
||||
irrlicht_version=1.8.1
|
||||
zlib_version=1.2.8
|
||||
|
||||
mkdir -p $packagedir
|
||||
mkdir -p $libdir
|
||||
|
||||
cd $builddir
|
||||
|
||||
# Get stuff
|
||||
[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://sfan5.pf-control.de/irrlicht-$irrlicht_version-win32.zip \
|
||||
-c -O $packagedir/irrlicht-$irrlicht_version.zip
|
||||
[ -e $packagedir/zlib-$zlib_version.zip ] || wget http://sfan5.pf-control.de/zlib-$zlib_version-win32.zip \
|
||||
-c -O $packagedir/zlib-$zlib_version.zip
|
||||
|
||||
|
||||
# Extract stuff
|
||||
cd $libdir
|
||||
[ -d irrlicht-$irrlicht_version ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip
|
||||
[ -d zlib ] || unzip -o $packagedir/zlib-$zlib_version.zip -d zlib
|
||||
|
||||
|
||||
# Get nodeboxeditor
|
||||
cd $builddir
|
||||
if [ ! "x$EXISTING_nodeboxeditor_DIR" = "x" ]; then
|
||||
ln -s $EXISTING_nodeboxeditor_DIR nodeboxeditor
|
||||
else
|
||||
[ -d nodeboxeditor ] && (cd nodeboxeditor && git pull) || (git clone https://github.com/rubenwardy/nodeboxeditor)
|
||||
fi
|
||||
cd nodeboxeditor
|
||||
git_hash=`git show | head -c14 | tail -c7`
|
||||
|
||||
# Build the thing
|
||||
[ -d _build ] && rm -Rf _build/
|
||||
mkdir _build
|
||||
cd _build
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=/tmp \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
||||
\
|
||||
-DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht-$irrlicht_version/include \
|
||||
-DIRRLICHT_LIBRARY=$libdir/irrlicht-$irrlicht_version/lib/Win32-gcc/libIrrlicht.dll.a \
|
||||
-DIRRLICHT_DLL=$libdir/irrlicht-$irrlicht_version/bin/Win32-gcc/Irrlicht.dll \
|
||||
\
|
||||
-DZLIB_INCLUDE_DIR=$libdir/zlib/include \
|
||||
-DZLIB_LIBRARIES=$libdir/zlib/lib/zlibwapi.dll.a \
|
||||
-DZLIB_DLL=$libdir/zlib/bin/zlib1.dll \
|
||||
-DZLIBWAPI_DLL=$libdir/zlib/bin/zlibwapi.dll
|
||||
|
||||
make package -j2
|
||||
|
||||
# EOF
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/bash
|
||||
# Taken from https://github.com/minetest/minetest LGPL 2.1 or later
|
||||
|
||||
set -e
|
||||
|
||||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <build directory>"
|
||||
exit 1
|
||||
fi
|
||||
builddir=$1
|
||||
mkdir -p $builddir
|
||||
mkdir -p $builddir/bin
|
||||
builddir="$( cd "$builddir" && pwd )"
|
||||
packagedir=$builddir/packages
|
||||
libdir=$builddir/libs
|
||||
|
||||
toolchain_file=$dir/toolchain_mingw64.cmake
|
||||
irrlicht_version=1.8.1
|
||||
zlib_version=1.2.8
|
||||
|
||||
mkdir -p $packagedir
|
||||
mkdir -p $libdir
|
||||
|
||||
cd $builddir
|
||||
|
||||
# Get stuff
|
||||
[ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://sfan5.pf-control.de/irrlicht-$irrlicht_version-win64.zip \
|
||||
-c -O $packagedir/irrlicht-$irrlicht_version.zip
|
||||
[ -e $packagedir/zlib-$zlib_version.zip ] || wget http://sfan5.pf-control.de/zlib-$zlib_version-win64.zip \
|
||||
-c -O $packagedir/zlib-$zlib_version.zip
|
||||
|
||||
|
||||
# Extract stuff
|
||||
cd $libdir
|
||||
[ -d irrlicht-$irrlicht_version ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip
|
||||
[ -d zlib ] || unzip -o $packagedir/zlib-$zlib_version.zip -d zlib
|
||||
|
||||
# Get nodeboxeditor
|
||||
cd $builddir
|
||||
if [ ! "x$EXISTING_nodeboxeditor_DIR" = "x" ]; then
|
||||
ln -s $EXISTING_nodeboxeditor_DIR nodeboxeditor
|
||||
else
|
||||
[ -d nodeboxeditor ] && (cd nodeboxeditor && git pull) || (git clone https://github.com/rubenwardy/nodeboxeditor)
|
||||
fi
|
||||
cd nodeboxeditor
|
||||
git_hash=`git show | head -c14 | tail -c7`
|
||||
|
||||
# Build the thing
|
||||
[ -d _build ] && rm -Rf _build/
|
||||
mkdir _build
|
||||
cd _build
|
||||
cmake .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
||||
-DCMAKE_INSTALL_PREFIX=/tmp \
|
||||
\
|
||||
-DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht-$irrlicht_version/include \
|
||||
-DIRRLICHT_LIBRARY=$libdir/irrlicht-$irrlicht_version/lib/Win64-gcc/libIrrlicht.dll.a \
|
||||
-DIRRLICHT_DLL=$libdir/irrlicht-$irrlicht_version/bin/Win64-gcc/Irrlicht.dll \
|
||||
\
|
||||
-DZLIB_INCLUDE_DIR=$libdir/zlib/include \
|
||||
-DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
|
||||
-DZLIB_DLL=$libdir/zlib/bin/zlib1.dll
|
||||
|
||||
make package -j2
|
||||
|
||||
# EOF
|
|
@ -0,0 +1,18 @@
|
|||
# Target operating system name
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
# Compilers to use
|
||||
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
|
||||
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
|
||||
|
||||
# Location of the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
|
||||
|
||||
# Adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search for headers and libraries in the target environment,
|
||||
# search for 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)
|
||||
|
|
@ -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 x86_64-w64-mingw32-gcc)
|
||||
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||
|
||||
# here is the target environment located
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||
|
||||
# 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)
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash -e
|
||||
# Taken from https://github.com/minetest/minetest LGPL 2.1 or later
|
||||
|
||||
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 p7zip-full
|
||||
if [[ $PLATFORM == "Linux" ]]; then
|
||||
sudo apt-get install libirrlicht-dev cmake libbz2-dev libpng12-dev \
|
||||
libjpeg-dev libxxf86vm-dev libgl1-mesa-dev
|
||||
elif [[ $PLATFORM == "Win32" ]]; then
|
||||
wget http://sfan5.pf-control.de/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
|
||||
sudo 7z x -y -o/usr mingw.7z
|
||||
elif [[ $PLATFORM == "Win64" ]]; then
|
||||
wget http://sfan5.pf-control.de/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
|
||||
sudo 7z x -y -o/usr mingw.7z
|
||||
fi
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash -e
|
||||
# Taken from https://github.com/minetest/minetest LGPL 2.1 or later
|
||||
|
||||
if [[ $PLATFORM == "Linux" ]]; then
|
||||
mkdir -p travisbuild
|
||||
cd travisbuild
|
||||
CMAKE_FLAGS='-DCMAKE_BUILD_TYPE=Debug'
|
||||
cmake $CMAKE_FLAGS ..
|
||||
make -j2 && exit 0
|
||||
elif [[ $PLATFORM == Win* ]]; then
|
||||
[[ $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 ..
|
||||
export EXISTING_nodeboxeditor_DIR=$OLDDIR
|
||||
if [[ $PLATFORM == "Win32" ]]; then
|
||||
$OLDDIR/util/buildbot/buildwin32.sh travisbuild && exit 0
|
||||
elif [[ $PLATFORM == "Win64" ]]; then
|
||||
$OLDDIR/util/buildbot/buildwin64.sh travisbuild && exit 0
|
||||
fi
|
||||
else
|
||||
echo "Unknown platform \"${PLATFORM}\"."
|
||||
exit 1
|
||||
fi
|
|
@ -0,0 +1,18 @@
|
|||
# Target operating system name
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
# Compilers to use
|
||||
set(CMAKE_C_COMPILER %PREFIX%-gcc)
|
||||
set(CMAKE_CXX_COMPILER %PREFIX%-g++)
|
||||
set(CMAKE_RC_COMPILER %PREFIX%-windres)
|
||||
|
||||
# Location of the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH %ROOTPATH%)
|
||||
|
||||
# Adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search for headers and libraries in the target environment,
|
||||
# search for 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