Skip to content

Commit

Permalink
Merge pull request #4 from CleverRaven/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
eilaattwood authored May 29, 2019
2 parents 3363450 + b7ef939 commit c33633c
Show file tree
Hide file tree
Showing 894 changed files with 100,201 additions and 65,930 deletions.
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Checks: 'clang-diagnostic-*,-clang-analyzer-security.FloatLoopCounter,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-core.uninitialized.Assign,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.CallAndMessage,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.NullDereference'
Checks: 'clang-diagnostic-*,modernize-use-using'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
HeaderFilterRegex: '(src|test).*'
FormatStyle: none

# vim:tw=0
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,8 @@ Xcode/

# gdb
.gdb_history

# Flatpak build artifacts
/.flatpak-builder/
/repo/
/build-dir/
154 changes: 89 additions & 65 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,127 +32,142 @@ branches:
- master
- development

# Overall strategy for what sorts of builds to include:
# We want a build for each compiler and each platform.
# For PRs, we lessen the "each compiler" requirement to just covering the newest
# and oldest relevant version of each compiler.
# We also want to ensure that each of the following tweaks are covered in at
# least one PR build:
# - TILES=1
# - SOUND=1
# - RELEASE=1
# - CMAKE=1
# - SANITIZE=address
# - LOCALIZE=0
# - A clang-tidy run
# We try to minimize the number of builds subject to those constraints.

# To see what toolchains are available, consult the following:
# https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
# https://launchpad.net/%7Eubuntu-toolchain-r/+archive/ubuntu/test/+index

