Skip to content

Commit

Permalink
Merge pull request #9 from CleverRaven/master
Browse files Browse the repository at this point in the history
patch
  • Loading branch information
BorkBorkGoesTheCode authored Sep 21, 2016
2 parents 4b0db6e + db3a5ce commit a5d8b37
Show file tree
Hide file tree
Showing 751 changed files with 156,499 additions and 155,370 deletions.
26 changes: 22 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tests/cata_test
cataclysm
cataclysm-tiles
chkjson*
Expand Down Expand Up @@ -26,6 +25,8 @@ WinDepend/
*.zip
build/
dep/
*.o
*.d

data/font/
config/
Expand Down Expand Up @@ -95,10 +96,13 @@ Cataclysm.dmg
# Jetbrains CLion
.idea/

# linked test executable
# test executables and generated data
tests/cata_test
tests/line_test
tests/map_iterator_test
tests/shadowcasting_test
tests/data/jsionized_overmap.sav

# static library used to link the test executable
cataclysm.a

Expand All @@ -109,6 +113,20 @@ cataclysm.a
*.sublime-workspace

# Visual Studio 2015
msvc140/*db
msvc140/ipch
msvc-full-features/*db
msvc-full-features/ipch
lnk*.tmp
Cataclysm.exe.lastcodeanalysissucceeded

# cppcheck
*cppcheck.xml
*.cppcheck

# IDA database
Cataclysm.i64
Cataclysm.id*
Cataclysm.til
Cataclysm.nam

# Distribution script results
msvc-full-features/distribution
34 changes: 22 additions & 12 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Given you're building from source you have a number of choices to make:
* `LOCALIZE=0` - this disables localizations so `gettext` is not needed
* `LUA=1` - this enables Lua support; needed only for full-fledged mods
* `CLANG=1` - use Clang instead of GCC
* `CACHE=1` - use ccache
* `CCACHE=1` - use ccache
* `USE_LIBCXX=1` - use libc++ instead of libstdc++ with Clang (default on OS X)

There is a couple of other possible options - feel free to read the `Makefile`.
Expand Down Expand Up @@ -369,34 +369,40 @@ Open Terminal's preferences, turn on "Use bright colors for bold text" in "Prefe

## Visual Studio Guide

MSVC 13 and earlier versions are likely unable to build Cataclysm, so we recommend you to use Visual Studio 2015. Project files are in `msvc140/` directory.
Visual Studio 2015 is required to build Cataclysm. We created solution and project files in directory `msvc-full-features`. Because of the complexity and how troublesome defining every combination of build feature options are, in Visual Studio project we added all build features, including tiles, sound, localization and lua.

### Dependencies

For tiles support, the following 3 libraries need to be downloaded and installed:
#### SDL

The following 4 libraries are required.

[http://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip](http://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip)

[http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip](http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip)

[http://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.1-VC.zip](http://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.1-VC.zip)

For localization support, pre-built binaries of `libintl` and `libiconv` can be obtained from GNOME FTP.
[http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-VC.zip](http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-VC.zip)

### Configuration
#### libintl and libiconv

If your machine doesn't support SSE2 instruction set, edit file `msvc140/common.props`, change
There is a repo providing MSVC project files to build those two libraries.

```
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
```
[https://github.com/kahrl/gettext-msvc](https://github.com/kahrl/gettext-msvc)

#### Lua

to
Download and extract lua source code. The source of lua can be obtained from [https://www.lua.org/download.html](https://www.lua.org/download.html). Open a Visual Studio Command Prompt, switch to `src` directory in lua source code and excute the following commands:

```
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
cl /MD /O2 /c *.c
del lua.obj luac.obj
lib -out:Lua.lib *.obj
```

Then, we get the static library `Lua.lib`.

### Building

Building Cataclysm with Visual Studio is very simple. Just build it like a normal Visual C++ project. The process may takes a long period of time, so you'd better prepare a cup of coffee and some books in front of your computer :)
Expand All @@ -405,7 +411,11 @@ If you need localization support, execute the bash script `lang/compile_mo.sh` i

### Debugging

After building Cataclysm, you may discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1. That is because of the wrong working directory. You need to configure the working directory to `$(ProjectDir)..`. It should be the root directory of Cataclysm, not `$(ProjectDir)`( = `msvc140/`).
After building Cataclysm, you may discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1. That is because of the wrong working directory. You need to configure the working directory to `$(ProjectDir)..`.

### Make a distribution

There is a batch script in `msvc-full-features` folder `distribute.bat`. It will create a sub folder `distribution` and copy all required files(eg. `data/`, `Cataclysm.exe` and dlls) into that folder. Then you can zip it and share the archive on the Internet.

## MinGW Guide
To compile under windows MinGW you first need to download mingw. An automated GUI installer assistant called mingw-get-setup.exe will make everything a lot easier. I recommend installing it to `C:\MinGW`
Expand Down
Loading

0 comments on commit a5d8b37

Please sign in to comment.