mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 13:23:59 +02:00
Travis:add tests for more gcc versions (#199)
* travis:add tests for other versions of gcc * cmakelists.txt:add c++11 flag by default, doesn't build using gcc-5 the llvm toolchain is needed for the clang-6.0 test. Recently something changed on travis where adding the llvm toolchain by using the "addons" directive in .travis.yml fails because "allow-unauthenticated" isn't passed, which seems to be the only way to add the repo. Moving that to the script, and cleaning up the script a little.
This commit is contained in:
@@ -2,74 +2,62 @@
|
|||||||
# script for use with travis and on linux only
|
# script for use with travis and on linux only
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015-2016 MegaGlest Team under GNU GPL v3.0+
|
# Copyright (c) 2015-2016 MegaGlest Team under GNU GPL v3.0+
|
||||||
|
#
|
||||||
|
# Copyright (c) 2018
|
||||||
|
# modified for ZetaGlest <https://github.com/ZetaGlest>
|
||||||
|
# ZetaGlest Team
|
||||||
|
|
||||||
|
# This only needs to be changed when Travis updates the Ubuntu version
|
||||||
|
# it's using.
|
||||||
|
codename=trusty
|
||||||
|
|
||||||
export LANG=C
|
|
||||||
SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# Load shared functions
|
|
||||||
. $SCRIPTDIR/mk/linux/mg_shared.sh
|
|
||||||
detect_system
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
Compiler_name="$1"; Compiler_version="$2"
|
Compiler_name="$1"; Compiler_version="$2"
|
||||||
Compiler_version_grep="$(echo "$Compiler_version" | sed 's/\./\\./g')"
|
Compiler_version_grep="$(echo "$Compiler_version" | sed 's/\./\\./g')"
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
if [ "$Compiler_version" != "" ] && [ "$Compiler_version" != "default" ]; then
|
if [ "$Compiler_version" != "" ] && [ "$Compiler_version" != "default" ]; then
|
||||||
# UPDATE REPOS
|
# UPDATE REPOS
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
sudo apt-get install -y -qq
|
sudo apt-get install -y -qq
|
||||||
|
|
||||||
set +x
|
set +x
|
||||||
if [ "$Compiler_name" = "gcc" ]; then
|
if [ "$Compiler_name" = "gcc" ]; then
|
||||||
VersionAvByDefault="$(apt-cache search ^g[c+][c+]-[0-9] | grep -v '[0-9]-[a-zA-Z]' | grep "^gcc-$Compiler_version_grep")"
|
VersionAvByDefault="$(apt-cache search ^g[c+][c+]-[0-9] | grep -v '[0-9]-[a-zA-Z]' | grep "^gcc-$Compiler_version_grep")"
|
||||||
elif [ "$Compiler_name" = "clang" ]; then
|
elif [ "$Compiler_name" = "clang" ]; then
|
||||||
VersionAvByDefault="$(apt-cache search ^clang-[0-9] | grep -v '[0-9]-[a-zA-Z]' | grep "^clang-$Compiler_version_grep")"
|
VersionAvByDefault="$(apt-cache search ^clang-[0-9] | grep -v '[0-9]-[a-zA-Z]' | grep "^clang-$Compiler_version_grep")"
|
||||||
fi
|
fi
|
||||||
set -x
|
set -x
|
||||||
if [ "$VersionAvByDefault" = "" ]; then
|
if [ "$VersionAvByDefault" = "" ]; then
|
||||||
if [ "$distribution" = "Ubuntu" ]; then
|
# ubuntu test toolchain needed for more recent version of gcc and clang-6.0
|
||||||
#if [ "$Compiler_name" = "gcc" ] || ( [ "$Compiler_name" = "clang" ] && [ "$codename" = "precise" ] ); then
|
sudo add-apt-repository --yes "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${codename} main"
|
||||||
if [ "$Compiler_name" = "gcc" ] || [ "$Compiler_name" = "clang" ]; then
|
fi
|
||||||
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
|
|
||||||
sudo add-apt-repository --yes "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${codename} main"
|
|
||||||
#sudo add-apt-repository --yes "deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${codename} main"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$distribution" = "Ubuntu" ] || [ "$distribution" = "Debian" ]; then
|
|
||||||
if [ "$Compiler_name" = "clang" ]; then
|
|
||||||
# http://apt.llvm.org/
|
|
||||||
sudo add-apt-repository --yes "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename} main"
|
|
||||||
#sudo add-apt-repository --yes "deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename} main"
|
|
||||||
sudo add-apt-repository --yes "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${Compiler_version} main"
|
|
||||||
#sudo add-apt-repository --yes "deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${Compiler_version} main"
|
|
||||||
|
|
||||||
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$VersionAvByDefault" = "" ]; then
|
if [ "$VersionAvByDefault" = "" ]; then
|
||||||
# UPDATE REPOS
|
# UPDATE REPOS
|
||||||
sudo apt-get update -qq
|
sudo apt-get update -qq
|
||||||
#sudo apt-get upgrade -qq # UPGRADE SYSTEM TO LATEST PATCH LEVEL
|
sudo apt-get install -y -qq
|
||||||
sudo apt-get install -y -qq
|
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$Compiler_version" != "" ] && [ "$Compiler_version" != "default" ]; then
|
if [ "$Compiler_version" != "" ] && [ "$Compiler_version" != "default" ]; then
|
||||||
if [ "$Compiler_name" = "gcc" ]; then
|
if [ "$Compiler_name" = "gcc" ]; then
|
||||||
set +ex
|
set +ex
|
||||||
Gcc_AvSepGpp="$(apt-cache search ^g[c+][c+]-[0-9] | grep -v '[0-9]-[a-zA-Z]' | grep "^g++-$Compiler_version_grep")"
|
Gcc_AvSepGpp="$(apt-cache search ^g[c+][c+]-[0-9] | grep -v '[0-9]-[a-zA-Z]' | grep "^g++-$Compiler_version_grep")"
|
||||||
set -ex
|
set -ex
|
||||||
if [ "$Gcc_AvSepGpp" = "" ]; then
|
if [ "$Gcc_AvSepGpp" = "" ]; then
|
||||||
sudo apt-get --allow-unauthenticated install -qq --force-yes gcc-${Compiler_version}
|
sudo apt-get --allow-unauthenticated install -qq --force-yes gcc-${Compiler_version}
|
||||||
else
|
else
|
||||||
sudo apt-get --allow-unauthenticated install -qq --force-yes gcc-${Compiler_version} g++-${Compiler_version}
|
sudo apt-get --allow-unauthenticated install -qq --force-yes gcc-${Compiler_version} g++-${Compiler_version}
|
||||||
fi
|
|
||||||
elif [ "$Compiler_name" = "clang" ]; then
|
|
||||||
sudo apt-get --allow-unauthenticated install -qq --force-yes clang-${Compiler_version}
|
|
||||||
fi
|
fi
|
||||||
|
elif [ "$Compiler_name" = "clang" ]; then
|
||||||
|
# llvm-toolchain needed for more recent version of clang
|
||||||
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||||
|
sudo -E apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main"
|
||||||
|
sudo -E apt-get -yq update &>> ~/apt-get-update.log
|
||||||
|
sudo -E apt-get -yq --no-install-suggests --allow-unauthenticated \
|
||||||
|
--no-install-recommends $TRAVIS_APT_OPTS install clang-${Compiler_version}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# what available versions we can use
|
# what available versions we can use
|
||||||
@@ -79,20 +67,8 @@ apt-cache search ^clang-[0-9] | grep -v '[0-9]-[a-zA-Z]'
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
# INSTALL OUR DEPENDENCIES
|
# INSTALL OUR DEPENDENCIES
|
||||||
sudo $SCRIPTDIR/mk/linux/setupBuildDeps.sh --quiet
|
|
||||||
|
|
||||||
if [ "$distribution" = "Ubuntu" ]; then
|
# These 2 don't get installed automatically, but are required for libsdl2-dev
|
||||||
case $release in
|
sudo apt-get install -y -q libegl1-mesa-dev libgles2-mesa-dev
|
||||||
12.04*)
|
|
||||||
SDL2_version="2.0.5"
|
sudo mk/linux/setupBuildDeps.sh --quiet
|
||||||
wget https://www.libsdl.org/release/SDL2-${SDL2_version}.tar.gz
|
|
||||||
tar xf SDL2-${SDL2_version}.tar.gz
|
|
||||||
( cd SDL2-${SDL2_version}
|
|
||||||
./configure --enable-static --disable-shared
|
|
||||||
make
|
|
||||||
sudo make install )
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
48
.travis.yml
48
.travis.yml
@@ -7,39 +7,29 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
addons:
|
env: Tr_Compiler_Version="default"
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- libsdl2-dev
|
|
||||||
env: Tr_Compiler_Version="7"
|
|
||||||
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
|
|
||||||
dist: trusty # broken compiler on 12.04
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
addons:
|
env: Tr_Compiler_Version="5"
|
||||||
apt:
|
- os: linux
|
||||||
packages:
|
compiler: gcc
|
||||||
- libsdl2-dev
|
env: Tr_Compiler_Version="6"
|
||||||
env: Tr_Compiler_Version="default"
|
- os: linux
|
||||||
dist: trusty
|
compiler: gcc
|
||||||
|
env: Tr_Compiler_Version="7"
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
env: Tr_Compiler_Version="8"
|
||||||
|
|
||||||
|
# clang
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
addons:
|
env: Tr_Compiler_Version="default"
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- libsdl2-dev
|
|
||||||
env: Tr_Compiler_Version="5.0"
|
|
||||||
# http://apt.llvm.org/, compiler not newer than available on debian testing
|
|
||||||
# https://packages.debian.org/search?suite=testing&keywords=clang-
|
|
||||||
dist: trusty
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
addons:
|
env: Tr_Compiler_Version="6.0"
|
||||||
apt:
|
|
||||||
packages:
|
# osx
|
||||||
- libsdl2-dev
|
|
||||||
env: Tr_Compiler_Version="default"
|
|
||||||
dist: trusty # broken compiler on 12.04
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode9.2
|
osx_image: xcode9.2
|
||||||
env: Tr_Xcode_Version="9.2"
|
env: Tr_Xcode_Version="9.2"
|
||||||
@@ -50,10 +40,6 @@ matrix:
|
|||||||
git:
|
git:
|
||||||
submodules: false
|
submodules: false
|
||||||
|
|
||||||
#branches:
|
|
||||||
# only:
|
|
||||||
# - master
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./.travis-before_install.sh "$CC" "$Tr_Compiler_Version"; fi
|
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./.travis-before_install.sh "$CC" "$Tr_Compiler_Version"; fi
|
||||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
|
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
|
||||||
|
@@ -7,14 +7,7 @@ SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
|||||||
IF(BUILD_ZETAGLEST_MODEL_VIEWER)
|
IF(BUILD_ZETAGLEST_MODEL_VIEWER)
|
||||||
MESSAGE(STATUS "Will try to build ZetaGlest model viewer")
|
MESSAGE(STATUS "Will try to build ZetaGlest model viewer")
|
||||||
|
|
||||||
IF(UNIX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
ADD_DEFINITIONS("-std=c++11")
|
||||||
IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.7 OR NOT "${CMAKE_CXX_COMPILER_VERSION}")
|
|
||||||
ADD_DEFINITIONS("-std=gnu++0x")
|
|
||||||
ELSEIF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 5.1)
|
|
||||||
ADD_DEFINITIONS("-std=c++11")
|
|
||||||
ENDIF()
|
|
||||||
# Was required at least on bsd and macos.
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
||||||
INCLUDE_DIRECTORIES(${${SDL_VERSION_NAME}_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${${SDL_VERSION_NAME}_INCLUDE_DIR})
|
||||||
|
@@ -6,15 +6,7 @@ SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
|||||||
|
|
||||||
IF(BUILD_ZETAGLEST_MAP_EDITOR)
|
IF(BUILD_ZETAGLEST_MAP_EDITOR)
|
||||||
MESSAGE(STATUS "Will try to build ZetaGlest map editor")
|
MESSAGE(STATUS "Will try to build ZetaGlest map editor")
|
||||||
|
ADD_DEFINITIONS("-std=c++11")
|
||||||
IF(UNIX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
|
||||||
IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.7 OR NOT "${CMAKE_CXX_COMPILER_VERSION}")
|
|
||||||
ADD_DEFINITIONS("-std=gnu++0x")
|
|
||||||
ELSEIF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 5.1)
|
|
||||||
ADD_DEFINITIONS("-std=c++11")
|
|
||||||
ENDIF()
|
|
||||||
# Was required at least on bsd and macos.
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
||||||
INCLUDE_DIRECTORIES(${${SDL_VERSION_NAME}_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${${SDL_VERSION_NAME}_INCLUDE_DIR})
|
||||||
|
Reference in New Issue
Block a user