jobs:
include:
# Initial test stage, if this fails everything else is cancelled.
- stage: test
# GCC 5.4 is the pre-installed compiler on Xenial
env: COMPILER=g++ MODS=--mods=RL_Classes TEST_STAGE=1
- stage: Test
# Clang is consistently the fastest to build, so use it for the initial test.
env: CLANG=clang++-3.8 MODS=--mods=RL_Classes TEST_STAGE=1 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
name: "Clang 3.8 Make build with curses, style check and RL_Classes test"
compiler: clang
addons: &clang38
apt:
packages: ["clang-3.8", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: *apt_sources

# Then build different configurations and targets in parallel.
- stage: variants
# Linux Tiles
env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough' TILES=1 SOUND=1 SANITIZE=address
- stage: "Main Compilers"
env: COMPILER=g++ LOCALIZE=0
name: "GCC 5.3 Make build with curses and no Localization"
compiler: gcc
addons: &gcc53
apt:
packages: ["g++-5=5.3.1-14ubuntu2", "libstdc++-5-dev=5.3.1-14ubuntu2", "gcc-5=5.3.1-14ubuntu2", "gcc-5-base=5.3.1-14ubuntu2", "cpp-5=5.3.1-14ubuntu2", "libgcc-5-dev=5.3.1-14ubuntu2", "libasan2=5.3.1-14ubuntu2", "libmpx0=5.3.1-14ubuntu2"]
sources: [*apt_sources]

- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough' TILES=1 SOUND=1 SANITIZE=address
name: "GCC 8 Make build with Tiles, Sound and address sanitization"
compiler: gcc
addons: &gcc8
apt:
packages: ["g++-8", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: *apt_sources

# MXE variants using alternate repository http://mirror.mxe.cc/repos/apt
# GCC MinGW
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine'
addons: &gcc
- env: CLANG=clang++-8 SANITIZE=address EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency ~vehicle_drag ~starting_items"
name: "Clang 8 Make build with address sanitization, but long-running tests disabled"
compiler: clang
addons: &clang8
apt:
packages: ["wine"]
packages: ["clang-8", "libc6-dbg", "libc6-dbg:i386"]
sources: [*apt_sources, llvm-toolchain-xenial-8]

# Windows Tiles
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine' TILES=1 SOUND=1
- stage: "Platforms and Tidy"
# MXE variant using alternate repository http://mirror.mxe.cc/repos/apt
env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine' TILES=1 SOUND=1
name: "Mingw-w64 Make cross-compile to Windows with Tiles and Sound"
compiler: gcc
addons: &gcc
apt:
packages: ["wine"]

# CMake Clang 6.0 Tiles with CMAKE
- env: CLANG=clang++-6.0 TILES=1 SOUND=1 CXXFLAGS=-Wno-error=unused-command-line-argument CMAKE=1 RELEASE=1
dist: trusty
compiler: clang
addons: &clang60
apt:
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-trusty-6.0]

# macOS Tiles
- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1
name: "Xcode 10.1 Make build with Tiles and sound (macOS)"
os: osx
osx_image: xcode10.1
compiler: clang

# Finally check the compiler variants
- stage: compilers

# CMake Clang 8.0 Tiles with CMAKE and clang-tidy
# (analysis only; no build or tests)
env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=1
dist: trusty
- env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=clang-tidy-8
name: "Clang-tidy CMake build with Tiles and Sound"
compiler: clang
addons: &clang80
addons: &clang8
apt:
packages: ["clang-8", "libc6-dbg", "libc6-dbg:i386", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-trusty-8]
packages: ["clang-8", "clang-tidy-8", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-xenial-8]

- env: COMPILER=g++
compiler: gcc
addons: &gcc53
apt:
packages: ["g++-5=5.3.1-14ubuntu2", "libstdc++-5-dev=5.3.1-14ubuntu2", "gcc-5=5.3.1-14ubuntu2", "gcc-5-base=5.3.1-14ubuntu2", "cpp-5=5.3.1-14ubuntu2", "libgcc-5-dev=5.3.1-14ubuntu2", "libasan2=5.3.1-14ubuntu2", "libmpx0=5.3.1-14ubuntu2"]
sources: [*apt_sources]
# Finally check the compiler variants
- stage: compilers
# GCC 5.4 is default on Xenial
env: COMPILER=g++
name: "GCC 5.4 Make build with Curses"
if: type != pull_request

# GCC 6
- env: COMPILER=g++-6
name: "GCC 6 Make build with Curses"
if: type != pull_request
compiler: gcc
addons: &gcc6
apt:
packages: ["g++-6", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
sources: *apt_sources

# GCC 7
- env: COMPILER=g++-7 CXXFLAGS='-Wno-implicit-fallthrough' CODE_COVERAGE=true
- env: COMPILER=g++-7 CXXFLAGS='-Wno-implicit-fallthrough -D_GLIBCXX_DEBUG' CODE_COVERAGE=true
name: "GCC 7 Make build with Curses, GLIBCXX_DEBUG and code coverage"
if: type != pull_request
compiler: gcc
dist: trusty
addons: &gcc7
apt:
packages: ["g++-7", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386", "lcov"]
sources: *apt_sources

# GCC 8
- env: COMPILER=g++-8 CXXFLAGS='-Wno-implicit-fallthrough'
compiler: gcc
addons: &gcc8
apt:
packages: ["g++-8", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386"]
sources: *apt_sources

# Clang 3.8
- env: CLANG=clang++-3.8 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
compiler: clang
addons: &clang38
- env: COMPILER='g++' LDFLAGS='-static-libgcc -static-libstdc++' MXE_TARGET='i686-w64-mingw32.static' WINE='wine'
name: "Mingw-w64 Make build with Curses"
if: type != pull_request
addons: &gcc
apt:
packages: ["clang-3.8", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: *apt_sources
packages: ["wine"]

# Clang 3.9
- env: CLANG=clang++-3.9 CXXFLAGS='-Wno-error=unused-command-line-argument -D__extern_always_inline="extern __always_inline"'
name: "Clang 3.9 Make build with Curses"
if: type != pull_request
compiler: clang
addons: &clang39
apt:
packages: ["clang-3.9", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: *apt_sources

# Clang 4.0
- env: CLANG=clang++-4.0 CXXFLAGS=-Wno-error=unused-command-line-argument
name: "Clang 4 Make build with Curses"
if: type != pull_request
compiler: clang
addons: &clang40
apt:
packages: ["clang-4.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
# Luckily the Trusty install Just Works on Xenial
sources: [*apt_sources, llvm-toolchain-trusty-4.0]

# Clang 5.0
# Clang 5.0 (still on Trusty, because I could find no readily available
# source on Xenial at time of writing)
- env: CLANG=clang++-5.0 CXXFLAGS=-Wno-error=unused-command-line-argument
name: "Clang 5 Make build with Curses"
if: type != pull_request
dist: trusty
compiler: clang
Expand All @@ -161,14 +176,23 @@ jobs:
packages: ["clang-5.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: [*apt_sources, llvm-toolchain-trusty-5.0]

# Clang 6.0
- env: CLANG=clang++-6.0 CXXFLAGS=-Wno-error=unused-command-line-argument SANITIZE=address EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency ~vehicle_drag ~starting_items"
dist: trusty
- env: CLANG=clang++-6.0 TILES=1 SOUND=1 CXXFLAGS=-Wno-error=unused-command-line-argument CMAKE=1 RELEASE=1
name: "Clang 6 CMake build with tiles and sound"
if: type != pull_request
compiler: clang
addons: &clang60
apt:
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: [*apt_sources, llvm-toolchain-trusty-6.0]
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
sources: [*apt_sources, llvm-toolchain-xenial-6.0]

- env: CLANG=clang++-7
name: "Clang 7 Make build with Curses"
if: type != pull_request
compiler: clang
addons: &clang7
apt:
packages: ["clang-7", "libc6-dbg", "libc6-dbg:i386"]
sources: [*apt_sources, llvm-toolchain-xenial-7]

before_script:
- if [ -n "${CLANG}" ]; then COMPILER="$CLANG"; fi
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ IF(MSVC)
add_definitions(-D_X86_)
endif()
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wall -std=c++14")
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g -D_GLIBCXX_DEBUG")
SET(CATA_WARNINGS
"-Werror -Wall -Wextra -Woverloaded-virtual -Wpedantic -Wmissing-declarations")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS} -std=c++14")
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
ENDIF()

# Force out-of-source build
Expand Down
71 changes: 71 additions & 0 deletions COMPILING-CYGWIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Compilation guide for 64 bit Windows (using CYGWIN)

This guide contains steps required to allow compilation of Cataclysm-DDA on Windows under CYGWIN.

Steps from current guide were tested on Windows 10 (64 bit) and CYGWIN (64 bit), but should work for other versions of Windows and also CYGWIN (32 bit) if you download 32 bit version of all files.

## Prerequisites:

* Computer with 64 bit version of modern Windows operating system installed (Windows 10, Windows 8.1 or Windows 7);
* NTFS partition with ~10 Gb free space (~2 Gb for CYGWIN installation, ~3 Gb for repository and ~5 Gb for ccache);
* 64 bit version of CYGWIN (installer can be downloaded from [CYGWIN homepage](https://cygwin.com/));

## Installation:

1. Go to [CYGWIN homepage](https://cygwin.com/) and download 64 bit installer (e.g. [setup-x86_64.exe](https://cygwin.com/setup-x86_64.exe).

2. Run downloaded file and install CYGWIN (click `Next` button, select instalation source (e.g. `Install from Internet`), click `Next` button, specify directory where CYGWIN 64 bit will be installed (e.g. `C:\cygwin64`), select whether to install for all users or just you, click `Next` button again, select local package directory (e.g. `C:\Distr\Cygwin`), click `Next` button, select Internet connection settings, click `Next` button again, choose a download site from the list of available download sites, click `Next` button again).

3. After CYGWIN installation is complete select following packages and press `Next` button to download and install them:

* `wget`.

4. System will tell you it will install following packages (you will install everything else later):

```
...
```

5. Check boxes to add shortcuts to Start Menu and/or Desktop, then press `Finish` button.

## Configuration:

1. Install `apt-cyg` for easier package installation with:

```bash
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg -O /bin/apt-cyg
chmod 755 /bin/apt-cyg
```

2. Install packages required for compilation with:

```bash
apt-cyg install git make astyle gcc-g++ libintl-devel libiconv-devel libSDL2_image-devel libSDL2_ttf-devel libSDL2_mixer-devel libncurses-devel xinit
```

## Cloning and compilation:

1. Clone Cataclysm-DDA repository with following command line:

**Note:** This will download whole CDDA repository. If you're just testing you should probably add `--depth=1`.

```bash
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
cd Cataclysm-DDA
```

2. Compile with following command line:

```bash
make CCACHE=1 RELEASE=1 CYGWIN=1 DYNAMIC_LINKING=1 SDL=1 TILES=1 SOUND=1 LOCALIZE=1 LANGUAGES=all LINTJSON=0 ASTYLE=0 RUNTESTS=0
```

**Note**: This will compile release version with Sound and Tiles support and all localization languages, skipping checks and tests and using ccache for faster build. You can use other switches, but `CYGWIN=1`, `DYNAMIC_LINKING=1` and probably `RELEASE=1` are required to compile without issues.

## Running:

1. Run from within CYGWIN XWin Server (found in Start Menu) with following command line:

```bash
./cataclysm-tiles
```
34 changes: 34 additions & 0 deletions COMPILING-FLATPAK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Compiling Guide for Linux (Flatpak)

## Prerequisites

- Install `flatpak` and `flatpak-builder` from your distribution's package manager.
- Install `freedesktop-platform` & `freedesktop-sdk` using `flatpak install flathub org.freedesktop.Platform//18.08 org.freedesktop.Sdk//18.08`

## Build

Clone the source code and run `flatpak-builder --repo=repo --ccache --force-clean build-dir org.Cataclysm.DDA.json` or `flatpak-builder --repo=repo --ccache --force-clean build-dir org.Cataclysm.DDA.Tiles.json` to build the ncurses or tiles version of the application.

## Installation

Run `flatpak --user install test-repo org.Cataclysm.DDA` (or) `flatpak --user install test-repo org.Cataclysm.DDA.Tiles` to install the game.
Note: If you are installing the game for first time you will have to set up local repo. Run this `flatpak --user remote-add --no-gpg-verify test-repo repo`

## Starting the game

`flatpak run org.Cataclysm.DDA` (or) `flatpak run org.Cataclysm.DDA.Tiles`
**or**
Launch the Game from Applications -> Games -> Cataclysm: Dark Days Ahead (or) Cataclysm: Dark Days Ahead - Tiles.
**Note**: For the ncurses version, terminal will just show a blank screen on launch. Just press any button to start the game.

## Permissions

- **Ncurses version**
- Home Directory
- **Tiles Version**
- Home Directory
- Wayland
- Fallback-X11 - (incase Wayland doesn't work)
- IPC - (Required for X11)
- PulseAudio
- DRI
2 changes: 1 addition & 1 deletion COMPILING-MSYS.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ make CCACHE=1 RELEASE=1 MSYS2=1 DYNAMIC_LINKING=1 SDL=1 TILES=1 SOUND=1 LOCALIZE
./cataclysm-tiles
```

**Note:** If you want to run compiled executable from Explorer you will also need to update user or system`PATH` variable with path to MSYS2 runtime binaries (e.g. `C:\msys64\mingw64\bin`).
**Note:** If you want to run compiled executable from Explorer you will also need to update user or system `PATH` variable with path to MSYS2 runtime binaries (e.g. `C:\msys64\mingw64\bin`).
Loading

0 comments on commit c33633c

Please sign in to comment.