Updated build scripts

This commit is contained in:
MathuSum Mut
2018-11-04 17:35:49 +01:00
parent 38784df6ef
commit cee6b245c4
9 changed files with 43 additions and 49 deletions

View File

@@ -1,9 +1,11 @@
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
PROJECT( ZetaGlest )
# The ZetaGlest CMakeLists is not supported on Windows. To compile on Windows, please use setup.bat in mk/windows
#
# The ZetaGlest CMakeLists is not supported on Windows. To compile on Windows, please use
# setup.bat in mk/windows
#SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(CMAKE_INSTALL_PREFIX, "/usr")
# build type
IF(NOT CMAKE_BUILD_TYPE)
@@ -72,7 +74,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
# For gcc warning options see: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
IF(NOT MINGW)
# For tons of verbose warnings add: -Wall
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic")
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rDynamic")
# ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -rdynamic")
ELSE()
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -DUNICODE")
@@ -151,16 +153,16 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
ENDIF()
# Debug compiler flags
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -no-pie -fno-pie")
# Release compiler flags
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 ")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 -no-pie -fno-pie")
IF(NOT CMAKE_GENERATOR STREQUAL Xcode)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
ENDIF()
# Release with debug info compiler flags
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 ")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -no-pie -fno-pie")
# Release minimum size compiler flags
IF(NOT CMAKE_GENERATOR STREQUAL Xcode)
@@ -196,8 +198,6 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
string(TOUPPER "${CMAKE_BUILD_TYPE}" ZG_BUILD_TYPE)
SET(CMAKE_CXX_FLAGS_{ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}}")
# We do some funky character escaping to get the right stuff written out to
# the final Makefile so we get the GIT Global Revsion #
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}}")
@@ -233,33 +233,6 @@ SET(SDL_VERSION_SNAME "sdl")
# output binaries to the top level of the build directory
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
IF(WIN32)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
${PROJECT_SOURCE_DIR}/source/win32_deps/lib
${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib
${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib)
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
${PROJECT_SOURCE_DIR}/source/win32_deps/include
${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854/include
${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854
${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/include
${PROJECT_SOURCE_DIR}/source/win32_deps/libogg-1.2.1/include
${PROJECT_SOURCE_DIR}/source/win32_deps/lua-5.1/src
${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b
${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141
${PROJECT_SOURCE_DIR}/source/win32_deps/zlib-1.2.5
${PROJECT_SOURCE_DIR}/source/win32_deps/curl-7.21.3/include
${PROJECT_SOURCE_DIR}/source/win32_deps/${SDL_WINDOWS_DIR_DINC}/include
${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/include)
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib)
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib)
include_directories("${PROJECT_SOURCE_DIR}/source/win32_deps/Microsoft\ DirectX\ SDK \(November 2007\)/Include")
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854/include)
ENDIF()
# Check if sources exist
IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
MESSAGE(STATUS "**Found game source code.")

View File

@@ -17,13 +17,13 @@ SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
# './setupBuildDeps.sh --manually "Debian" "stable"' is for you.
# Load shared functions
. $SCRIPTDIR/zg_shared.sh
. $SCRIPTDIR/detect-system.sh
# Got root?
if [ `id -u`'x' != '0x' ] && [ "$1" != "--manually" ]; then
echo 'This script should be run as root (UID 0).' >&2
exit 1
fi
#if [ `id -u`'x' != '0x' ] && [ "$1" != "--manually" ]; then
# echo 'This script should be run as root (UID 0).' >&2
# exit 1
#fi
if [ "$(which git 2>/dev/null)" != "" ]; then
gitcommit="$(git log -1 --pretty=tformat:"%H" $SCRIPTDIR/../..)"

View File

@@ -132,7 +132,7 @@ echo "CPU cores to be used: $NUMCORES"
# Load shared functions
. $SCRIPTDIR/zg_shared.sh
. $SCRIPTDIR/detect-system.sh
# ----------------------------------------------------------------------------
@@ -318,13 +318,10 @@ else
echo 'ERROR: MAKE failed.' >&2; exit 2
fi
git clone https://github.com/ZetaGlest/zetaglest-data.git
cd ..
echo ''
echo 'BUILD COMPLETE.'
echo ''
echo 'To launch ZetaGlest from the current directory, use:'
echo ' ./build/zetaglest'
#echo 'Or change into mk/linux and run it from there:'
#echo ' ./zetaglest --ini-path=./ --data-path=./'
echo ' ./zetaglest.sh'
fi

View File

@@ -4,5 +4,5 @@
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
./setupBuildDeps.sh
./build-zg-nosudo.sh
./build-deps.sh
./build-zg-nodeps.sh

7
mk/linux/pull.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
cd ../..
git pull
currentDir=$PWD
cd /usr/share/zetaglest
git pull
cd $currentDir

13
mk/linux/setup.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Use this script to build ZetaGlest using cmake
# ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
currentDir=$PWD
cd /usr/share
git clone https://github.com/ZetaGlest/zetaglest-data.git zetaglest
cd $currentDir
./pull.sh
./build-zg.sh
chmod -R 777 build/

4
mk/linux/zetaglest.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
export DBUS_FATAL_WARNINGS=0
unset XMODIFIERS
./build/zetaglest

View File

@@ -1 +1 @@
DataPath=./zetaglest-data/
DataPath=/usr/share/zetaglest/