.gitignore: make some ignore rules more specific to rule out side effects
.travis.yml: now that gcc is fixed, build on clang, too LICENSE.md: there is no need for this symlink since the license file is not displayed on github anyways README.md: This file is not in MD format, so renamed symlink to .TXT build-mg.sh: improve configurability, script structure (will externalize distro/arch detection next)
This commit is contained in:
parent
941257c247
commit
d75aefc35e
|
@ -60,9 +60,9 @@ $RECYCLE.BIN/
|
|||
*.blend
|
||||
*.blend1
|
||||
# Linux_build
|
||||
build/
|
||||
google-breakpad
|
||||
mk/linux/megaglest.6
|
||||
/build/
|
||||
/google-breakpad
|
||||
/mk/linux/megaglest.6
|
||||
# Windows_build
|
||||
*.dll
|
||||
*.exe
|
||||
|
@ -72,10 +72,9 @@ mk/linux/megaglest.6
|
|||
*.map
|
||||
*.dmp
|
||||
*.dat
|
||||
data/glest_game/lua/
|
||||
/data/glest_game/lua/
|
||||
#
|
||||
|
||||
|
||||
/source/windows_deps_2012
|
||||
/source/windows_deps_2010
|
||||
/source/windows_deps_2010_old
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
#- clang
|
||||
- clang
|
||||
before_install:
|
||||
- sudo apt-get update -qq # UPDATE REPOS
|
||||
- free -m
|
||||
- df -h
|
||||
#- free -m
|
||||
#- df -h
|
||||
- sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL DEPENDENCIES HERE
|
||||
script:
|
||||
# ALL THE BUILD COMMANDS HERE
|
||||
- ./build-mg.sh 1core
|
||||
- dmesg
|
||||
#- dmesg
|
||||
notifications:
|
||||
irc:
|
||||
channels:
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
docs/COPYRIGHT.source_code.txt
|
69
build-mg.sh
69
build-mg.sh
|
@ -4,34 +4,59 @@
|
|||
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
||||
|
||||
# to enable clang compilation:
|
||||
# 1. sudo apt-get install clang
|
||||
# 2. Set the two vars below, WANT_CLANG=YES and CLANG_BIN_PATH=<path to the clang binary>
|
||||
# OR: set both the CC and CXX environment variables to point to clang and clang++ respectively
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Configuration section
|
||||
#
|
||||
|
||||
# Default to English language output so we can understand your bug reports
|
||||
export LANG=C
|
||||
|
||||
# Compiler selection
|
||||
# Unless both the CC and CXX environment variables point to clang and clang++
|
||||
# respectively, we use GCC. To enforce clang compilation:
|
||||
# 1. Install clang (sudo apt-get install clang)
|
||||
# 2. Set the two vars below:
|
||||
# WANT_CLANG=YES and CLANG_BIN_PATH=<path_to_the_clang_binary>
|
||||
WANT_CLANG=NO
|
||||
CLANG_BIN_PATH=/usr/bin/
|
||||
|
||||
LANG=C
|
||||
# Google breakpad integration (cross platform memory dumps) - OPTIONAL
|
||||
# Set this to the root path of your Google breakpad subversion working copy.
|
||||
# By default, this script looks for a "google-breakpad" sub-directory within
|
||||
# the directory this script resides in. If this directory is not found, Cmake
|
||||
# will warn about it later.
|
||||
# Instead of editing this variable, consider creating a symbolic link:
|
||||
# ln -s ../../google-breakpad google-breakpad
|
||||
BREAKPAD_ROOT="$(dirname $(readlink -f $0))/google-breakpad/"
|
||||
|
||||
# CMake options
|
||||
# The default configuration works fine for regular developers and is also used
|
||||
# by our installers.
|
||||
# For more cmake/build options refer to
|
||||
# http://wiki.megaglest.org/Linux_Compiling#Building_using_CMake_by_Hand
|
||||
EXTRA_CMAKE_OPTIONS=
|
||||
|
||||
# Build threads
|
||||
# By default we use all available CPU cores to build.
|
||||
# Pass '1core' as first command line argument to use only one.
|
||||
NUMCORES=`lscpu -p | grep -cv '^#'`
|
||||
echo "CPU cores detected: $NUMCORES"
|
||||
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
||||
if [ "$1" = '1core' ]; then NUMCORES=1; fi
|
||||
echo "CPU cores to be used: $NUMCORES"
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
CURRENTDIR="$(dirname $(readlink -f $0))"
|
||||
|
||||
if [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
|
||||
|
||||
# This is for regular developers and used by our installer
|
||||
# For more cmake/build options refer to
|
||||
# http://wiki.megaglest.org/Linux_Compiling#Building_using_CMake_by_Hand
|
||||
# this script looks for google-breakpad in the main root folder, you may link to the real path using:
|
||||
# ln -s ../../google-breakpad/ google-breakpad
|
||||
|
||||
LANG=C
|
||||
svnversion=`readlink -f $0 | xargs dirname | xargs svnversion`
|
||||
architecture=`uname -m`
|
||||
|
||||
# Is the lsb_release command supported?
|
||||
# Get distribution and architecture details
|
||||
if [ `which lsb_release`'x' = 'x' ]
|
||||
then
|
||||
lsb=0
|
||||
|
@ -89,11 +114,11 @@ else
|
|||
#Release: 12.04
|
||||
#Codename: precise
|
||||
fi
|
||||
architecture=`uname -m`
|
||||
|
||||
echo 'We have detected the following system:'
|
||||
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
|
||||
|
||||
EXTRA_CMAKE_OPTIONS=
|
||||
|
||||
case $distribution in
|
||||
SuSE|SUSE?LINUX|Opensuse)
|
||||
|
@ -117,12 +142,14 @@ esac
|
|||
|
||||
#exit 1;
|
||||
|
||||
CURRENTDIR="$(dirname $(readlink -f $0))"
|
||||
|
||||
if [ "$WANT_CLANG" = 'YES' -o "`echo $CXX | grep -Fq 'clang'`" = 'clang' ]; then
|
||||
# If, in the configuration section on top of this script, the user has
|
||||
# indicated they want to use clang in favor of the default of GCC, use clang.
|
||||
if [ "$WANT_CLANG" = 'YES' ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${CLANG_BIN_PATH}clang -DCMAKE_CXX_COMPILER=${CLANG_BIN_PATH}clang++"
|
||||
echo "USER WANTS to use CLANG / LLVM compiler! EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
||||
#exit 1;
|
||||
# If both the $CC and $CXX environment variable point to something containing
|
||||
# "clang", use whatever these environment variables point to.
|
||||
elif [ "`echo $CC | grep -Fq 'clang'`" = 'clang' -a "`echo $CXX | grep -Fq 'clang'`" = 'clang' ]; then
|
||||
if [ `echo $CC | grep -Fq '/'` = '/' ]; then
|
||||
CLANG_CC=$CC
|
||||
|
@ -140,7 +167,7 @@ elif [ "`echo $CC | grep -Fq 'clang'`" = 'clang' -a "`echo $CXX | grep -Fq 'clan
|
|||
fi
|
||||
|
||||
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
||||
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON -DWANT_STATIC_LIBS=ON -DBUILD_MEGAGLEST_TESTS=ON -DBREAKPAD_ROOT=${CURRENTDIR}/../google-breakpad/ ${EXTRA_CMAKE_OPTIONS} ..
|
||||
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON -DWANT_STATIC_LIBS=ON -DBUILD_MEGAGLEST_TESTS=ON -DBREAKPAD_ROOT=$BREAKPAD_ROOT $EXTRA_CMAKE_OPTIONS ..
|
||||
if [ $? -ne 0 ]; then
|
||||
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
||||
fi
|
||||
|
@ -155,8 +182,6 @@ cd ..
|
|||
echo ''
|
||||
echo 'BUILD COMPLETE.'
|
||||
echo ''
|
||||
echo 'To build with google-breakpad support pass the path to the library as follows:'
|
||||
echo 'cmake -DBREAKPAD_ROOT=/home/softcoder/Code/google-breakpad/'
|
||||
echo 'To launch MegaGlest from the current directory, use:'
|
||||
echo ' mk/linux/megaglest --ini-path=mk/linux/ --data-path=mk/linux/'
|
||||
echo 'Or change into mk/linux and run it from there:'
|
||||
|
|
Loading…
Reference in New Issue