Skip to content

Commit

Permalink
Finish v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hsandt committed Jul 15, 2020
2 parents c100177 + 57bcbb6 commit 4fdcbb7
Show file tree
Hide file tree
Showing 10 changed files with 481 additions and 76 deletions.
105 changes: 79 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Reference:
# https://github.com/Microsoft/GSL/blob/master/.travis.yml

if: NOT branch = feature/appveyor
# Do not trigger Travis if any of these are true:
# - we are working on the appveyor branch (mostly modifying appveyor.yml only)
# - the commit message contains "(WIP)" or "#no_travis" (case-insensitive)
if: NOT branch = feature/appveyor AND commit_message !~ /(\(WIP\)|#no_travis)/

language: cpp

Expand All @@ -10,18 +13,14 @@ dist: bionic

env:
global:
- PREMAKE_VERSION="5.0.0-alpha15"
linux:
- JOBS="$(nproc)" # should be ~2
osx:
- JOBS="$(sysctl -n hw.ncpu)" # should be 2
PREMAKE_VERSION="5.0.0-alpha15"

addons:
apt:
packages: &linux_packages
libxrandr-dev
libudev-dev
libgl-dev
libgl1-mesa-dev
libflac-dev
libogg-dev
libvorbis-dev
Expand All @@ -31,40 +30,54 @@ addons:

jobs:
include:
# For OSX, use 10.15.4 with Xcode 11.6 to have clang++-11 and premake5 for correct architecture
- os: osx
# For OSX, use 10.15.4 with Xcode 11.6 to have clang++-10 and premake5 for correct architecture
osx_image: xcode11.6
env: COMPILER=clang++ # osx simply names "clang" the latest clang installed with Xcode toolchain
env:
- COMPILER=clang++ # osx simply names "clang++" the latest clang installed with Xcode toolchain
- PREMAKE_GENERATOR=gmake
# There are two OSX builds deployed, here is the gmake build
- DEPLOY=true
- DEPLOY_FILE=build/macosx_gmake_Release/bin/Game_OSX.zip
compiler: clang++
- os: osx
osx_image: xcode11.6
env:
- COMPILER=clang++
- PREMAKE_GENERATOR=xcode4
# There are two OSX builds deployed, here is the Xcode build
- DEPLOY=true
- DEPLOY_FILE=build/macosx_xcode4_Release/bin/Game.app.zip
compiler: clang++
- os: linux
env: COMPILER=g++-10
env:
- COMPILER=g++-10
- PREMAKE_GENERATOR=gmake
# make with g++ build will represent Linux to deploy release
- DEPLOY=true
- DEPLOY_FILE=build/linux_gmake_Release/bin/Game_Linux.zip
addons:
apt:
packages:
- *linux_packages
- g++-10
- lcov
sources:
- ubuntu-toolchain-r-test
- os: linux
env: COMPILER=clang++-10
# On Linux we stick to 10 which is LLVM's latest stable
env:
- COMPILER=clang++-10
- PREMAKE_GENERATOR=gmake
- DEPLOY=false
addons:
apt:
packages:
- *linux_packages
- clang-10
- lcov
sources:
- llvm-toolchain-bionic-10
compiler: clang++

before_install:
# install lcov for OSX
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install lcov
fi
install:
# Set the ${CXX} variable properly (don't do it in env, it is too early and would be overriden
# by travis compiler settings just afterward)
Expand All @@ -80,6 +93,7 @@ install:
# Download premake binary for current platform if not already done via cache (also check version just in case)
- |
if [[ ! -d "premake-${PREMAKE_VERSION}" || ! -x "premake-${PREMAKE_VERSION}/premake5" || "$(premake5 --version)" != *"${PREMAKE_VERSION}" ]]; then
rm -rf "premake-${PREMAKE_VERSION}"
mkdir -p "premake-${PREMAKE_VERSION}"
pushd "premake-${PREMAKE_VERSION}"
Expand All @@ -89,7 +103,6 @@ install:
PREMAKE_BINARY_OS_NAME="linux"
fi
wget "https://github.com/premake/premake-core/releases/download/v${PREMAKE_VERSION}/premake-${PREMAKE_VERSION}-${PREMAKE_BINARY_OS_NAME}.tar.gz"
rm -rf "premake-${PREMAKE_VERSION}"
tar -xvzf "premake-${PREMAKE_VERSION}-${PREMAKE_BINARY_OS_NAME}.tar.gz"
popd
Expand Down Expand Up @@ -130,13 +143,53 @@ before_script:
# Build dependencies
- engine/third-party/build_sfml.py
# Premake
- premake5 gmake
- premake5 "${PREMAKE_GENERATOR}"

script:
# Make (build dir must have been created by premake5)
- pushd build
# Manual debug to understand how each platform generates Makefile for premake
- echo "build/Game.make content:"
- cat build/Game.make
- config=release make -j${JOBS}
- |
if [[ "${PREMAKE_GENERATOR}" == "gmake"* ]]; then
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
export JOBS="$(sysctl -n hw.ncpu)" # should be 2
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
export JOBS="$(nproc)" # should be ~2
fi
config=release make -j${JOBS}
elif [[ "${PREMAKE_GENERATOR}" == "xcode"* ]]; then
xcodebuild -project Game.xcodeproj -target Game -configuration Release
fi
- popd

before_deploy:
# Linux/OSX gmake doesn't need to be archived to be deployed,
# but it allows us to preserve execution permissions.
# OSX .app folder needs archiving for deployment of a single file
# We pushd to avoid archiving the whole folder hierarchy into the zip
- |
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
pushd build/linux_${PREMAKE_GENERATOR}_Release/bin
zip -r Game_Linux.zip Game_Linux
popd
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
if [[ $PREMAKE_GENERATOR == "gmake"* ]]; then
pushd build/macosx_${PREMAKE_GENERATOR}_Release/bin
zip -r Game_OSX.zip Game_OSX
popd
else
pushd build/macosx_${PREMAKE_GENERATOR}_Release/bin
zip -r Game.app.zip Game.app
popd
fi
fi
deploy:
- provider: releases
api_key:
secure: IhrVPJTMBqjDyaM2384WfLGlctyQKPWPLABaVWtLef9hEsGr2U1zSzvdTpChFfgFT8Rc6BZSyFeQTVUoNGMAx3Sb3ei44VBL7b3L4xPuRglnjesmgd0CwMmQjYYLn1eL8D599cxkobhkwMxgl4ynDXS/1e07g0HwDdw5e/MVguotnLvsu0PXmHJEJ6Vt7lgkCQb4qK207D2RDfxWHZYry9uLsC+RWG3c0rrEF+oYnUfrb7248OPGzOBQCzZtNcOzxP2YWw+Em2/cn2HbOjiYClM7gjZnVgisE+x4Xel7OPNKur2LtYEuoEMrvGd7r3m4xMmiNLWOb3XWzAQncqUiK1nLBoAdA9MQm7lIS8I+mpV0i9wvsWLmFM98gAKjY/bv5tcpjPC4iRlbWZCMm50+Oxpg4Jwkw60Te0teG2tSCdWEbqVYku6PIv699f6EfpADA4vyteC832sIirIJ/Q+XawnSJpHII/OcGgOzPujk/IzGLk8IZyM3z6ZVaXB0NSmdYKP7AdylsS3GKxIFCL+hf9hRQniXDgmZyf2ehGt1kdLuWayPjkmaWpu5rnen1JJARLAx8n2ozhMHQt32SrPOpDBxX4z05g1UR/rgbtN9ij65puHOcwXO0mOLwRlC5mb+/1PBYKfcC+9O2Gw6IrMlx4wbwah3cEBHVs7Vp3f8mVQ=
file: ${DEPLOY_FILE}
# ignore travis lint warning, the new `cleanup` is not working yet
skip_cleanup: true
on:
condition: $DEPLOY = true
tags: true
17 changes: 10 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
"version": "0.2.0",
"configurations": [
{
"name": "gdb - Build and debug active file",
"name": "gdb - Build and debug project",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/Debug/Game",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"environment": [{
"name": "LD_LIBRARY_PATH",
"value": "engine/third-party/build/SFML/lib:${env:LD_LIBRARY_PATH}"
}
],
}],
"linux": {
"program": "${workspaceFolder}/build/linux_Debug/bin/Game_Linux",
},
"osx": {
"program": "${workspaceFolder}/build/osx_Debug/bin/Game_OSX",
},
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
Expand All @@ -27,7 +30,7 @@
"ignoreFailures": true
}
],
"preLaunchTask": "make",
"preLaunchTask": "quick make (g++, debug)",
"miDebuggerPath": "/usr/bin/gdb"
}
]
Expand Down
57 changes: 56 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
{
"python.pythonPath": "/usr/bin/python3"
"python.pythonPath": "/usr/bin/python3",
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"iomanip": "cpp"
}
}
Loading

0 comments on commit 4fdcbb7

Please sign in to comment.