Compare commits

..

12 Commits

Author SHA1 Message Date
ZhilkinSerg e184c6a74e Disallow SDL orientation changes 2020-05-20 15:16:59 +03:00
ZhilkinSerg 1a0a534d80 Update Android precompiled dependencies (2020-04-18) 2020-05-20 15:16:05 +03:00
Qrox a07ce29fc6 Fix crash when NPC gives player equipment 2020-04-12 00:08:11 -05:00
tenmillimaster 0f1f2f2921 bp migrations & recipes 2020-04-12 00:08:11 -05:00
Tiefoone 707191c2e4 Floating point error correction. (#39230) 2020-04-12 00:08:11 -05:00
Tiefoone fc47a700b0 Prevent nearby NPC-owned items showing up in trades unless they are a shopkeeper. 2020-04-12 00:08:11 -05:00
Kevin Granade 8eafa19a41 Bypass downing immunity when knocked down due to instability. 2020-04-12 00:08:11 -05:00
ZhilkinSerg 5df5337af3 Add savegame migration for rural house 2020-04-12 00:08:11 -05:00
Tiefoone 49016c0de7 Include aluminum in TV materials to prevent cutting into plastic chunks. 2020-04-12 00:08:11 -05:00
ZhilkinSerg 3244627ef2 Misc small fixes for Android builds (2020-04-02) (#39168)
* Only build experimental flavor on Travis

* Guard unused function in Android builds

* Ignore pragmas unknown to Android compiler
2020-04-12 00:08:11 -05:00
KurzedMetal 54fe9cab04 Fix wield action costing double than it should 2020-04-12 00:08:11 -05:00
saurocyte 958d22b091 Fix negative explosion damage 2020-04-12 00:08:11 -05:00
8992 changed files with 5995985 additions and 14247791 deletions
+26
View File
@@ -0,0 +1,26 @@
version: '{branch}.{build}'
os: Windows
clone_folder: C:\Projects\Cataclysm-DDA
shallow_clone: true
pull_requests:
do_not_increment_build_number: false
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PROJECT: /msvc-full-features/Cataclysm-vcpkg-static.sln
COMPILER: msvc2017
TOOLCHAIN: msvc15
PLATFORM: x64
CONFIGURATION: Release
APPVEYOR_SAVE_CACHE_ON_ERROR: true
matrix:
fast_finish: false
cache:
- 'c:\tools\vcpkg\installed'
install:
# Install dependency packages
- cmd: vcpkg --triplet %PLATFORM%-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
build:
parallel: true
project: /msvc-full-features/Cataclysm-vcpkg-static.sln
verbosity: minimal
-5
View File
@@ -49,8 +49,3 @@
# insert space padding around parentheses on the inside only
--pad-paren-in
# exclude src/third-party
--exclude=src/third-party
# but don't be sad about no tests/src/third-party
--ignore-exclude-errors-x
+28 -38
View File
@@ -4,30 +4,6 @@
# this codebase and we do not intend to fix. The disabled checks appearing
# thereafter in a separate alphabetical list have yet to be triaged. We may
# fix their errors or recategorise them as checks we don't care about.
#
# Comments on the checks we have decided are not worthwhile:
#
# * cert-dcl21-cpp (postfix operator++ and operator-- should return const objects)
# This is an unconventional code style, and conflicts with
# readability-const-return-type.
#
# * cert-env33-c (calls to system, popen)
# Unlikely to catch bugs, and using system is convenient for portability.
#
# * cert-err58-cpp (exceptions from static variable declarations)
# We have lots of memory allocations in static variable declarations, and
# that's fine.
#
# * modernize-use-auto
# We prefer an almost-always-avoid-auto style.
#
# * modernize-use-trailing-return-type
# An arbitrary style convention we haven't adopted.
#
# * readability-braces-around-statements
# Covered by astyle and buggy in clang-tidy 8. Can enable once we have a newer
# clang-tidy.
Checks: "\
bugprone-*,\
cata-*,\
@@ -37,7 +13,6 @@ cert-*,\
-cert-err58-cpp,\
clang-diagnostic-*,\
cppcoreguidelines-slicing,\
google-explicit-constructor,\
llvm-namespace-comment,\
misc-*,\
modernize-*,\
@@ -45,33 +20,48 @@ modernize-*,\
-modernize-use-trailing-return-type,\
performance-*,\
readability-*,\
-readability-braces-around-statements,\
-bugprone-misplaced-widening-cast,\
-bugprone-narrowing-conversions,\
-misc-no-recursion,\
-bugprone-unused-return-value,\
-cert-err34-c,\
-cert-flp30-c,\
-cert-msc30-c,\
-cert-msc32-c,\
-cert-msc50-cpp,\
-cert-msc51-cpp,\
-misc-non-private-member-variables-in-classes,\
-modernize-avoid-c-arrays,\
-modernize-pass-by-value,\
-modernize-return-braced-init-list,\
-modernize-use-default-member-init,\
-modernize-use-nodiscard,\
-readability-convert-member-functions-to-static,\
-modernize-use-emplace,\
-modernize-use-transparent-functors,\
-performance-for-range-copy,\
-performance-inefficient-vector-operation,\
-performance-noexcept-move-constructor,\
-performance-implicit-conversion-in-loop,\
-performance-inefficient-algorithm,\
-performance-inefficient-string-concatenation,\
-performance-type-promotion-in-math-fn,\
-performance-unnecessary-value-param,\
-readability-braces-around-statements,\
-readability-else-after-return,\
-readability-function-cognitive-complexity,\
-readability-function-size,\
-readability-implicit-bool-conversion,\
-readability-isolate-declaration,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-use-anyofallof,\
-readability-redundant-control-flow,\
-readability-redundant-declaration,\
-readability-redundant-preprocessor,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test|tools).*'
HeaderFilterRegex: '(src|test).*'
FormatStyle: none
CheckOptions:
- key: cata-large-inline-function.MaxStatements
value: 5
- key: cata-text-style.EscapeUnicode
value: 0
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: true
- key: readability-uppercase-literal-suffix.NewSuffixes
value: 'L;UL;LL;ULL'
- key: cata-text-style.EscapeUnicode
value: 0
# vim:tw=0
-43
View File
@@ -1,43 +0,0 @@
# options affecting formatting
format:
# how wide to allow formatted cmake files
line_width: 100
# how many spaces to tab for indent
tab_size: 4
# if true, separate flow control names from their parentheses
separate_ctrl_name_with_space: true # currently ignored by cmake-lint
# if true, separate function names from parentheses with a
separate_fn_name_with_space: false # currently ignored by cmake-lint
# if a statement is wrapped to more than one line, than dangle
# the closing parenthesis on its own line.
dangle_parens: false # currently ignored by cmake-lint
# Format command names consistently as 'lower' or 'upper' case
# 'canonical': like in official documentation
command_case: 'canonical' # currently ignored by cmake-lint
# Format keywords consistently as 'lower' or 'upper' case
keyword_case: 'upper' # currently ignored by cmake-lint
# options affecting comment reflow and formatting
markup:
# enable comment markup parsing and reflow
enable_markup: false
# options affecting linter
lint:
# list of lint codes to disable
# C0113: Missing COMMENT in statement which allows it
disabled_codes: ['C0113']
# regular expression pattern describing valid function names
function_pattern: '[a-z_]+'
# regular expression pattern describing valid names for private variables
# WEIRD: strangely named "directory variable name" in lint output
private_var_pattern: '_[0-9A-Z_]+'
# regular expression pattern describing valid names for public variables (strangely named "directories"?)
# WEIRD: strangely named "directory variable name" in lint output
public_var_pattern: '[0-9A-Z]+'
# regular expression pattern describing valid macro names
macro_pattern: '[a-z_]+'
# regular expression pattern describing valid names for function/macro
# arguments and loop variables
argument_var_pattern: '[A-Z][A-Z0-9_]+'
# require no more than this many newlines between statements
max_statement_spacing: 2
-1
View File
@@ -15,4 +15,3 @@ end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
-11
View File
@@ -1,11 +0,0 @@
[flake8]
exclude = .git,__pycache__,lang/json
ignore =
# E265 forces comments to have a space after the '#'. We have a bunch of
# optional debugging code commented out this way, and not having a space is
# a convenient way to distinguish it from proper comments. Maybe we should
# delete that code, but unless that happens leaving E265 disabled.
E265,
# W503 and W504 require line breaks after or before binary operators; you
# can only have one enabled
W504
+2 -2
View File
@@ -1,8 +1,8 @@
# Automatically normalize line endings for all files
# Automatically normalise line endings for all files
# detected as text (Convert CRLF => LF).
* text=auto
# Explicitly normalize files with these extensions in
# Explicitly normalise files with these extensions in
# case Git doesn't detect them as text for some reason.
*.c text
*.cbp text
+12 -15
View File
@@ -1,31 +1,28 @@
#Note that despite github calling these "owners", a better term would be "alerts"
#Everything in the cataclysm repository remains under a creative commons license, nobody owns the mods.
#In fact, the code "owners" designation is meant to encourage third party
#individuals to contribute to the mod, with the curators notified for reviews.
#individuals to contribute to the mod, with the maintainers notified for reviews.
/data/mods/Aftershock/ @Maleclypse @John-Candlebury @Mom-Bun
/data/mods/DinoMod/ @ephemeralstoryteller @damien @LyleSY
/data/mods/Aftershock/ @Malecypse @John-Candlebury
/data/mods/DinoMod/ @damien @ethankaminski @LyleSY
/data/mods/Graphical_Overmap/ @Kilvoctu @Larwck
/data/mods/MMA/ @Hymore246
/data/mods/No_Fungi/ @I-am-Erk
/data/mods/blazemod/ @SouP
/data/mods/classic_zombies/ @I-am-Erk
/data/mods/crt_expansion/ @Soupster89
/data/mods/desertpack/ @davidpwbrown
/data/mods/desertpack/ @davidpwbrown
/data/mods/generic_guns/ @tenmillimaster
/data/mods/Magiclysm/ @KorGgenT
/data/mods/My_Sweet_Cataclysm/ @Fris0uman
/data/mods/magiclysm/ @KorGgenT
/data/mods/my_sweet_cataclysm/ @Fris0uman
/data/mods/ruralbiome/ @I-am-Erk
/data/mods/speedydex/ @KorGgenT
/data/mods/stats_through_kills/ @KorGgenT
/data/mods/Xedra_Evolved/ @Maleclypse
/data/mods/Dark-Skies-Above/ @ephemeralstoryteller
/data/mods/No_Hope/ @Night-Pryanik
/data/mods/innawood/ @Light-Wave
/data/mods/MA/ @ZhilkinSerg
magic*.cpp @KorGgenT
magic*.h @KorGgenT
/tools/ @int-ua
/lang/ @BrettDong
widget.cpp @wapcaplet @dseguin
widget.h @wapcaplet @dseguin
/data/json/itemgroups/SUS/ @I-am-Erk
/data/json/npcs/refugee_center/ @I-am-Erk
/data/json/npcs/Backgrounds/ @I-am-Erk
/data/json/snippets/ @I-am-Erk
/gfx/ @I-am-Erk
+294
View File
@@ -0,0 +1,294 @@
# Contribute
**Opening new issue?** Please read [ISSUES.md](../ISSUES.md) first.
Contributing to Cataclysm: Dark Days Ahead is easy — simply fork the repository here on GitHub, make your changes, and then send us a pull request.
Cataclysm:Dark Days Ahead is released under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
This means any contribution you make to the project will also be covered by the same license, and this license is irrevocable.
## Guidelines
There are a couple of guidelines we suggest sticking to:
* Add this repository as an `upstream` remote.
* Keep your `master` branch clean. This means you can easily pull changes made to this repository into yours.
* Create a new branch for each new feature or set of related bug fixes.
* Never merge from your local branches into your `master` branch. Only update that by pulling from `upstream/master`.
## Code Style
Code style is enforced across the codebase by `astyle`.
See [CODE_STYLE](../doc/CODE_STYLE.md) for details.
## Translations
The translation of Cataclysm: DDA is done using Transifex.
Look at the [translation project](https://www.transifex.com/cataclysm-dda-translators/cataclysm-dda/) for an up-to-date list of supported languages.
See [TRANSLATING](../doc/TRANSLATING.md) for more information:
* [For translators](../doc/TRANSLATING.md#translators)
* [For developers](../doc/TRANSLATING.md#developers)
* [For maintainers](../doc/TRANSLATING.md#maintainers)
## Doxygen Comments
Extensive documentation of classes and class members will make the code more readable to new contributors. New doxygen comments for existing classes are a welcomed contribution.
Use the following template for commenting classes:
```c++
/**
* Brief description
*
* Lengthy description with many words. (optional)
*/
class foo {
```
Use the following template for commenting functions:
```c++
/**
* Brief description
*
* Lengthy description with many words. (optional)
* @param param1 Description of param1 (optional)
* @return Description of return (optional)
*/
int foo(int param1);
```
Use the following template for commenting member variables:
```c++
/** Brief description **/
int foo;
```
Helpful pages:
http://www.stack.nl/~dimitri/doxygen/manual/commands.html
http://www.stack.nl/~dimitri/doxygen/manual/markdown.html#markdown_std
http://www.stack.nl/~dimitri/doxygen/manual/faq.html
### Guidelines for adding documentation
* Doxygen comments should describe behavior towards the outside, not implementation, but since many classes in Cataclysm are intertwined, it's often necessary to describe implementation.
* Describe things that aren't obvious to newcomers just from the name.
* Don't describe redundantly: `/** Map **/; map* map;` is not a helpful comment.
* When documenting X, describe how X interacts with other components, not just what X itself does.
### Building the documentation for viewing it locally
* Install doxygen
* `doxygen doxygen_doc/doxygen_conf.txt `
* `firefox doxygen_doc/html/index.html` (replace firefox with your browser of choice)
## Example Workflow
#### Setup your environment
*(This only needs to be done once.)*
1. Fork this repository here on GitHub.
2. Clone your fork locally.
$ git clone https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
# Clones your fork of the repository into the current directory in terminal
3. Set commit message template.
$ git config --local commit.template .gitmessage
4. Add this repository as a remote.
$ cd Cataclysm-DDA
# Changes the active directory in the prompt to the newly cloned "Cataclysm-DDA" directory
$ git remote add -f upstream https://github.com/CleverRaven/Cataclysm-DDA.git
# Assigns the original repository to a remote called "upstream"
For further details about commit message guidelines please visit:
- [codeinthehole.com](https://codeinthehole.com/tips/a-useful-template-for-commit-messages/)
- [chris.beams.io](https://chris.beams.io/posts/git-commit/)
- [help.github.com](https://help.github.com/articles/closing-issues-using-keywords/)
#### Update your `master` branch
1. Make sure you have your `master` branch checked out.
$ git checkout master
2. Pull the changes from the `upstream/master` branch.
$ git pull --ff-only upstream master
# gets changes from "master" branch on the "upstream" remote
* Note: If this gives you an error, it means you have committed directly to your local `master` branch. [Click here for instructions on how to fix this issue](#why-does-git-pull---ff-only-result-in-an-error).
#### Make your changes
0. Update your `master` branch, if you haven't already.
1. For each new feature or bug fix, create a new branch.
$ git branch new_feature
# Creates a new branch called "new_feature"
$ git checkout new_feature
# Makes "new_feature" the active branch
2. Once you've committed some changes locally, you need to push them to your fork here on GitHub.
$ git push origin new_feature
# origin was automatically set to point to your fork when you cloned it
3. Once you're finished working on your branch, and have committed and pushed all your changes, submit a pull request from your `new_feature` branch to this repository's `master` branch.
* Note: any new commits to the `new_feature` branch on GitHub will automatically be included in the pull request, so make sure to only commit related changes to the same branch.
## Pull Request Notes
If you file a PR but you're still working on it, please add a [WIP] before the title text. This will tell the reviewers that you still intend to add more to the PR and we don't need to review it yet. When it's ready to be reviewed by a merger just edit the title text to remove the [WIP].
If you are also looking for suggestions then mark it with [CR] — "comments requested". You can use both [WIP] and [CR] to indicated that you need opinion/code review/suggestions to continue working (e.g. "[WIP] [CR] Super awesome big feature"). Feel free to remove [CR] when you feel you got enough information to proceed.
This can help speed up our review process by allowing us to only review the things that are ready for it, and will prevent anything that isn't completely ready from being merged in.
It is not required to solve or reference an open issue to file a PR, however, if you do so, you need to explain the problem your PR is solving in full detail.
### All PRs should have a "Summary" line
Summary is a one-line description of your change that will be extracted and added to the project changelog at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt
The format is: ```SUMMARY: Category "description"```
The categories to choose from are: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N.
Example: ```SUMMARY: Content "Adds new mutation category 'Mouse'"```
Or, if you want it treated as a minor tweak that doesn't appear in the changelog:
```SUMMARY: None```
See the Changelog Guidelines at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md for explanations of the categories.
### Closing issues using keywords
One more thing: when marking your PR as closing, fixing, or resolving issues, please include "XXXX #???" somewhere in the description, where XXX is on this list:
* close
* closes
* closed
* fix
* fixes
* fixed
* resolve
* resolves
* resolved
The "???" is the issue number. This automatically closes the issue when the PR is pulled in, and allows merges to work slightly faster. To close multiple issues format it as "XXXX #???, XXXX#???".
See https://help.github.com/articles/closing-issues-using-keywords/ for more.
## Tooling support
Various tools are available to help you keep your contributions conforming to the appropriate style. See [the relevant docs](../doc/DEVELOPER_TOOLING.md) for more details.
## Advanced Techniques
These guidelines aren't essential, but they can make keeping things in order much easier.
#### Using remote tracking branches
Remote tracking branches allow you to easily stay in touch with this repository's `master` branch, as they automatically know which remote branch to get changes from.
$ git branch -vv
* master xxxx [origin/master] ....
new_feature xxxx ....
Here you can see we have two branches; `master` which is tracking `origin/master`, and `new_feature` which isn't tracking any branch. In practice, what this means is that git won't know where to get changes from.
$ git checkout new_feature
Switched to branch 'new_feature'
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
In order to easily pull changes from `upstream/master` into the `new_feature` branch, we can tell git which branch it should track. (You can even do this for your local master branch.)
$ git branch -u upstream/master new_feature
Branch new_feature set up to track remote branch master from upstream.
$ git pull
Updating xxxx..xxxx
....
You can also set the tracking information at the same time as creating the branch.
$ git branch new_feature_2 --track upstream/master
Branch new_feature_2 set up to track remote branch master from upstream.
* Note: Although this makes it easier to pull from `upstream/master`, it doesn't change anything with regards to pushing. `git push` fails because you don't have permission to push to `upstream/master`.
$ git push
error: The requested URL returned error: 403 while accessing https://github.com/CleverRaven/Cataclysm-DDA.git
fatal: HTTP request failed
$ git push origin
....
To https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
xxxx..xxxx new_feature -> new_feature
## Unit tests
There is a suite of tests built into the source tree at tests/
You should run the test suite after ANY change to the game source.
An ordinary invocation of ``make`` will build the test executable at tests/cata_test, and it can be invoked like any ordinary executable, or via `make check`.
With no arguments it will run the entire test suite.
With ``--help`` it will print a number of invocation options you can use to adjust its operation.
$ make
... compilation details ...
$ tests/cata_test
Starting the actual test at Fri Nov 9 04:37:03 2018
===============================================================================
All tests passed (1324684 assertions in 94 test cases)
Ended test at Fri Nov 9 04:37:45 2018
The test took 41.772 seconds
I recommend habitually invoking make like ``make YOUR BUILD OPTIONS && make check``.
## In-game testing, test environment and the debug menu
Whether you are implementing a new feature or whether you are fixing a bug, it is always a good practice to test your changes in-game. It can be a hard task to create the exact conditions by playing a normal game to be able to test your changes, which is why there is a debug menu. There is no default key to bring up the menu so you will need to assign one first.
Bring up the keybindings menu (press `Escape` then `1`), scroll down almost to the bottom and press `+` to add a new key binding. Press the letter that corresponds to the *Debug menu* item, then press the key you want to use to bring up the debug menu. To test your changes, create a new world with a new character. Once you are in that world, press the key you just assigned for the debug menu and you should see something like this:
```
┌───────────────────────────────────────────────────────────────────────────┐
│ Debug Functions - Using these will cheat not only the game, but yourself. │
├───────────────────────────────────────────────────────────────────────────┤
│ i Info │
│ Q Quit to main menu │
│ s Spawning… │
│ p Player… │
│ t Teleport… │
│ m Map… │
└───────────────────────────────────────────────────────────────────────────┘
```
With these commands, you should be able to recreate the proper conditions to test your changes. You can find some more information about the debug menu on [the official wiki](http://cddawiki.chezzo.com/cdda_wiki/index.php).
## Frequently Asked Questions
#### Why does `git pull --ff-only` result in an error?
If `git pull --ff-only` shows an error, it means that you've committed directly to your local `master` branch. To fix this, we create a new branch with these commits, find the point at which we diverged from `upstream/master`, and then reset `master` to that point.
$ git pull --ff-only upstream master
From https://github.com/CleverRaven/Cataclysm-DDA
* branch master -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
$ git branch new_branch master # mark the current commit with a tmp branch
$ git merge-base master upstream/master
cc31d0... # the last commit before we committed directly to master
$ git reset --hard cc31d0....
HEAD is now at cc31d0... ...
Now that `master` has been cleaned up, we can easily pull from `upstream/master`, and then continue working on `new_branch`.
$ git pull --ff-only upstream master
# gets changes from the "upstream" remote for the matching branch, in this case "master"
$ git checkout new_branch
For more frequently asked questions, see the [developer FAQ](../doc/DEVELOPER_FAQ.md).
+13
View File
@@ -0,0 +1,13 @@
Game version:
Operating system:
Tiles or curses:
Mods active:
### Expected behavior
### Actual behavior
### Steps to reproduce the behavior
+59
View File
@@ -0,0 +1,59 @@
---
name: Bug report
about: Create a report to help us improve
---
<!-- Please follow the template below -->
# Describe the bug
<!-- A clear and concise description of what the bug is. -->
# Steps To Reproduce
<!-- Steps to reproduce the behavior:
1. Make a player with a gun, magazine, and some ammo.
2. Try to aim at a wall.
3. There's no way to increase aim level. -->
# Expected behavior
<!-- A clear and concise description of what you expected to happen.
Ideally also describe *why* you expect it to happen. -->
# Screenshots
<!-- **If applicable**, add screenshots to help explain your problem.
Do not take a screenshot of the crashing window. Please provide the crash logs in the "Additional context" -->
# Versions and configuration
<!-- Please complete the following information; you can now go to:
- "Main menu (ESC) > Debug Menu > Info > Generate game report" to generate this report.
- Please update your OS version with a more precise version.
- OS: [e.g. iOS 8 or Windows 10 or Ubuntu 18.04]
- Game Version: [from the main menu, e.g. 0.C-29938-g90f5268437]
- Graphics version: [Tiles or Terminal]
- Ingame language: [Arabic or Bulgarian or Chinese (Simplified) or Chinese (Traditional) or Dutch or Esperanto or French or German or Italian (Italy) or Japanese or Korean or Polish or Portuguese (Brazil) or Russian or Serbian or Spanish (Argentina) or Spanish (Spain) or Turkish]
- Mods loaded: [e.g.dda, boats, hacktheplanet, StatsThroughSkills]
-->
# Additional context
<!-- Add any other context about the problem here.
Crash: if your problem refers to a crash, please add the following files to the "Additional Context" paragraph:
- From the /config folder (you can zip them both together):
- crash.log file.
- debug.log file.
- Your save file (zipped)
- note #1: you can drag and drop files in this issue post!
- note #2: it is very important for us that you provide a save file in case of a crash. It really helps the developers
to reproduce the bug and fix it. If possible, try to provide a save file that occurs in the right conditions, just
before the crash happens. -->
-100
View File
@@ -1,100 +0,0 @@
name: Bug Report 🐛
description: Create a report to help us improve
labels: ["(S1 - Need confirmation)"]
body:
- type: markdown
attributes:
value: |
Please take the time to fill out all the fields below.
- type: textarea
id: description-of-bug
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: There is no way for aim level to increase.
validations:
required: true
- type: textarea
id: save-file
attributes:
label: Attach save file
description: |
`ESC`Main Menu -> `b`Debug Menu -> `i`Info -> `!`Generate minimized save archive
placeholder: |
Write N/A if not applicable.
- this bug report is unlikely to get resolved without a save file, unless it's trivially
reproducible or the reproduction steps are complete.
validations:
required: true
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Make a player with a gun, magazine, and some ammo.
2. Try to aim at a wall.
3. There's no way to increase aim level.
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: |
A clear and concise description of what you expected to happen.
Ideally also describe *why* you expect it to happen.
placeholder: I expected that aim level would increase, because all other skills can increase in level.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: |
**If applicable**, add screenshots to help explain your problem.
Do not take a screenshot of the crashing window. Please provide the crash logs in the "Additional context"
validations:
required: false
- type: textarea
id: versions-and-config
attributes:
label: Versions and configuration
description: |
`ESC`Main Menu -> `b`Debug Menu -> `i`Info -> `r`Generate game report
placeholder: |
- OS: [e.g. iOS 8 or Windows 10 or Ubuntu 18.04]
- Game Version: [e.g. 0.C-29938-g90f5268437]
- Graphics version: [Tiles or Terminal]
- Ingame language: [Arabic or Bulgarian or Chinese (Simplified) or Chinese (Traditional) or Dutch or Esperanto or French or German or Italian (Italy) or Japanese or Korean or Polish or Portuguese (Brazil) or Russian or Serbian or Spanish (Argentina) or Spanish (Spain) or Turkish]
- Mods loaded: [e.g. dda, boats, hacktheplanet, StatsThroughSkills]
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
placeholder: |
Crash: if your problem refers to a crash, please add the following files to the "Additional Context" paragraph:
- From the /config folder (you can zip them both together):
- crash.log file.
- debug.log file.
- Your save file (zipped)
- note #1: you can drag and drop files in this issue post!
- note #2: it is very important for us that you provide a save file in case of a crash. It really helps the developers
to reproduce the bug and fix it. If possible, try to provide a save file that occurs in the right conditions, just
before the crash happens.
validations:
required: false
-11
View File
@@ -1,11 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Tileset Issues
url: https://github.com/I-am-Erk/CDDA-Tilesets/issues
about: For issues concerning the built-in tilesets.
- name: Github Discussion
url: https://github.com/CleverRaven/Cataclysm-DDA/discussions
about: For nonspecific feature requests, balance concerns, and questions about the game, prefer opening a discussion to an issue.
- name: Project Forums
url: https://discourse.cataclysmdda.org/
about: For even more general discussion with the community, consider posting on the forums.
+17
View File
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
# Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
# Describe the solution you'd like
A clear and concise description of what you want to happen.
# Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
# Additional context
Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature request here.
@@ -1,45 +0,0 @@
name: Feature Request ✨
description: Suggest an idea for this project
labels: ["<Suggestion / Discussion>"]
body:
- type: markdown
attributes:
value: |
Please take the time to fill out all the fields below.
- type: textarea
id: description-of-bug
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is that made you submit this report.
placeholder: I am always frustrated, when...
validations:
required: true
- type: textarea
id: description-of-solution
attributes:
label: Solution you would like.
description: A clear and concise description of what you want to happen.
placeholder: Instead of behaving like this, there should be...
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you have considered.
description: A clear and concise description of any alternative solutions or features you have considered.
placeholder: Another workaround that would work, is...
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature request here.
validations:
required: false
-40
View File
@@ -1,40 +0,0 @@
# https://github.com/rytswd/comvent
trigger: specific
# list of users allowed to use these commands, from labeling an issue in
# a specific way to mark as duplicate, closing issues, the sky is the limit
# TODO implement more commands, add more users
users:
active:
- casswedson
- Maleclypse
- Termineitor244
- Faalagorn
- Ilysen
- Aerin-of-the-Toast
- anoobindisguise
- PatrikLundell
- TheShadowFerret
- Jan-Blasiak
- MNG-cataclysm
- mqrause
- andrei8l
- haveric
- MylieDaniels
- nopenoperson
- Inglonias
- GuardianDll
- hexagonrecursion
- ANickelN
- a-chancey
- Cimanyd0
- LyranRenegade
- Stadler76
- sonphantrung
- sadenar
- RenechCDDA
- irwiss
keywords:
- name: confirm-bug
value: '\/(C|c)onfirm.*'
-273
View File
@@ -1,273 +0,0 @@
"[C++]":
- "**/*.cpp"
- "**/*.h"
"[JSON]":
- "**/*.json"
"[Markdown]":
- "**/*.md"
"Game: Achievements / Conducts / Scores":
- "**/scores**"
- "**/**statistics**"
- "**/statistics**"
- "**/**achievement**"
- "**/achievement**"
- "**/**conducts**"
- "**/conducts**"
"[Python]":
- "**/*.py"
"<Documentation>":
- "**/*.md"
- "doc/**"
- "doxygen_doc/**"
"Code: Tooling":
- ".github/**"
- "utilities/**"
- any: ['tools/**', '!tools/spell_checker/dictionary.txt']
"Code: Tests":
- "tests/**"
- "data/mods/TEST_DATA/**"
"Character / World Generation":
- "**/newcharacter**"
- "**/worldfactory**"
"Code: Build":
- "build-data/**"
- "build-scripts/**"
- "**/Makefile"
- "**/CMakeLists.txt"
- "**/*.cmake"
"Code: Infrastructure / Style / Static Analysis":
- .astylerc
- .clang-tidy
- .editorconfig
- .lgtm.yml
"Crafting / Construction / Recipes":
- "**/**crafting**"
- "**/crafting**"
- "**/**recipe**"
- "**/recipe**"
- "**/**construction**"
- "**/construction**"
"EOC: Effects On Condition":
- "**/**effect_on_condition**"
- "**/effect_on_condition**"
- "**/**eocs**"
- "**/eocs**"
- "**/condition**"
"Fields / Furniture / Terrain / Traps":
- "**/**furniture**"
- "**/furniture**"
- "**/**field**"
- "**/field**"
- "**/**terrain**"
- "**/terrain**"
- "**/**trap**"
- "**/trap**"
"Items: Food / Vitamins":
- "**/**food**"
- "**/food**"
- "**/**comestible**"
- "**/comestible**"
"NPC / Factions":
- "**/**npc**"
- "**/npc**"
- "**/**NPC**"
- "**/NPC**"
"Melee":
- "**/**melee**"
- "**/melee**"
- "**/**techniques**"
- "**/techniques**"
"Missions":
- "**/**mission**"
- "**/mission**"
"Info / User Interface":
- "src/**ui**"
- "**/ui/**"
- "**/**widget**"
- "**/widget**"
- "**/**view**"
- "**/view**"
"Items: Archery":
- "**/archery**"
- "**/crossbow**"
"Items: Armor / Clothing":
- "**/**armor**"
- "**/armor**"
- "**/armor/**"
"Items: Battery / UPS":
- "**/**battery**"
- "**/battery**"
"Items: Containers":
- "**/container**"
- "**/**pocket**"
- "**/pocket**"
- "**/**contents**"
- "**/contents**"
"Items: Magazines":
- "**/**magazine**"
- "**/magazine**"
"Appliance/Power Grid":
- "**/**appliance**"
- "**/appliance**"
"Monsters":
- "**/**monsters**"
- "**/monsters**"
"Mutations / Traits / Professions/ Hobbies":
- "**/**profession**"
- "**/profession**"
- "**/**mutations**"
- "**/mutation**"
- "**/hobbies**"
"Lore":
- data/json/npcs/BG_trait_groups.json
- data/json/npcs/Personality_trait_groups.json
- data/json/npcs/personality_traits.json
- "**/**Backgrounds**"
- "**/Backgrounds**"
- "**/**snippets**"
- "**/snippets**"
"Limbs":
- "**/**bodypart**"
- "**/bodypart**"
- "data/json/limb_scores.json"
"Spawn":
- "**/**itemgroup**"
- "**/itemgroup**"
- "**/itemgroups/**"
- "**/**monstergroup**"
- "**/monstergroup**"
- "**/monstergroups/**"
"Bionics":
- "**/bionic**"
- "**/**bionic**"
"Map / Mapgen":
- "**/**mapgen**"
- "**/mapgen**"
- "**/**overmap**"
- "**/overmap**"
"Martial Arts":
- "**/martialart**"
"Player Faction Base / Camp":
- "**/basecamp**"
- "**/faction_camp**"
"Items: Ammo / Guns":
- "**/**gun**"
- "**/gun**"
- "**/**ammo**"
- "**/ammo**"
"Items: Gunmod / Toolmod":
- "**/**gunmod**"
- "**/gunmod**"
- "**/**toolmod**"
- "**/toolmod**"
"SDL: Tiles / Sound":
- "gfx/**"
- "sound/**"
"Scenarios":
- "**/scenario**"
- "**/start_location**"
"Translation":
- "lang/**"
- "**/**translation**"
- "**/translation**"
"Mods: Aftershock":
- data/mods/Aftershock/**/*
- data/mods/aftershock_exoplanet/**/*
"Mods: Dark Days of the Dead":
- data/mods/classic_zombies/**/*
"Mods: Dark Skies":
- data/mods/Dark-Skies-Above/**/*
"Mods: Desert Region":
- data/mods/desert_region/**/*
"Mods: DinoMod":
- data/mods/DinoMod/**/*
"Mods: Generic Guns":
- data/mods/Generic_Guns/**/*
"Mods: MA":
- data/mods/MA/**/*
"Mods: MMA":
- data/mods/MMA/**/*
"Mods: Magiclysm":
- data/mods/Magiclysm/**/*
"Mods: Innawood 🌲":
- data/mods/innawood/**/*
"Mods: No Hope":
- data/mods/No_Hope/**/*
"Mods: TropiCataclysm 🌴":
- data/mods/TropiCataclysm/**/*
"Mods: Tamable Wildlife":
- data/mods/Tamable_Wildlife/**/*
"Mods: Xedra Evolved":
- data/mods/Xedra_Evolved/**/*
"Mods":
- any: [ 'data/mods/**' ]
all: [ '!data/mods/TEST_DATA/**' ]
"Mechanics: Enchantments / Spells":
- "**/**enchantment**"
- "**/enchantment**"
- "**/**spells**"
- "**/spells**"
- "**/Spells/**"
- any: ['**/**spell**', '!tools/**']
"Mechanics: Weather":
- "**/weather**"
"Vehicles":
- "**/**vehicle**"
- "**/vehicle**"
- "src/veh_**"
+50 -34
View File
@@ -1,46 +1,62 @@
<!-- HOW TO USE: Under each "#### Heading" below, enter information relevant to your pull request.
Leave the headings unless they don't apply to your PR.
Please read carefully and don't delete the comments delimited by "< !--" and "-- >"
Once a pull request is submitted, automatic stylistic and consistency checks will be performed on the PR's changes.
The results of these can be either seen under the "Files changed" section of a PR or in the check's details.
NOTE: Please grant permission for repository maintainers to edit your PR. It is EXTREMELY common for PRs to be held up due to trivial changes being requested and the author being unavailable to make them. -->
<!--
### How to use
Leave the headings unless they don't apply to your PR, replace commented out text (surrounded with <!–– and ––>) with text describing your PR.
NOTE: Please grant permission for repository maintainers to edit your PR.
It is EXTREMELY common for PRs to be held up due to trivial changes being requested and the author being unavailable to make them.
-->
#### Summary
Category "Brief description"
<!-- This section should consist of exactly one line, edit the one above.
1. Replace the word "Category" with one of these words: Features, Content, Interface, Mods, Balance, Bugfixes, Performance, Infrastructure, Build, I18N.
2. Replace the text inside the quotes with a brief description of your changes.
Or if you don't want a changelog entry, replace the whole line with just the word "None" (with no quotes).
For more on the meaning of each category, see:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md
If approved and merged, your summary will be added to the project changelog:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt -->
<!--
A one-line description of your change that will be extracted and added to the [project changelog](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/changelog.txt).
The format is (ignore the square brackets): ```SUMMARY: [Category] "[description]"```
The categories to choose from are:
* Features
* Content
* Interface
* Mods
* Balance
* Bugfixes
* Performance
* Infrastructure
* Build
* I18N
Example: ```SUMMARY: Content "Adds new mutation category 'Mouse'"```
See the [Changelog Guidelines](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/CHANGELOG_GUIDELINES.md) for explanations of the categories.
-->
#### Purpose of change
<!-- With a few sentences, describe your reasons for making this change. If it relates to an existing issue, you can link it with a # followed by the GitHub issue number, like #1234. If your pull request *fully* resolves an issue, include the word "Fix" or "Fixes" before the issue number, like: Fixes #xxxx
If there is no related issue, explain here what issue, feature, or other concern you are addressing. If this is a bugfix, include steps to reproduce the original bug, so your fix can be verified. -->
<!--
If there's an existing issue describing the problem this PR addresses or the feature it adds, please link it like: ```#1234```
If it *fully* resolves an issue, link it like: Fixes #1234
Even if the issue describes the problem, please provide a few-sentence summary here.
Example: Fixes #1234 - XL mutants cannot wear arm/leg splints due to missing OVERSIZE flag.
If there is no related issue, please describe the issue you are addressing, including how to trigger a bug if this is a bugfix.
Don't put the backticks around the `#` and issue or pull request number to allow the GitHub automatically reference to it.
-->
#### Describe the solution
<!-- How does the feature work, or how does this fix a bug? The easier you make your solution to understand, the faster it can get merged. -->
<!--
How does the feature work, or how does this fix a bug?
The easier you make your solution to understand, the faster it can get merged.
-->
#### Describe alternatives you've considered
<!-- Explain any alternative solutions, different approaches, or possibilities you've considered using to solve the same problem. -->
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->
#### Testing
<!-- Describe what steps you took to test that this PR resolved the bug or added the feature, and what tests you performed to make sure it didn't cause any regressions. Also include testing suggestions for reviewers and maintainers. -->
<!--
Describe what steps you took to test that this PR resolved the bug or added the feature, and what tests you performed to make sure it didn't cause any regressions.
Also include testing suggestions for reviewers and maintainers.
-->
#### Additional context
<!-- Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature or bugfix here. -->
<!--README: Cataclysm: Dark Days Ahead is released under the Creative Commons Attribution ShareAlike 3.0 license.
The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever.
By contributing to the project you agree to the term of the license and that any contribution you make will also be covered by the same license.
See http://creativecommons.org/licenses/by-sa/3.0/ for details. -->
<!--
Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature or bugfix here.
-->
+74
View File
@@ -0,0 +1,74 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 30
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 30
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- <Bug>
- <Bugfix>
- "<Crash / Freeze>"
- "Organization: Bounty"
- "(P1 - Critical)"
- "(P2 - High)"
- "(P3 - Medium)"
- "(P4 - Low)"
- "(P5 - Long-term)"
- "(S2 - Confirmed)"
- "0.E Feature Freeze"
- "0.E Content Freeze"
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions. Please do not \'bump\' or comment on this issue
unless you are actively working on it. Stale issues, and stale issues that
are closed are still considered.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed due to lack of activity. This does
not mean that we do not value the issue. Feel free to request that it be
re-opened if you are going to actively work on it
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 2
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.
# issues:
# exemptLabels:
# - confirmed
-42
View File
@@ -1,42 +0,0 @@
version: v1
labels:
- label: "<Enhancement / Feature>"
matcher:
body: "(\\s|^)#### Summary\\s*Features +\".+\"\\s*(\n|$)"
- label: "Info / User Interface"
matcher:
body: "(\\s|^)#### Summary\\s*Interface +\".+\"\\s*(\n|$)"
- label: "Mods"
matcher:
body: "(\\s|^)#### Summary\\s*Mods +\".+\"\\s*(\n|$)"
- label: "Game: Balance"
matcher:
body: "(\\s|^)#### Summary\\s*Balance +\".+\"\\s*(\n|$)"
- label: "<Bugfix>"
matcher:
body: "(\\s|^)#### Summary\\s*Bugfixes +\".+\"\\s*(\n|$)"
- label: "<Bugfix>"
matcher:
body: ".*((C|c)lose(s|d)?|(F|f)ix(es|ed)?|(R|r)esolve(s|d)?):? #([1-9][0-9]{3,6})(\\s*|$)"
- label: "Code: Performance"
matcher:
body: "(\\s|^)#### Summary\\s*Performance +\".+\"\\s*(\n|$)"
- label: "Code: Infrastructure / Style / Static Analysis"
matcher:
body: "(\\s|^)#### Summary\\s*Infrastructure +\".+\"\\s*(\n|$)"
- label: "Code: Build"
matcher:
body: "(\\s|^)#### Summary\\s*Build +\".+\"\\s*(\n|$)"
- label: "Translation"
matcher:
body: "(\\s|^)#### Summary\\s*I18N +\".+\"\\s*(\n|$)"
-13
View File
@@ -1,13 +0,0 @@
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 65a98efbe..2f99f28f1 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -352,7 +352,7 @@ endmacro()
# - HAVE_SDL_LOADSO opt
macro(CheckLibSampleRate)
if(SDL_LIBSAMPLERATE)
- find_package(SampleRate QUIET)
+ find_package(SampleRate CONFIG REQUIRED)
if(SampleRate_FOUND AND TARGET SampleRate::samplerate)
set(HAVE_LIBSAMPLERATE TRUE)
set(HAVE_LIBSAMPLERATE_H TRUE)
-130
View File
@@ -1,130 +0,0 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO akrieger/SDL
REF release-2.26.4_qrox_math
SHA512 aa8c0552ac92bbf85dd3f9339088ebd41e0d09b1d46492462b47b632bab5d850c62b7938950accbfb51798b9f5664c1896fc75bdb8dd42b2c1cee84eebd59e13
HEAD_REF main
PATCHES
deps.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SDL_SHARED)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
vulkan SDL_VULKAN
x11 SDL_X11
wayland SDL_WAYLAND
samplerate SDL_LIBSAMPLERATE
ibus SDL_IBUS
)
if ("x11" IN_LIST FEATURES)
message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n")
endif()
if ("wayland" IN_LIST FEATURES)
message(WARNING "You will need to install Wayland dependencies to use feature wayland:\nsudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev\n")
endif()
if ("ibus" IN_LIST FEATURES)
message(WARNING "You will need to install ibus dependencies to use feature ibus:\nsudo apt install libibus-1.0-dev\n")
endif()
if(VCPKG_TARGET_IS_UWP)
set(configure_opts WINDOWS_USE_MSBUILD)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
${configure_opts}
OPTIONS ${FEATURE_OPTIONS}
-DSDL_STATIC=${SDL_STATIC}
-DSDL_SHARED=${SDL_SHARED}
-DSDL_FORCE_STATIC_VCRT=${FORCE_STATIC_VCRT}
-DSDL_LIBC=ON
-DSDL_TEST=OFF
-DSDL_INSTALL_CMAKEDIR="cmake"
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
-DSDL_LIBSAMPLERATE_SHARED=OFF
MAYBE_UNUSED_VARIABLES
SDL_FORCE_STATIC_VCRT
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/bin/sdl2-config"
"${CURRENT_PACKAGES_DIR}/debug/bin/sdl2-config"
"${CURRENT_PACKAGES_DIR}/SDL2.framework"
"${CURRENT_PACKAGES_DIR}/debug/SDL2.framework"
"${CURRENT_PACKAGES_DIR}/share/licenses"
"${CURRENT_PACKAGES_DIR}/share/aclocal"
)
file(GLOB BINS "${CURRENT_PACKAGES_DIR}/debug/bin/*" "${CURRENT_PACKAGES_DIR}/bin/*")
if(NOT BINS)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/bin"
"${CURRENT_PACKAGES_DIR}/debug/bin"
)
endif()
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib")
endif()
file(GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake")
foreach(SHARE_FILE ${SHARE_FILES})
vcpkg_replace_string("${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main")
endforeach()
endif()
vcpkg_copy_pdbs()
set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)")
set(DYLIB_CURRENT_VERSION_REGEX "set\\(DYLIB_CURRENT_VERSION (.+)\\)")
file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_COMPATIBILITY_VERSION REGEX ${DYLIB_COMPATIBILITY_VERSION_REGEX})
file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_CURRENT_VERSION REGEX ${DYLIB_CURRENT_VERSION_REGEX})
string(REGEX REPLACE ${DYLIB_COMPATIBILITY_VERSION_REGEX} "\\1" DYLIB_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}")
string(REGEX REPLACE ${DYLIB_CURRENT_VERSION_REGEX} "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2main" "-lSDL2maind")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d ")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-static " "-lSDL2-staticd ")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-lSDL2-static " " ")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-staticd " " ")
endif()
endif()
if(VCPKG_TARGET_IS_UWP)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "$<$<CONFIG:Debug>:d>.lib" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "$<$<CONFIG:Debug>:d>.lib" "d")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:")
endif()
endif()
vcpkg_fixup_pkgconfig()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
-8
View File
@@ -1,8 +0,0 @@
sdl2 provides CMake targets:
find_package(SDL2 CONFIG REQUIRED)
target_link_libraries(main
PRIVATE
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
)
-58
View File
@@ -1,58 +0,0 @@
{
"name": "sdl2",
"version": "2.26.4",
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
"homepage": "https://www.libsdl.org/download-2.0.php",
"license": "Zlib",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"base"
],
"features": {
"base": {
"description": "Base functionality for SDL",
"dependencies": [
{
"name": "sdl2",
"default-features": false,
"features": [
"ibus",
"wayland",
"x11"
],
"platform": "linux"
}
]
},
"ibus": {
"description": "Build with ibus IME support",
"supports": "linux"
},
"samplerate": {
"description": "Use libsamplerate for audio rate conversion",
"dependencies": [
"libsamplerate"
]
},
"vulkan": {
"description": "Vulkan functionality for SDL"
},
"wayland": {
"description": "Build with Wayland support",
"supports": "linux"
},
"x11": {
"description": "Build with X11 support",
"supports": "!windows"
}
}
}
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)
-5
View File
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)
-5
View File
@@ -1,5 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)
-43
View File
@@ -1,43 +0,0 @@
name: Clang Build Analyzer
on:
push:
branches:
- master
workflow_dispatch:
# Mixing in event_name so that a master push and a workflow dispatch can run at the same time.
concurrency: clang_build_analyzer-${{ github.event_name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: sudo apt-get install libncursesw5-dev gettext
- name: Prepare Build Analyzer
run: |
cd
git clone --recursive https://github.com/aras-p/ClangBuildAnalyzer.git buildAnalyzer
cd buildAnalyzer
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
cmake --build . -- -j3
echo "${PWD}" >> $GITHUB_PATH
- uses: ammaraskar/gcc-problem-matcher@master
- name: make
run: |
ClangBuildAnalyzer --start .
CLANG=clang++-14 CXXFLAGS=-ftime-trace make
ClangBuildAnalyzer --stop . buildAnalysis
- name: Analyze
run: ClangBuildAnalyzer --analyze buildAnalysis
- uses: actions/upload-artifact@v2
with:
name: ClangBuildAnalyzer-traces
path: "**/obj/*.json"
@@ -1,16 +0,0 @@
name: Detect missions that are missing .start.assign_mission_target.om_special
on:
pull_request:
paths:
- '**.json'
permissions:
contents: read
jobs:
run-the-tool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./tools/json_tools/assign_mission_target_needs_om_special.bash 2>&1
-45
View File
@@ -1,45 +0,0 @@
name: astyle
on: pull_request
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '[".github/workflows/astyle.yml", "Makefile", ".astylerc", "**.cpp", "**.h", "**.c"]'
- run: echo ${{ github.event.number }} > pull_request_id
- uses: actions/upload-artifact@v2
with:
name: pull_request_id
path: pull_request_id
astyle-code:
name: astyle check
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get install astyle
- name: astyle check
run: make astyle-check
- name: Format
if: failure()
run: make astyle-fast
- name: Display Corrections
if: failure()
run: git diff --color
+32
View File
@@ -0,0 +1,32 @@
name: C/C++ CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 10
- name: install dependencies
run: sudo apt-get install libncursesw5-dev
- name: make
run: make
- name: run tests
run: make check
- name: upload artifacts if failed
uses: actions/upload-artifact@v1
if: failure()
with:
name: cata_test
path: tests/cata_test
-24
View File
@@ -1,24 +0,0 @@
name: Check pull request head branch name
on:
pull_request_target:
types:
- opened
jobs:
check_branch_name:
runs-on: ubuntu-latest
if: github.head_ref == 'master' && github.repository == 'CleverRaven/Cataclysm-DDA'
steps:
- name: Post warning
uses: actions/github-script@v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "You are creating a pull request with the master branch as the head branch. This is likely a mistake unless you really know what you are doing. You may read https://docs.github.com/en/get-started/quickstart/contributing-to-projects#creating-a-branch-to-work-on for a typical workflow of contributing to a project on GitHub."
});
-24
View File
@@ -1,24 +0,0 @@
name: Check printf format string in translations
on:
pull_request:
paths:
- 'lang/po/*.po'
- 'tools/check_po_printf_format.py'
permissions:
contents: read
jobs:
check-po-printf:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install polib
- name: "Checkout"
uses: actions/checkout@v2
- name: "Check printf format string in translations"
run: ./tools/check_po_printf_format.py
-77
View File
@@ -1,77 +0,0 @@
name: Clang-tidy (clang-12, tiles)
on:
push:
branches:
- master
pull_request:
branches:
- master
# We only care about the latest revision of a PR, so cancel all previous instances.
concurrency:
group: clang-tidy-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '[ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", ".github/workflows/clang-tidy.yml" ]'
build:
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-20.04
env:
CMAKE: 1
CLANG: clang++-12
COMPILER: clang++-12
CATA_CLANG_TIDY: plugin
TILES: 1
SOUND: 1
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main"
sudo apt-get update
sudo apt-get install libncursesw5-dev clang-12 libclang-12-dev llvm-12-dev llvm-12-tools \
libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev ccache \
gettext jq
- name: prepare
run: bash ./build-scripts/requirements.sh
- name: determine changed files
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v5
with:
script: |
var fs = require('fs');
const response = await github.paginate(github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
}
);
const files = response.map(x => x.filename);
for (const path of files) {
console.log(path);
}
fs.writeFileSync("files_changed", files.join('\n'));
- uses: ammaraskar/gcc-problem-matcher@master
- name: run clang-tidy
run: bash ./build-scripts/clang-tidy.sh
-34
View File
@@ -1,34 +0,0 @@
name: cmake-format linting
on:
push:
branches:
- master
paths:
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
pull_request:
branches:
- master
paths:
- '**/CMakeLists.txt'
- '**.cmake'
- '**.cmake.in'
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install cmakelang
run: python3 -m pip install -U cmakelang
- name: run cmake-lint
run: python3 -m cmakelang.lint CMakeLists.txt src/CMakeLists.txt data/CMakeLists.txt lang/CMakeLists.txt src/chkjson/CMakeLists.txt tools/format/CMakeLists.txt tools/clang-tidy-plugin/CMakeLists.txt cmake_uninstall.cmake.in -c .cmake-format.yml
-70
View File
@@ -1,70 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master, 0.8-branch, 0.9-branch, 0.A-branch, 0.B-branch, 0.C-branch, 0.D-branch, 0.E-branch, gh-pages ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '31 12 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- run: |
make RELEASE=1 RUNTESTS=0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
-31
View File
@@ -1,31 +0,0 @@
name: "Comment Commands"
on:
issue_comment:
types:
- created
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
jobs:
confirm-bug:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set-up Comvent
uses: rytswd/comvent@v0.3
id: comvent
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-path: .github/comment-commands.yml
- if: steps.comvent.outputs.confirm-bug != ''
name: Handle confirmation command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "(S1 - Need Confirmation)"
gh issue edit "$ISSUE_NUMBER" --add-label "(S2 - Confirmed)"
@@ -1,59 +0,0 @@
name: Detect translation file changes
on:
pull_request_target:
paths:
- lang/po/*.po
- lang/po/*.pot
jobs:
detect-translation-file-changes:
runs-on: ubuntu-latest
steps:
- name: "Detect translation file changes"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const skip_phrase = 'Translation file changes are intended';
if (context.payload.pull_request.body.includes(skip_phrase)) {
console.log('PR body contains skip phrase. Exiting.');
return;
}
core.setFailed('Translation file changes detected, but a skip phrase is not found in the PR body.')
console.log(
'Fetching comments of pull request %d of repository %s/%s.',
context.issue.number, context.repo.owner, context.repo.repo
);
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
}
);
const body = 'It appears you modified a `.po` or `.pot` file. '
+ 'These translation files are automatically generated, '
+ 'pushed to, and pulled from Transifex, and should not be '
+ 'modified otherwise. If these changes are intended, please '
+ 'add `' + skip_phrase + '` to the '
+ 'PR body.';
const bot_comments = comments.filter(
comment => comment.user.type === 'Bot'
&& comment.user.login === 'github-actions[bot]'
&& comment.body === body
);
if (bot_comments.length > 0) {
console.log('Comment already exists. Exiting.');
return;
}
console.log('Posting comment.');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
-32
View File
@@ -1,32 +0,0 @@
name: Flake8 Python linting
on:
push:
branches:
- master
paths:
- '**.py'
pull_request:
branches:
- master
paths:
- '**.py'
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies
run: sudo apt-get install flake8
- name: Enable flake8 problem matcher
run: echo "::add-matcher::build-scripts/problem-matchers/flake8.json"
- name: run Flake8
run: make python-check
+9 -25
View File
@@ -1,36 +1,20 @@
name: JSON Validation
on: pull_request
on:
pull_request
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '["**.json", ".github/workflows/json.yml"]'
- run: echo ${{ github.event.number }} > pull_request_id
- uses: actions/upload-artifact@v2
with:
name: pull_request_id
path: pull_request_id
style-json:
name: JSON style check
runs-on: ubuntu-latest
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v1
with:
fetch-depth: 10
- name: JSON style check
run: make style-all-json-parallel RELEASE=1
run: make style-json
- name: Display Corrections
if: failure()
run: git diff --color
run: git diff
-19
View File
@@ -1,19 +0,0 @@
name: "Pull Request Labeler"
on:
- pull_request_target
permissions:
contents: read
jobs:
triage:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# I don't want no bot removing stuff for me
sync-labels: ""
-41
View File
@@ -1,41 +0,0 @@
name: Code Style Reviewer
on:
pull_request_target:
paths:
- '**.json'
- '**.cpp'
- '**.h'
- '**.c'
pull_request:
paths:
- '**.json'
- '**.cpp'
- '**.h'
- '**.c'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.run_id }}
cancel-in-progress: true
jobs:
style-code:
if: ${{ github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: '${{ github.event.pull_request.head.sha }}'
- run: sudo apt-get install astyle
- run: make astyle-fast
- run: make style-all-json-parallel
- name: 'suggester / JSON & C++'
uses: reviewdog/action-suggester@v1
if: ${{ always() }}
with:
tool_name: 'JSON & C++ formatters'
-343
View File
@@ -1,343 +0,0 @@
name: General build matrix
on:
push:
branches:
- master
pull_request:
branches:
- master
# We only care about the latest revision of a PR, so cancel all previous instances.
# Allow running master builds to complete to help with ccache refreshes.
concurrency:
group: general-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Overall strategy for what sorts of builds to include:
# We want a build for the newest and oldest supported version of each compiler.
# We want a build for each platform.
# 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
# - LOCALIZE=0
# - LTO=1
# - LIBBACKTRACE=1 (on Linux and Windows)
# - Tests with important mods enabled (Magiclysm)
# - A clang-tidy run
# - SANITIZE=address,undefined
# We try to minimize the number of builds subject to those constraints.
#
# To see what toolchains are available, the following may be useful:
# https://launchpad.net/%7Eubuntu-toolchain-r/+archive/ubuntu/test/+index
# https://apt.llvm.org/
jobs:
skip-duplicates-code:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip_code: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["android/**", "build-data/osx/**", "doc/**", "doxygen_doc/**", "lgtm/**", "msvc-**", "object_creator/**", "tools/**", "utilities/**", "data/**", "lang/**"]'
skip-duplicates-data:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip_data: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["android/**", "build-data/osx/**", "doc/**", "doxygen_doc/**", "lgtm/**", "msvc-**", "object_creator/**", "tools/**", "utilities/**"]'
matrix-variables:
permissions:
contents: none
continue-on-error: true
runs-on: ubuntu-latest
outputs:
fail_fast: ${{ steps.matrix_vars.outputs.fail_fast }}
skip_tests: ${{ steps.matrix_vars.outputs.skip_tests }}
max_parallel: ${{ steps.matrix_vars.outputs.max_parallel }}
steps:
- id: matrix_vars
run: |
echo "fail_fast=$([ "$GITHUB_REF_NAME" = "master" ] && echo false || echo true)" >> $GITHUB_OUTPUT
echo "skip_tests=$([ "$GITHUB_REF_NAME" = "master" ] && echo true || echo false)" >> $GITHUB_OUTPUT
echo "max_parallel=$([ "$GITHUB_REF_NAME" = "master" ] && echo 20 || echo 1)" >> $GITHUB_OUTPUT
varied_builds:
needs: [ skip-duplicates-code, skip-duplicates-data, matrix-variables ]
strategy:
fail-fast: ${{ fromJSON(needs.matrix-variables.outputs.fail_fast) }}
max-parallel: ${{ fromJSON(needs.matrix-variables.outputs.max_parallel) }}
matrix:
include:
- compiler: clang++-10
os: ubuntu-20.04
tiles: 0
sound: 0
release: 1
cmake: 0
localize: 1
test-stage: 1
native: linux64
archive-success: basic-build
dont_skip_data_only_changes: 1
title: Basic Build and Test (Clang 10, Ubuntu, Curses)
# ~190MB in a clean build
# ~30MB compressed
# observed usage: 3.0GB -> 300MB
ccache_limit: 2G
ccache_key: linux-llvm-10
- compiler: g++-9
os: ubuntu-latest
release: 1
cmake: 0
tiles: 0
sound: 0
localize: 1
gold: 1
lto: 1
libbacktrace: 1
native: linux64
title: GCC 9, Curses, LTO
# ~850MB in a clean build
# ~370MB compressed
# observed usage: 4.0GB -> 1.5GB
ccache_limit: 3G
ccache_key: linux-gcc-9-lto
- compiler: clang++-12
os: ubuntu-22.04
release: 0
cmake: 0
tiles: 1
sound: 0
localize: 1
native: linux64
sanitize: address
cxxflags: --gcc-toolchain=/opt/mock-gcc-11
mods: --mods=magiclysm
dont_skip_data_only_changes: 1
title: Clang 12, Ubuntu, Tiles, ASan
# ~390MB in a clean build
# ~50MB compressed
# observed usage: 4.0GB -> 400MB
ccache_limit: 3G
ccache_key: linux-llvm-12-asan
- compiler: g++-11
os: ubuntu-latest
release: 0
cmake: 0
tiles: 0
sound: 0
localize: 1
native: linux64
sanitize: address
title: GCC 11, Ubuntu, Curses, ASan
# ~480MB in a clean build
# ~50MB compressed
# observed usage: 4.4GB -> 400MB
ccache_limit: 4G
ccache_key: linux-gcc-11-asan
- compiler: clang++
os: macos-12
release: 0
cmake: 0
native: osx
sanitize: undefined
tiles: 1
sound: 1
localize: 1
title: Clang 14, macOS 12, Tiles, Sound, UBSan
# ~880MB ccache-compressed in a clean build
# ~100 compressed
# observed usage: 3.85GB -> 500MB
ccache_limit: 4G
ccache_key: macos-llvm-14
- compiler: g++
os: ubuntu-latest
release: 0
cmake: 0
native:
tiles: 1
sound: 1
localize: 1
libbacktrace: 1
title: GCC 12, Ubuntu cross-compile to MinGW-Win64, Tiles, Sound
ldflags: -static-libgcc -static-libstdc++
mxe_target: x86_64-w64-mingw32.static.gcc12
wine: wine
# ~285MB in a clean build
# ~36MB compressed
# observed usage: 3.0GB -> 350MB
ccache_limit: 2G
ccache_key: mingw-gcc-12
- compiler: g++-9
os: ubuntu-latest
release: 1
cmake: 1
tiles: 1
sound: 1
localize: 0
native: linux64
title: GCC 9, Ubuntu, Tiles, Sound, CMake
# ~180MB in a clean build
# ~25MB compressed
# observed usage: 3.0GB -> 300MB
ccache_limit: 2G
ccache_key: linux-gcc-9-cmake
# Reserving space for msvc ccache & vcpkg cache
# observed usage:
# vcpkg: ??? -> 500MB
# ccache: 8GB -> 1.0GB
name: ${{ matrix.title }}
runs-on: ${{ matrix.os }}
env:
ZSTD_CLEVEL: 17
CMAKE: ${{ matrix.cmake }}
COMPILER: ${{ matrix.compiler }}
MXE_TARGET: ${{ matrix.mxe_target }}
WINE: ${{ matrix.wine }}
OS: ${{ matrix.os }}
TILES: ${{ matrix.tiles }}
SOUND: ${{ matrix.sound }}
LOCALIZE: ${{ matrix.localize }}
MODS: ${{ matrix.mods }}
SANITIZE: ${{ matrix.sanitize }}
TEST_STAGE: ${{ matrix.test-stage }}
CXXFLAGS: ${{ matrix.cxxflags }}
LDFLAGS: ${{ matrix.ldflags }}
EXTRA_TEST_OPTS: --error-format=github-action
NUM_TEST_JOBS: ${{ matrix.num_test_jobs }}
NATIVE: ${{ matrix.native }}
GOLD: ${{ matrix.gold }}
LTO: ${{ matrix.lto }}
LIBBACKTRACE: ${{ matrix.libbacktrace }}
RELEASE: ${{ matrix.release }}
ARCHIVE_SUCCESS: ${{ matrix.archive-success }}
CCACHE_LIMIT: ${{ matrix.ccache_limit }}
CCACHE_FILECLONE: true
CCACHE_HARDLINK: true
CCACHE_NOCOMPRESS: true
SKIP: ${{ ( github.event.pull_request.draft == true && matrix.title != 'Basic Build and Test (Clang 10, Ubuntu, Curses)' ) || ( matrix.dont_skip_data_only_changes == 0 && needs.skip-duplicates.outputs.should_skip_code == 'true' ) || ( matrix.dont_skip_data_only_changes != 0 && needs.skip-duplicates-mods.outputs.should_skip_data == 'true' ) }}
SKIP_TESTS: ${{ needs.matrix-variables.outputs.skip_tests }}
steps:
- name: checkout repository
if: ${{ env.SKIP == 'false' }}
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: install dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libncursesw5-dev ccache gettext parallel
- name: install SDL2 dependencies (ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && matrix.tiles == 1 }}
run: |
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev
- name: install recent ccache on ubuntu 20.04
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && matrix.os == 'ubuntu-20.04' }}
run: |
sudo apt-get remove --purge -y ccache
curl -sL https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | sudo tar Jxvf - --strip-components 1 -C /usr/bin ccache-4.8-linux-x86_64/ccache
ccache --version
- name: set up a mock GCC toolchain root for Clang (Ubuntu)
if: ${{ env.SKIP == 'false' && runner.os == 'Linux' && (matrix.compiler == 'clang++-12') }}
run: |
sudo mkdir /opt/mock-gcc-11
sudo ln -s /usr/include /opt/mock-gcc-11/include
sudo ln -s /usr/bin /opt/mock-gcc-11/bin
sudo mkdir -p /opt/mock-gcc-11/lib/gcc/x86_64-linux-gnu
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/11 /opt/mock-gcc-11/lib/gcc/x86_64-linux-gnu/11
- name: install runtime dependencies (mac)
if: ${{ env.SKIP == 'false' && runner.os == 'macOS' }}
uses: BrettDong/setup-sdl2-frameworks@v1
with:
sdl2: latest
sdl2-ttf: latest
sdl2-image: latest
sdl2-mixer: latest
- name: install build dependencies (mac)
if: ${{ env.SKIP == 'false' && runner.os == 'macOS' }}
run: |
HOMEBREW_NO_AUTO_UPDATE=yes HOMEBREW_NO_INSTALL_CLEANUP=yes brew install gettext ccache parallel
- name: prepare
if: ${{ env.SKIP == 'false' }}
run: bash ./build-scripts/requirements.sh
- name: Get ccache vars
id: get-vars
if: ${{ env.SKIP == 'false' }}
run: |
echo "datetime=$(/bin/date -u "+%Y%m%d%H%M")" >> $GITHUB_OUTPUT
echo "ccache-path=$([ "$RUNNER_OS" = "macOS" ] && echo '/Users/runner/Library/Caches/ccache' || echo '~/.cache/ccache')" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
if: ${{ env.SKIP == 'false' && ( runner.os == 'Linux' || runner.os == 'macOS' ) }}
uses: actions/cache@v2
with:
path: ${{ steps.get-vars.outputs.ccache-path }}
# double-dash after compiler is not a typo, it is to disambiguate between g++-<date> and g++-11-<date> for restore key prefix matching
key: ccache-${{ github.ref_name }}-${{ matrix.ccache_key }}--${{ steps.get-vars.outputs.datetime }}
restore-keys: |
ccache-master-${{ matrix.ccache_key }}--
- uses: ammaraskar/gcc-problem-matcher@master
- name: build
if: ${{ env.SKIP == 'false' }}
run: bash ./build-scripts/gha_compile_only.sh
- name: post-build ccache manipulation
if: ${{ env.SKIP == 'false' && !failure() && (runner.os == 'Linux' || runner.os == 'macOS') }}
run: |
ccache --show-stats --verbose
ccache -M ${{ env.CCACHE_LIMIT }}
ccache -c
ccache --show-stats --verbose
- name: clear ccache on PRs
if: ${{ github.ref_name != 'master' && env.SKIP == 'false' && !failure() && (runner.os == 'Linux' || runner.os == 'macOS') }}
run: |
ccache -C
# TODO: post ccache here, however actions/cache@v2 does not support manual upload step
- name: run tests
if: ${{ env.SKIP == 'false' && env.SKIP_TESTS == 'false' }}
run: bash ./build-scripts/gha_test_only.sh
- run: |
echo ${{ github.event.number }} > pull_request_id
echo "true" > ${{ env.ARCHIVE_SUCCESS }}
if: ${{ env.ARCHIVE_SUCCESS && success() }}
- run: |
echo ${{ github.event.number }} > pull_request_id
echo "false" > ${{ env.ARCHIVE_SUCCESS }}
if: ${{ env.ARCHIVE_SUCCESS && failure() }}
- uses: actions/upload-artifact@v2
if: ${{ always() && env.ARCHIVE_SUCCESS }}
with:
name: pull_request_id
path: pull_request_id
- uses: actions/upload-artifact@v2
if: ${{ always() && env.ARCHIVE_SUCCESS }}
with:
name: ${{ env.ARCHIVE_SUCCESS }}
path: ${{ env.ARCHIVE_SUCCESS }}
- name: upload artifacts if failed
uses: actions/upload-artifact@v2
if: failure()
with:
name: cata_test
path: tests/cata_test*
if-no-files-found: ignore
-211
View File
@@ -1,211 +0,0 @@
name: Cataclysm Windows build
on:
push:
branches:
- master
paths-ignore:
- 'android/**'
- 'build-data/osx/**'
- 'doc/**'
- 'doxygen_doc/**'
- 'gfx/**'
- 'lang/**'
- 'lgtm/**'
- 'tools/**'
- '!tools/format/**'
- 'utilities/**'
pull_request:
branches:
- master
paths-ignore:
- 'android/**'
- 'build-data/osx/**'
- 'doc/**'
- 'doxygen_doc/**'
- 'gfx/**'
- 'lang/**'
- 'lgtm/**'
- 'tools/**'
- '!tools/format/**'
- 'utilities/**'
# We only care about the latest revision of a PR, so cancel previous instances.
concurrency:
group: msvc-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
env:
# Enable pretty backtraces
BACKTRACE: 1
# Compressed size ~1GB based on observations
CCACHE_LIMIT: 8GB
CDDA_CCACHE_PATH: ${{ github.workspace }}\ccache\
CDDA_USE_CCACHE: true
# There's not enough disk space to build both release and debug versions of
# our dependencies, so we hack the triplet file to build only release versions
# Have to use github.workspace because runner namespace isn't available yet.
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}\.github\vcpkg_triplets
# Also conveniently disable ccache internal compression
CCACHE_HARDLINK: true
# vcpkg with object_creator deps totals ~500MB at this compression level
ZSTD_CLEVEL: 17
jobs:
build_catatclysm:
name: Build
runs-on: windows-2019
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Use GNU tar to enable zstd for actions/cache
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
shell: cmd
- name: Restore artifacts, or run vcpkg, build and cache artifacts
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
# run-vcpkg tries to hash vcpkg.json but complans if it finds more than one.
# That said, we also have our custom vcpkg_triplets to hash, so we keep everything the same.
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', 'msvc-object_creator/vcpkg.json', '.github/vcpkg_triplets/**', '.github/vckg_ports/**' ) }}
# Rev this value to drop cache without changing vcpkg commit
prependedCacheKey: v1-x64-full
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
# field in vcpkg.json. Caching happens as a post-action which runs at the end of
# the whole workflow, after vcpkg install happens during msbuild run.
vcpkgGitCommitId: 'd08e708c2111893da3cc7e49b597ee4654c8076e'
- name: Integrate vcpkg
run: |
vcpkg integrate install --vcpkg-root '${{ runner.workspace }}\b\vcpkg'
- name: Download ccache
uses: robinraju/release-downloader@v1.4
with:
repository: 'ccache/ccache'
tag: 'v4.6.1'
fileName: 'ccache-4.6.1-windows-x86_64.zip'
- name: Install ccache
id: install-ccache
run: |
unzip ccache-4.6.1-windows-x86_64.zip
cp ccache-4.6.1-windows-x86_64/ccache.exe ccache-4.6.1-windows-x86_64/cl.exe
cp ccache-4.6.1-windows-x86_64/ccache.exe ccache-4.6.1-windows-x86_64/clang-cl.exe
mv ccache-4.6.1-windows-x86_64 ${{ env.CDDA_CCACHE_PATH }}
- name: Get ccache vars
id: get-vars
run: |
echo "datetime=$(/bin/date -u "+%Y%m%d%H%M")" >> $GITHUB_OUTPUT
echo "ccache-path=$(echo "$APPDATA\\ccache")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v3
with:
path: ${{ steps.get-vars.outputs.ccache-path }}
# double-dash after compiler is not a typo, it is to disambiguate between g++-<date> and g++-11-<date> for restore key prefix matching
key: ccache-${{ github.ref_name }}-${{ runner.os }}-msvc--${{ steps.get-vars.outputs.datetime }}
restore-keys: |
ccache-master-${{ runner.os }}-msvc--
- name: Configure ccache
run: |
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -M 10G
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -z
- name: Symlink intermediates to C
run: |
mkdir -p "$env:TEMP\objwin"
New-Item -ItemType SymbolicLink -Target "$env:TEMP\objwin" objwin
- name: Build
run: |
msbuild -m -p:Configuration=Release -p:Platform=x64 "-target:Cataclysm-vcpkg-static;Cataclysm-test-vcpkg-static;JsonFormatter-vcpkg-static" msvc-full-features/Cataclysm-vcpkg-static.sln
msbuild -m -p:Configuration=Release -p:Platform=x64 "-target:ObjectCreator-vcpkg-static" msvc-object_creator/ObjectCreator-vcpkg-static.sln
- name: Post-build ccache manipulation
if: ${{ !failure() }}
run: |
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -M ${{ env.CCACHE_LIMIT }}
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -c
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -s -v
- name: clear ccache on PRs
if: ${{ github.ref_name != 'master' }}
run: |
${{ env.CDDA_CCACHE_PATH }}\ccache.exe -C
- name: Dump vcpkg logs if build failed
if: failure()
run: |
echo =================================================
Get-ChildItem "${{ runner.workspace }}/Cataclysm-DDA/msvc-full-features/vcpkg_installed" -Recurse
echo =================================================
Get-ChildItem "${{ runner.workspace }}/Cataclysm-DDA/msvc-object_creator/vcpkg_installed" -Recurse
echo =================================================
Get-ChildItem "${{ runner.workspace }}/b/vcpkg/buildtrees" |
Foreach-Object {
Get-ChildItem $_.FullName -Filter *.log |
Foreach-Object {
echo =================================================
echo $_.FullName
echo =================================================
type $_.FullName
}
}
- name: Compile .mo files for localization
if: ${{ github.ref_name != 'master' }}
run: |
& "C:\msys64\mingw64\bin\mingw32-make" -C lang -j2
mkdir -p ./data/mods/TEST_DATA/lang/mo/ru/LC_MESSAGES -ErrorAction SilentlyContinue
msgfmt -f -o ./data/mods/TEST_DATA/lang/mo/ru/LC_MESSAGES/TEST_DATA.mo ./data/mods/TEST_DATA/lang/po/ru.po
- name: Enable GitHub Actions problem matchers
if: ${{ github.ref_name != 'master' }}
run: |
Write-Output "::add-matcher::build-scripts/problem-matchers/catch2.json"
Write-Output "::add-matcher::build-scripts/problem-matchers/debugmsg.json"
- name: Run tests
if: ${{ github.ref_name != 'master' }}
run: |
.\Cataclysm-test-vcpkg-static-Release-x64.exe --min-duration 0.2 --rng-seed time
- name: Dump disk usage logs if job failed
if: failure()
run: |
echo =================================================
df
echo =================================================
du -sh *
echo =================================================
du -sh msvc-full-features/*
echo =================================================
du -sh msvc-object_creator/*
echo =================================================
du -sh tools/*
echo =================================================
shell: bash
- name: Don't upload vcpkg cache on failure or PRs
if: ${{ failure() || cancelled() || github.ref_name != 'master' }}
run: |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV
shell: bash
@@ -1,78 +0,0 @@
name: Post Spell Check Result
on:
workflow_run:
workflows: ["Text Changes Analyzer"]
types:
- completed
jobs:
post-spell-check-result:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download pr id artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: pull_request_id
- name: Download spell check retcode artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: spell_check_retcode
- name: set-spell-check-retcode
id: set-spell-check-retcode
run: echo "spell-check-retcode=$( cat spell_check_retcode )" >> $GITHUB_OUTPUT
- name: Download spell check output artifact
if: steps.set-spell-check-retcode.outputs.spell-check-retcode >= 1
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: spell_check_output
- name: 'Comment on PR'
if: steps.set-spell-check-retcode.outputs.spell-check-retcode >= 1
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./pull_request_id'));
var body = fs.readFileSync('./spell_check_output', 'utf8');
console.log("Fetching comments of pull request %d of repository %s/%s.", issue_number, context.repo.owner, context.repo.repo);
const comments = await github.paginate(github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number
}
);
const prev_spell_checks = comments.slice(0).reverse()
.filter(comment => comment.user.type === 'Bot' && comment.user.login === 'github-actions[bot]')
.filter(comment => comment.body.startsWith("Spell checker"));
if (prev_spell_checks.some(comment => comment.body === body)) {
console.log("The exact same spell checker comment already exists. Exiting.");
return;
}
for (const comment of prev_spell_checks) {
console.log("Deleting previous spell checker comment (comment id: %i)", comment.id);
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
});
}
console.log("Posting comment.");
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: body
});
+1 -1
View File
@@ -12,5 +12,5 @@ jobs:
- name: "Validate SUMMARY"
uses: CleverRaven/pr-validator@master
with:
description-regex: '(\n|^)#### Summary\s+`{0,3}(SUMMARY:\s+)?(None|((Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N) +".+"))`{0,3}\s*(\n|$)'
description-regex: '(\n|^)\s*`{0,3}SUMMARY: +(None|((Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N) +".*"))`{0,3}\s*(\n|$)'
description-regex-flags: 'i'
-49
View File
@@ -1,49 +0,0 @@
name: "Pull translations from Transifex"
on:
schedule:
- cron: "42 1 * * 6"
jobs:
pull-translations:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-22.04
steps:
- name: "Install Transifex CLI"
run: |
curl -sL https://github.com/transifex/cli/releases/download/v1.6.4/tx-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/bin tx
- name: "Delete existing i18n branch"
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TX_PR_CREATOR }}
script: |
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "i18n"
})
} catch (error) {
console.log(error)
}
- name: "Checkout"
uses: actions/checkout@v3
- name: "Get current date"
uses: josStorer/get-current-time@v2.0.2
id: current-date
with:
format: 'DD MMMM YYYY'
- name: "Pull translations"
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: tx pull --force
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Routine i18n updates on ${{ steps.current-date.outputs.formattedTime }}
token: ${{ secrets.TX_PR_CREATOR }}
branch: i18n
base: master
title: Routine i18n updates on ${{ steps.current-date.outputs.formattedTime }}
body: "#### Summary\nNone\n\n#### Additional context\n`Translation file changes are intended`"
labels: Translation
@@ -1,41 +0,0 @@
name: "Push translation template"
concurrency: push_transifex
on:
workflow_run:
workflows: ["Experimental Release"]
types:
- completed
permissions:
contents: read
jobs:
push-template:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'push' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.status == 'success' &&
github.repository == 'CleverRaven/Cataclysm-DDA' }}
steps:
- name: "Install gettext tools"
run: sudo apt install gettext
- name: "Install Transifex CLI"
run: |
curl -sL https://github.com/transifex/cli/releases/download/v1.6.4/tx-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/bin tx
- name: "Install Python3"
run: |
sudo apt install python3-pip
sudo pip3 install polib
- name: "Checkout"
uses: actions/checkout@v2
- name: "Generate translation template"
run: |
lang/update_pot.sh
- name: "Push translation template to Transifex server"
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: tx push -s
-342
View File
@@ -1,342 +0,0 @@
name: "Experimental Release"
concurrency: release
on:
push:
branches:
- master
paths:
- '.github/workflows/release.yml'
- 'android/**'
- 'build-data/**'
- 'cataclysm-launcher'
- 'data/**'
- 'doc/**'
- 'gfx/**'
- 'lang/po/*.po'
- 'LICENSE*'
- 'Makefile'
- 'README*'
- 'src/**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
timestamp: ${{ steps.get-timestamp.outputs.time }}
release_already_exists: ${{ steps.tag_check.outputs.exists }}
steps:
- name: Get build timestamp
id: get-timestamp
uses: nanzm/get-time-action@v1.1
with:
timeZone: 0
format: 'YYYY-MM-DD-HHmm'
- name: Generate environmental variables
id: generate_env_vars
run: |
echo "tag_name=cdda-experimental-${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
echo "release_name=Cataclysm-DDA experimental build ${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
- name: Check if there is existing git tag
id: tag_check
uses: mukunku/tag-exists-action@v1.0.0
with:
tag: ${{ steps.generate_env_vars.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Push tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.5
if: ${{ steps.tag_check.outputs.exists == 'false' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.generate_env_vars.outputs.tag_name }}
tag_prefix: ""
- name: "Generate release notes"
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/CleverRaven/Cataclysm-DDA/releases/generate-notes \
-f tag_name='${{ steps.generate_env_vars.outputs.tag_name }}' \
-f target_commitish='master' \
-q .body > CHANGELOG.md
- name: Create release
id: create_release
uses: actions/create-release@v1
if: ${{ steps.tag_check.outputs.exists == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.generate_env_vars.outputs.tag_name }}
release_name: ${{ steps.generate_env_vars.outputs.release_name }}
body_path: ./CHANGELOG.md
draft: false
prerelease: true
builds:
needs: release
if: ${{ needs.release.outputs.release_already_exists == 'false' }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows Tiles x64 MSVC
artifact: windows-tiles-x64-msvc
arch: x64
os: windows-2019
mxe: none
ext: zip
content: application/zip
sound: 0
- name: Windows Tiles Sounds x64 MSVC
artifact: windows-tiles-sounds-x64-msvc
arch: x64
os: windows-2019
mxe: none
ext: zip
content: application/zip
sound: 1
- name: Windows Tiles x64
mxe: x86_64
artifact: windows-tiles-x64
os: ubuntu-latest
ext: zip
content: application/zip
sound: 0
- name: Windows Tiles Sounds x64
mxe: x86_64
artifact: windows-tiles-sounds-x64
os: ubuntu-latest
ext: zip
content: application/zip
sound: 1
- name: Linux Tiles x64
os: ubuntu-20.04
mxe: none
android: none
tiles: 1
sound: 0
artifact: linux-tiles-x64
ext: tar.gz
content: application/gzip
- name: Linux Tiles Sounds x64
os: ubuntu-20.04
mxe: none
android: none
tiles: 1
sound: 1
artifact: linux-tiles-sounds-x64
ext: tar.gz
content: application/gzip
- name: Linux Curses x64
os: ubuntu-20.04
mxe: none
android: none
tiles: 0
sound: 0
artifact: linux-curses-x64
ext: tar.gz
content: application/gzip
- name: OSX Curses x64
os: macos-12
mxe: none
tiles: 0
sound: 0
artifact: osx-curses-x64
ext: dmg
content: application/x-apple-diskimage
- name: OSX Tiles x64
os: macos-12
mxe: none
tiles: 1
sound: 0
artifact: osx-tiles-x64
ext: dmg
content: application/x-apple-diskimage
- name: Android x64
os: ubuntu-latest
mxe: none
android: arm64
artifact: android-x64
ext: apk
content: application/apk
- name: Android x32
os: ubuntu-latest
mxe: none
android: arm32
artifact: android-x32
ext: apk
content: application/apk
- name: Android Bundle
os: ubuntu-latest
mxe: none
android: bundle
artifact: android-bundle
ext: aab
content: application/aap
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
ZSTD_CLEVEL: 17
steps:
- uses: actions/checkout@v2
- name: Get soundpack
if: matrix.sound == 1
run: |
git clone --depth=1 --shallow-submodules --recurse-submodules https://github.com/Fris0uman/CDDA-Soundpacks '${{ github.workspace }}/CDDA-Soundpacks'
mv '${{ github.workspace }}/CDDA-Soundpacks/sound/CC-Sounds' '${{ github.workspace }}/data/sound'
- name: Install dependencies (windows msvc) (1/3)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.0.2
- name: Install dependencies (windows msvc) (2/3)
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@v10
id: runvcpkg
with:
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**', '.github/vckg_ports/**' ) }}
# Rev this value to drop cache without changing vcpkg commit
prependedCacheKey: v1-${{ matrix.arch }}
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
# field in vcpkg.json. Caching happens as a post-action which runs at the end of
# the whole workflow, after vcpkg install happens during msbuild run.
vcpkgGitCommitId: 'd08e708c2111893da3cc7e49b597ee4654c8076e'
- name: Install dependencies (windows msvc) (3/3)
if: runner.os == 'Windows'
run: |
vcpkg integrate install --vcpkg-root '${{ runner.workspace }}\b\vcpkg'
- name: Install dependencies (windows mxe)
if: matrix.mxe != 'none'
run: |
sudo apt install gettext
- name: Install MXE
if: matrix.mxe != 'none'
run: |
curl -L -o mxe-${{ matrix.mxe }}.tar.xz https://github.com/BrettDong/MXE-GCC/releases/download/mxe-sdl-2-0-20/mxe-${{ matrix.mxe }}.tar.xz
curl -L -o mxe-${{ matrix.mxe }}.tar.xz.sha256 https://github.com/BrettDong/MXE-GCC/releases/download/mxe-sdl-2-0-20/mxe-${{ matrix.mxe }}.tar.xz.sha256
shasum -a 256 -c ./mxe-${{ matrix.mxe }}.tar.xz.sha256
sudo tar xJf mxe-${{ matrix.mxe }}.tar.xz -C /opt
curl -L -o SDL2-devel-2.26.2-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz
shasum -a 256 -c ./build-scripts/SDL2-devel-2.26.2-mingw.tar.gz.sha256
sudo tar -xzf SDL2-devel-2.26.2-mingw.tar.gz -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12 --strip-components=2 SDL2-2.26.2/${{ matrix.mxe }}-w64-mingw32
curl -L -o libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz
shasum -a 256 -c ./build-scripts/libbacktrace-${{ matrix.mxe }}-w64-mingw32-sha256
sudo tar -xzf libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz --exclude=LICENSE -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
sudo apt-get update
sudo apt-get install libncursesw5-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev \
libsdl2-mixer-dev libpulse-dev ccache gettext parallel
- name: Install runtime dependencies (mac)
if: runner.os == 'macOS'
uses: BrettDong/setup-sdl2-frameworks@v1
with:
sdl2: latest
sdl2-ttf: latest
sdl2-image: latest
sdl2-mixer: latest
- name: Install build dependencies (mac)
if: runner.os == 'macOS'
run: |
HOMEBREW_NO_AUTO_UPDATE=yes HOMEBREW_NO_INSTALL_CLEANUP=yes brew install gettext ccache parallel
pip3 install mac_alias==2.2.0 dmgbuild==1.4.2 biplist
- name: Create VERSION.TXT
shell: bash
run: |
cat >VERSION.txt <<EOL
build type: ${{ matrix.artifact }}
build number: ${{ needs.release.outputs.timestamp }}
commit sha: ${{ github.sha }}
commit url: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
EOL
- name: Compile translations (windows)
if: runner.os == 'Windows'
shell: bash
run: |
lang/compile_mo.sh all
- name: Build CDDA (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 bindist
mv cataclysmdda-0.F.tar.gz cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.tar.gz
- name: Build CDDA (windows mxe)
if: matrix.mxe != 'none'
env:
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc12-
run: |
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
mv cataclysmdda-0.F.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (windows msvc)
if: runner.os == 'Windows'
env:
# Enable pretty backtraces
BACKTRACE: 1
CDDA_STRIPPED_PDB: 1
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}\.github\vcpkg_triplets
run: |
msbuild -m -p:Configuration=Release -p:Platform=${{ matrix.arch }} "-target:Cataclysm-vcpkg-static;JsonFormatter-vcpkg-static" msvc-full-features\Cataclysm-vcpkg-static.sln
.\build-scripts\windist.ps1
mv cataclysmdda-0.F.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (osx)
if: runner.os == 'macOS'
run: |
make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 USE_HOME_DIR=1 OSX_MIN=10.13 FRAMEWORK=1 dmgdist
mv Cataclysm.dmg cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.dmg
- name: Set up JDK 8 (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Setup Build and Dependencies (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
run: |
sudo apt-get update
sudo apt-get install gettext
- name: Build CDDA (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
working-directory: ./android
run: |
echo "${{ secrets.KEYSTORE }}" > release.keystore.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch release.keystore.asc > app/release.keystore
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > keystore.properties.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch keystore.properties.asc > keystore.properties
export UPSTREAM_BUILD_NUMBER="$((11581 + ${{ github.run_number }}))"
chmod +x gradlew
if [ ${{ matrix.android }} = arm64 ]
then
./gradlew -Pj=$((`nproc`+0)) -Pabi_arm_32=false assembleExperimentalRelease
mv ./app/build/outputs/apk/experimental/release/*.apk ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.apk
elif [ ${{ matrix.android }} = arm32 ]
then
./gradlew -Pj=$((`nproc`+0)) -Pabi_arm_64=false assembleExperimentalRelease
mv ./app/build/outputs/apk/experimental/release/*.apk ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.apk
elif [ ${{ matrix.android }} = bundle ]
then
./gradlew -Pj=$((`nproc`+0)) bundleExperimentalRelease
mv ./app/build/outputs/bundle/experimentalRelease/*.aab ../cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.aab
fi
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.${{ matrix.ext }}
asset_name: cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.${{ matrix.ext }}
asset_content_type: ${{ matrix.content }}
- name: Trigger GitHub pages rebuild
shell: bash
run: |
curl --fail --request POST \
--url https://api.github.com/repos/${{ github.repository }}/pages/builds \
--header "Authorization: Bearer ${{ secrets.USER_TOKEN }}" \
--header "Accept: application/vnd.github.v3+json"
-33
View File
@@ -1,33 +0,0 @@
name: 'Stale issue handler'
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: get-time
run: |
echo "time=$(date +%I)" >> $GITHUB_ENV
- uses: actions/stale@main
id: stale
with:
stale-issue-label: stale
stale-pr-label: stale
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.'
stale-pr-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.'
days-before-stale: 30
days-before-close: 30
start-date: '2020-05-07'
ascending: ${{ contains(fromJson('["01", "03", "05", "07", "09", "11"]'), env.time) }}
operations-per-run: 250
exempt-issue-labels: '<Bug>,<Bugfix>,<Crash / Freeze>,Organization: Bounty,Good First Issue,(P1 - Critical),(P2 - High),(P3 - Medium),(P4 - Low),(P5 - Long-term),(S2 - Confirmed),0.G String Freeze,0.G Feature Freeze,0.G Content Freeze'
exempt-pr-labels: '<Bug>,<Bugfix>,<Crash / Freeze>,Organization: Bounty,Good First Issue,(P1 - Critical),(P2 - High),(P3 - Medium),(P4 - Low),(P5 - Long-term),(S2 - Confirmed),0.G String Freeze,0.G Feature Freeze,0.G Content Freeze'
exempt-all-milestones: true
exempt-all-assignees: true
- name: Print outputs
run: echo ${{ join(steps.stale.outputs.*, ',') }}
-15
View File
@@ -1,15 +0,0 @@
name: Summary Labeler
on:
- pull_request_target
jobs:
uses:
name: labeler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fuxingloh/multi-labeler@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config-path: '.github/summary-labels.yml'
-78
View File
@@ -1,78 +0,0 @@
name: Apply Test Labels
on:
workflow_run:
workflows: ["astyle", "JSON Validation", "General build matrix"]
types: [completed]
jobs:
labeling:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-latest
steps:
- name: setLabel
id: setLabel
run: |
if [[ "${{ github.event.workflow_run.name }}" == "astyle" ]]; then
echo "label=astyled" >> $GITHUB_OUTPUT
fi
if [[ "${{ github.event.workflow_run.name }}" == "JSON Validation" ]]; then
echo "label=json-styled" >> $GITHUB_OUTPUT
fi
if [[ "${{ github.event.workflow_run.name }}" == "General build matrix" ]]; then
echo "label=BasicBuildPassed" >> $GITHUB_OUTPUT
fi
- name: Download success artifact from basic build
if: ${{ github.event.workflow_run.name == 'General build matrix' }}
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: basic-build
- name: set-basic-build-success
id: set-basic-build-success
run: echo "basic-build-success=$( cat basic-build )" >> $GITHUB_OUTPUT
- name: Download pr id artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: pull_request_id
- name: set-pr-id
id: set-pr-id
run: echo "pr-id=$( cat pull_request_id )" >> $GITHUB_OUTPUT
- name: set-label
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.conclusion != 'skipped' || steps.set-basic-build-success.outputs.basic-build-success == 'true' }}
uses: actions/github-script@v5
with:
script: |
if ('${{ steps.set-pr-id.outputs.pr-id }}'.trim().length == 0) {
console.log("The PR ID artifact does not contain a pull request number.")
} else {
github.rest.issues.addLabels({
issue_number: ${{ steps.set-pr-id.outputs.pr-id }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['${{ steps.setLabel.outputs.label }}']
})
}
- name: remove-label
if: ${{ github.event.workflow_run.conclusion == 'failure' && steps.set-basic-build-success.outputs.basic-build-success != 'true' }}
uses: actions/github-script@v5
with:
script: |
if ('${{ steps.set-pr-id.outputs.pr-id }}'.trim().length == 0) {
console.log("The PR ID artifact does not contain a pull request number.")
} else {
try {
github.rest.issues.removeLabel({
issue_number: ${{ steps.set-pr-id.outputs.pr-id }},
owner: context.repo.owner,
repo: context.repo.repo,
name: '${{ steps.setLabel.outputs.label }}'
})
} catch (e) {
console.log(e)
}
}
@@ -1,83 +0,0 @@
name: Text Changes Analyzer
on:
pull_request:
branches:
- master
paths:
- '.github/workflows/text-changes-analyzer.yml'
- 'tools/pot_diff.py'
- 'lang/extract_json_strings.py'
- 'lang/string_extractor/**'
- 'src/*.h'
- 'src/*.cpp'
- '**.json'
permissions:
contents: read
jobs:
analyze-text-changes:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install python3-pip gettext
sudo pip3 install polib pyspellchecker
- name: "Checkout test merge commit"
uses: actions/checkout@v2
- name: "Compute base commit and test merge commit"
id: get-commit-hash
run: |
echo "test_merge_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "head_commit=$(git log -1 --format='%B' | grep -o -E -e 'Merge\s([0-9a-f]{40})\sinto' | grep -o -E -e '[0-9a-f]{40}')" >> $GITHUB_OUTPUT
echo "base_commit=$(git log -1 --format='%B' | grep -o -E -e 'into\s([0-9a-f]{40})$' | grep -o -E -e '[0-9a-f]{40}')" >> $GITHUB_OUTPUT
- name: "Generate translation template on test merge commit"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/merge.pot
- name: "Checkout base commit"
uses: actions/checkout@v2
with:
ref: ${{ steps.get-commit-hash.outputs.base_commit }}
- name: "Generate translation template on base commit"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/base.pot
- name: "Checkout test merge commit"
uses: actions/checkout@v2
with:
ref: ${{ steps.get-commit-hash.outputs.test_merge_commit }}
- name: "List text changes"
run: |
python3 ./tools/pot_diff.py ~/base.pot ~/merge.pot
- name: "Write text changes"
run: |
python3 ./tools/pot_diff.py ~/base.pot ~/merge.pot -j ~/pot_diff.json
- name: "Spell check on text changes"
run: |
python3 ./tools/spell_check_pr.py -i ~/pot_diff.json > spell_check_output
- name: "Get length of spell check output"
id: get_length
run: |
wc -c spell_check_output | grep -o '[0-9]*' > spell_check_retcode
echo "length=$(cat spell_check_retcode)" >> $GITHUB_OUTPUT
- run: echo ${{ github.event.number }} > pull_request_id
- uses: actions/upload-artifact@v2
with:
name: pull_request_id
path: pull_request_id
- uses: actions/upload-artifact@v2
with:
name: spell_check_retcode
path: spell_check_retcode
- uses: actions/upload-artifact@v2
if: steps.get_length.outputs.length >= 1
with:
name: spell_check_output
path: spell_check_output
-31
View File
@@ -1,31 +0,0 @@
on:
push:
branches:
- master
paths:
- 'doc/JSON_INFO.md'
name: TOC Generator
permissions:
contents: read
jobs:
generateTOC:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
name: Update the table of contents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npx doctoc doc/JSON_INFO.md --github
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update the table of contents
branch: update-toc
token: ${{ secrets.TX_PR_CREATOR }}
title: Update the table of contents in doc/JSON_INFO.md
body: |
```sh
#### Summary
None
npx doctoc doc/JSON_INFO.md --github
```
-48
View File
@@ -1,48 +0,0 @@
# This workflow runs at 23:00 UTC sundays
name: "Pull Tileset Updates"
on:
schedule:
- cron: "0 23 * * sun"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TX_TOKEN: ${{ secrets.TX_TOKEN }}
jobs:
pull-updates:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Get current date"
uses: 1466587594/get-current-time@v2
id: current-date
with:
format: 'DD MMMM YYYY'
- name: "Update Tilesets"
shell: bash
run: |
gh release download -D gfx/ -p '*.zip' -R I-am-Erk/CDDA-Tilesets
gh release download -D gfx/ -p '*.zip' -R pixel-32/CDDA-tileset
find gfx/ -name "*.zip" | xargs -I{} unzip -o {} -d gfx/
rm -fr gfx/*.zip
# make sure all files are linted just in case
# FIXME: make json test check gfx folder instead of using this
make tools/format/json_formatter.cgi
find gfx/ -name "*.json" -print0 | xargs -0 -L 1 -P $(nproc) tools/format/json_formatter.cgi || exit 0
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: |
Routine tileset updates on ${{ steps.current-date.outputs.formattedTime }}
committer: casswedson <casswedson@users.noreply.github.com>
author: casswedson <casswedson@users.noreply.github.com>
token: ${{ secrets.TX_PR_CREATOR }}
branch: tileset-updates
delete-branch: true
base: master
title: Routine tileset updates on ${{ steps.current-date.outputs.formattedTime }}
body: "#### Summary\nNone\nAutomatic tileset updates from:\n\n**https://github.com/I-am-Erk/CDDA-Tilesets/releases**\nAltica, BrownLikeBears, ChibiUltica, HollowMoon, Larwick_Overmap, MshockXotto+, NeoDaysTileset, RetroDaysTileset, SmashButton_iso, SurveyorsMap\n\n---\n\n**https://github.com/pixel-32/CDDA-tileset/releases**\nCuteclysm"
-50
View File
@@ -1,50 +0,0 @@
name: "Weekly changelog update"
on:
schedule:
- cron: "45 0 * * 1"
push:
branches:
- master
paths:
- '.github/workflows/weekly-changelog.yml'
jobs:
weekly-changelog:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Get current date"
uses: 1466587594/get-current-time@v2
id: current-date
with:
format: 'YYYYMMDD'
- name: "Get changes since last week"
id: getting-changes
env:
CURR_DATE: ${{ steps.current-date.outputs.formattedTime }}
run: |
LAST_WEEK="$(date -d "@$(( $(date +%s -d $CURR_DATE) - (60*60*24*7) ))" +"%Y-%m-%d")"
tools/generate_changelog.py -f --by-date /tmp/changelog.txt -T "${{ secrets.GITHUB_TOKEN }}" "$LAST_WEEK"
tac /tmp/changelog.txt > /tmp/changelog_rev.txt
tools/merge_summaries.sh /tmp/changelog_rev.txt data/changelog.txt
echo "date=$( date +"%Y-%m-%d" -d $CURR_DATE )" >> $GITHUB_OUTPUT
echo "old_date=$LAST_WEEK" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.10.0
with:
commit-message: Weekly Changelog ${{ steps.getting-changes.outputs.old_date }} to ${{ steps.getting-changes.outputs.date }}
committer: David Seguin <davidseguin@live.ca>
author: David Seguin <davidseguin@live.ca>
token: ${{ secrets.TX_PR_CREATOR }}
branch: changelog-weekly
delete-branch: true
base: master
title: Weekly Changelog ${{ steps.getting-changes.outputs.old_date }} to ${{ steps.getting-changes.outputs.date }}
body: "#### Summary\nNone\n\n#### Additional context\n`Automatically generated as a draft. Please copy-edit before merging.`"
labels: Organization,<Documentation>
# create as a draft to allow maintainers to cull the changes before merging
draft: true
+10 -56
View File
@@ -7,17 +7,13 @@
*.o
*.tmp
*.zip
*.apk
*.log
/WinDepend/
/bindist/
/build/
/build-start-time
/cache/
/cmake-build-debug/
/config/
/data/*.template
/data/cache/
/data/mods/user-default-mods.json
/dep/
/doxygen_doc/html/*
@@ -30,7 +26,6 @@
/objwin/
/save/
/src/version.h
/src/prefix.h
/sound/
/templates/
/tools/format/json_formatter.cgi
@@ -40,38 +35,30 @@ CataclysmWin.layout
cata_test
cata_test-tiles
cataclysm
*cataclysm-tiles
cataclysm-tiles
cataclysm-vcpkg
cataclysmdda-*
chkjson*
debug.log
logg.txt
json_formatter
# Visual Studio files
*.code-workspace
*.exp
*.ilk
*.opensdf
*.pdb
*.lib
*.manifest
*.sdf
*.suo
*.user
*.vcxproj.filters
*.lastbuildstate
.vs/
.vscode/
Directory.Build.props
Directory.Build.targets
Debug*/
Release*/
# Visual Studio project files
/msvc-full-features/**/
# Temporary CMakeFiles
CMakeUserPresets.json
out/
# Distribution script results
/msvc-full-features/distribution
# Visual Studio 2015
/msvc-full-features/*db
@@ -82,12 +69,6 @@ Cataclysm.exe.lastcodeanalysissucceeded
#Visual Studio 2017
/msvc-full-features/PredictedInputCache_Debug_x64.dat
# Visual Studio 2019
**/enc_temp_folder/*
#vcpkg
/msvc-object_creator/vcpkg_installed
# PVS Studio
/msvc-full-features/*PVS-Studio*
@@ -107,14 +88,11 @@ cscope.*
tags
# Generated translation source
/lang/po/*.pot
/lang/po/en.po
# Compiled binary translations
/lang/mo/
# Stampfile for binary translations
/lang/mo_built.stamp
# Directory for translatable strings
/lang/json/*
!/lang/json/README
@@ -123,7 +101,6 @@ tags
nbproject/
# Python runtime files
__pycache__
*.pyc
# vim files
@@ -143,21 +120,18 @@ __pycache__
# OSX
Cataclysm.app
build-data/osx/AppIcon.icns
data/osx/AppIcon.icns
Cataclysm.dmg
# Jetbrains CLion
.idea/
# test executables and generated data
/tests/obj
/tests/cata_test
/tests/line_test
/tests/map_iterator_test
/tests/shadowcasting_test
/tests/data/jsionized_overmap.sav
/test_user_dir
monfactions.txt
# temporary files generated by tools/reduce_tests.sh
/list_of_tests
@@ -180,7 +154,6 @@ cataclysm.a
# clang tooling
compile_commands.json
.clangd
# IDA database
Cataclysm.i64
@@ -188,6 +161,9 @@ Cataclysm.id*
Cataclysm.til
Cataclysm.nam
# Transifex Client
.tx/
# Snapcraft build directories
prime
snap
@@ -210,25 +186,3 @@ Xcode/
/.flatpak-builder/
/repo/
/build-dir/
# precompiled headers
/pch/pch.hpp.pch
/pch/main-pch.hpp.gch
/pch/main-pch.hpp.pch
/tests/pch/pch.hpp.pch
/tests/pch/tests-pch.hpp.gch
/tests/pch/tests-pch.hpp.pch
/tests/catch/catch.hpp.gch
/tests/catch/catch.hpp.pch
weather.output
# bundler local directories and files for jekyll site
/.bundle/
/_site/
/vendor/
.sass-cache
.jekyll-metadata
Gemfile.lock
# VERSION.txt generated by our CMakeLists.txt
VERSION.txt
-12
View File
@@ -1,12 +0,0 @@
extraction:
cpp:
prepare:
packages:
- "libncurses-dev"
index:
build_command: "make RELEASE=1 cataclysm -j2"
# Disable FIXME query, in DDA it is as likely to be a future feature as a bug.
queries:
- exclude: cpp/fixme-comment
- exclude: cpp/non-constant-format
+223
View File
@@ -0,0 +1,223 @@
# this file is HEAVILY influenced by https://github.com/boostorg/hana/blob/master/.travis.yml
dist: xenial
language: c++
cache: ccache
notifications:
email: false
irc: "irc.freenode.org#Cataclysm-DDA"
use_notice: true
skip_join: true
git:
depth: 5
addons:
# these apt sources will be referenced later (by using *name)
apt:
sources: &apt_sources
- ubuntu-toolchain-r-test
config:
retries: true
compiler: gcc
os: linux
# We have branch builds disabled globally to prevent double-builds of PRs.
# This re-enables just the master branch.
branches:
only:
- 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
# - Tests with important mods enabled (Magiclysm, RL_Classes)
# 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
# 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: "Main Compilers"
env: COMPILER=g++ MODS=--mods=magiclysm LOCALIZE=0
name: "GCC 5.3 Make build with curses, Magiclysm, 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 EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency"
name: "GCC 8 Make build with Tiles, Sound, astyle and address sanitization"
dist: bionic
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", "astyle"]
sources: *apt_sources
- env: CLANG=clang++-8 SANITIZE=address,undefined EXTRA_TEST_OPTS="~[.] ~vehicle_efficiency ~vehicle_drag ~starting_items ~[starve] ~grenade_lethality"
name: "Clang 8 Make build with sanitizers enabled, but long-running tests disabled"
compiler: clang
addons: &clang8
apt:
packages: ["clang-8", "libc6-dbg", "libc6-dbg:i386"]
sources: [*apt_sources, llvm-toolchain-xenial-8]
- 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"]
- env: NATIVE=android COMPILER=gcc
name: "Android build"
language: android
android:
components:
- build-tools-28.0.1
- android-28
cache:
# The ccache feature in Travis doesn't work for language: android, so
# do it ourselves.
directories:
- $HOME/.ccache
- 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
- env: CLANG=clang++-8 TILES=1 SOUND=1 CXXFLAGS=-Wno-unused-command-line-argument CMAKE=1 CATA_CLANG_TIDY=plugin
name: "Clang-tidy CMake build with Tiles and Sound"
compiler: clang
addons: &clang8
apt:
packages: ["clang-8", "libclang-8-dev", "llvm-8-dev", "llvm-8-tools", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev", "libpulse-dev", "libpulse0=1:8.0-0ubuntu3.10", "libpulse-mainloop-glib0=1:8.0-0ubuntu3.10"]
sources: [*apt_sources, llvm-toolchain-xenial-8]
# 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
- env: COMPILER=g++-6 CODE_COVERAGE=true
name: "GCC 6 Make build with Curses and Code Coverage"
if: type != pull_request
compiler: gcc
addons: &gcc6
apt:
packages: ["g++-6", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
sources: *apt_sources
- env: COMPILER=g++-7 CXXFLAGS='-Wno-implicit-fallthrough -D_GLIBCXX_DEBUG'
name: "GCC 7 Make build with Curses and GLIBCXX_DEBUG"
if: type != pull_request
compiler: gcc
addons: &gcc7
apt:
packages: ["g++-7", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386", "lcov"]
sources: *apt_sources
- 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: ["wine"]
- 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
- 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 (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
addons: &clang50
apt:
packages: ["clang-5.0", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
sources: [*apt_sources, llvm-toolchain-trusty-5.0]
- 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", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev", "libpulse-dev", "libpulse0=1:8.0-0ubuntu3.10", "libpulse-mainloop-glib0=1:8.0-0ubuntu3.10"]
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
- ${COMPILER} --version
- CXX="$COMPILER"
- source build-scripts/requirements.sh
script:
- build-scripts/build.sh
after_success:
- if [ -n "${CODE_COVERAGE}" ]; then coveralls -b . -i src -e tests --gcov /usr/bin/gcov-6; fi
- if [ -n "${CODE_COVERAGE}" ]; then bash <(curl -s https://codecov.io/bash); fi
-24
View File
@@ -1,24 +0,0 @@
[main]
host = https://www.transifex.com
[o:cataclysm-dda-translators:p:cataclysm-dda:r:master-cataclysm-dda]
file_filter = lang/po/<lang>.po
source_file = lang/po/cataclysm-dda.pot
source_lang = en
type = PO
minimum_perc = 0
[o:cataclysm-dda-translators:p:cataclysm-dda:r:credits-master]
file_filter = data/credits/<lang>.credits
source_file = data/credits/en.credits
source_lang = en
type = TXT
minimum_perc = 20
[o:cataclysm-dda-translators:p:cataclysm-dda:r:motd-master]
file_filter = data/motd/<lang>.motd
source_file = data/motd/en.motd
source_lang = en
type = TXT
minimum_perc = 20
+312 -380
View File
@@ -1,91 +1,78 @@
cmake_minimum_required(VERSION 3.21)
# Main project build script
cmake_minimum_required(VERSION 3.1.4)
project(CataclysmDDA)
PROJECT(CataclysmDDA)
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMakeModules)
if (NOT VCPKG_MANIFEST_MODE)
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMakeModules/Find)
endif()
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/CMakeModules
)
set(CMAKE_TLS_VERIFY ON)
SET(CMAKE_TLS_VERIFY ON)
# Build options
option(TILES "Build graphical tileset version." "OFF")
option(CURSES "Build curses version." "ON")
option(SOUND "Support for in-game sounds & music." "OFF")
option(BACKTRACE "Support for printing stack backtraces on crash" "ON")
option(LIBBACKTRACE "Print backtrace with libbacktrace." "OFF")
option(USE_HOME_DIR "Use user's home directory for save files." "ON")
option(USE_PREFIX_DATA_DIR "Use UNIX system directories for game data in release build." "ON")
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON")
option(LANGUAGES "Compile localization files for specified languages." "")
option(DYNAMIC_LINKING
"Use dynamic linking. Or use static to remove MinGW dependency instead." "ON")
option(JSON_FORMAT "Build JSON formatter" "OFF")
option(CATA_CCACHE "Try to find and build with ccache" "ON")
option(CATA_CLANG_TIDY_PLUGIN "Build Cata's custom clang-tidy checks as a plugin" "OFF")
option(CATA_CLANG_TIDY_EXECUTABLE "Build Cata's custom clang-tidy checks as an executable" "OFF")
option(TESTS "Compile Cata's tests" "ON")
set(CATA_CLANG_TIDY_INCLUDE_DIR "" CACHE STRING
"Path to internal clang-tidy headers required for plugin (e.g. ClangTidy.h)")
option(TILES "Build graphical tileset version." "OFF")
option(CURSES "Build curses version." "ON")
option(SOUND "Support for in-game sounds & music." "OFF")
option(BACKTRACE "Support for printing stack backtraces on crash" "ON")
option(LIBBACKTRACE "Print backtrace with libbacktrace." "OFF")
option(USE_HOME_DIR "Use user's home directory for save files." "ON")
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON")
option(LANGUAGES "Compile localization files for specified languages." "")
option(DYNAMIC_LINKING "Use dynamic linking. Or use static to remove MinGW dependency instead." "ON")
option(JSON_FORMAT "Build JSON formatter" "OFF")
option(CATA_CLANG_TIDY_PLUGIN "Build Cata's custom clang-tidy plugin" "OFF")
set(CATA_CLANG_TIDY_INCLUDE_DIR "" CACHE STRING "Path to internal clang-tidy headers required for plugin (e.g. ClangTidy.h)")
set(CATA_CHECK_CLANG_TIDY "" CACHE STRING "Path to check_clang_tidy.py for plugin tests")
set(GIT_BINARY "" CACHE STRING "Git binary name or path.")
set(GETTEXT_MSGFMT_BINARY "" CACHE FILEPATH "msgfmt binary name or path.")
set(GIT_BINARY "" CACHE STRING "Git binary name or path.")
set(PREFIX "" CACHE STRING "Location of Data & GFX directories")
if (TESTS)
include(CTest)
endif()
message(STATUS "${PROJECT} build environment --")
message(STATUS "Build realm is: ${CMAKE_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_PROCESSOR}")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif ()
add_definitions(-DCMAKE)
include(GetGitRevisionDescription)
git_describe(GIT_VERSION --tags --always --match "[0-9A-Z]*.[0-9A-Z]*")
if (NOT "${GIT_VERSION}" MATCHES "GIT-NOTFOUND")
string(REPLACE "-NOTFOUND" "" GIT_VERSION ${GIT_VERSION})
file(WRITE ${CMAKE_SOURCE_DIR}/src/version.h
"// NOLINT(cata-header-guard)\n\#define VERSION \"${GIT_VERSION}\"\n")
message(STATUS "${PROJECT_NAME} build version is: ${GIT_VERSION}")
add_definitions(-DGIT_VERSION)
git_describe(GIT_VERSION)
# get_git_head_revision() does not work with worktrees in Windows
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE _sha1
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TIMESTAMP _timestamp %Y-%m-%d-%H%M)
file(WRITE VERSION.txt "\
build type: ${BUILD_PRESET_NAME}\n\
build number: ${_timestamp}\n\
commit sha: ${_sha1}\n\
commit url: https://github.com/CleverRaven/Cataclysm-DDA/commit/${_sha1}"
)
endif ()
MESSAGE("\n * Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.")
MESSAGE(" _________ __ .__ ")
MESSAGE(" \\_ ___ \\ _____ _/ |_ _____ ____ | | ___.__ ______ _____ ")
MESSAGE(" / \\ \\/ \\__ \\ \\ __\\\\__ \\ _/ ___\\ | | < | | / ___/ / \\ ")
MESSAGE(" \\ \\____ / __ \\_ | | / __ \\_\\ \\___ | |__ \\___ | \\___ \\ | Y Y \\ ")
MESSAGE(" \\______ /\(____ / |__| \(____ / \\___ >|____/ / ____|/____ >|__|_| / ")
MESSAGE(" \\/ \\/ \\/ \\/ \\/ \\/ \\/ ")
MESSAGE(" --= Dark Days Ahead =--")
MESSAGE("\n * https://cataclysmdda.org/\n")
MESSAGE(STATUS "${PROJECT} build environment -- \n")
MESSAGE(STATUS "Build realm is : ${CMAKE_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_PROCESSOR}")
IF(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
ENDIF(NOT CMAKE_BUILD_TYPE)
if (NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
string(REPLACE "-NOTFOUND" "" GIT_VERSION ${GIT_VERSION})
FILE(WRITE ${CMAKE_SOURCE_DIR}/src/version.h "\#define VERSION \"${GIT_VERSION}\"\n")
MESSAGE(STATUS "${PROJECT_NAME} build version is : ${GIT_VERSION}\n")
ADD_DEFINITIONS(-DGIT_VERSION)
ELSE (NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
MESSAGE("")
ENDIF(NOT ${GIT_VERSION} MATCHES GIT-NOTFOUND)
#OS Check Placeholders. Will be used for BINDIST
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(_OS_LINUX_ 1)
endif ()
IF (${CMAKE_SYSTEM_NAME} MATCHES Linux)
SET(_OS_LINUX_ 1)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Linux)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
set(_OS_FREEBSD_ 1)
endif ()
IF (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
SET(_OS_FREEBSD_ 1)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
set(_OS_DARWIN_ 1)
add_definitions(-DMACOSX)
if (TILES)
add_definitions(-DOSX_SDL2_LIBS)
endif ()
endif ()
IF(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
SET(_OS_DARWIN_ 1)
SET(LOCALIZE OFF)
MESSAGE(STATUS "Disable internationalization on Darwin as it is not supported")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
include(CheckCXXCompilerFlag)
@@ -96,369 +83,314 @@ include(CheckCXXCompilerFlag)
#SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32")
#SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32")
if (NOT DYNAMIC_LINKING)
if(NOT MSVC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.dll.a")
endif()
set(BUILD_SHARED_LIBRARIES OFF)
IF (NOT DYNAMIC_LINKING)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.dll.a")
SET(BUILD_SHARED_LIBRARIES OFF)
check_cxx_compiler_flag (-static HAVE_STATIC_FLAG)
if (HAVE_STATIC_FLAG)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif ()
IF(HAVE_STATIC_FLAG)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
ENDIF(HAVE_STATIC_FLAG)
# Workaround for cmake link library guesser
set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
else ()
if (MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Avoid depending on MinGW runtime DLLs
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif ()
endif ()
SET(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
SET(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
ELSE (NOT DYNAMIC_LINKING)
IF(MINGW AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Avoid depending on MinGW runtime DLLs
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
ENDIF(MINGW AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
ENDIF (NOT DYNAMIC_LINKING)
# System specific actions
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Linux|FreeBSD|Darwin)")
if (NOT DATA_PREFIX)
set(DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/share/cataclysm-dda)
endif ()
if (NOT README_DIR)
set(README_DIR ${DATA_PREFIX})
endif ()
if (NOT LOCALE_DIR)
set(LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/locale)
endif ()
if (NOT BIN_PREFIX)
set(BIN_PREFIX ${CMAKE_INSTALL_PREFIX}/bin)
endif ()
if (NOT DESKTOP_ENTRY_PATH)
set(DESKTOP_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/applications)
endif ()
if (NOT PIXMAPS_ENTRY_PATH)
set(PIXMAPS_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
endif ()
if (NOT PIXMAPS_UNITY_ENTRY_PATH)
set(PIXMAPS_UNITY_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/ubuntu-mono-dark)
endif ()
if (NOT MANPAGE_ENTRY_PATH)
set(MANPAGE_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
endif ()
endif ()
IF (${CMAKE_SYSTEM_NAME} MATCHES Linux OR ${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
IF(NOT DATA_PREFIX)
SET( DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/share/cataclysm-dda)
ENDIF(NOT DATA_PREFIX)
IF(NOT LOCALE_DIR)
SET( LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/share/locale)
ENDIF(NOT LOCALE_DIR)
IF(NOT BIN_PREFIX)
SET( BIN_PREFIX ${CMAKE_INSTALL_PREFIX}/bin)
ENDIF(NOT BIN_PREFIX)
IF(NOT DESKTOP_ENTRY_PATH)
SET( DESKTOP_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/applications)
ENDIF(NOT DESKTOP_ENTRY_PATH)
IF(NOT PIXMAPS_ENTRY_PATH)
SET( PIXMAPS_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
ENDIF(NOT PIXMAPS_ENTRY_PATH)
IF(NOT PIXMAPS_UNITY_ENTRY_PATH)
SET( PIXMAPS_UNITY_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/ubuntu-mono-dark)
ENDIF(NOT PIXMAPS_UNITY_ENTRY_PATH)
IF(NOT MANPAGE_ENTRY_PATH)
SET( MANPAGE_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
ENDIF(NOT MANPAGE_ENTRY_PATH)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Linux OR ${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Windows|MSYS)")
if (NOT DATA_PREFIX)
set(DATA_PREFIX ${CMAKE_INSTALL_PREFIX}/data)
endif ()
if (NOT README_DIR)
set(README_DIR ${CMAKE_INSTALL_PREFIX})
endif ()
if (NOT LOCALE_DIR)
set(LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/lang)
endif ()
if (NOT BIN_PREFIX)
set(BIN_PREFIX ${CMAKE_INSTALL_PREFIX})
endif ()
endif ()
IF (${CMAKE_SYSTEM_NAME} MATCHES Windows)
IF(NOT DATA_PREFIX)
SET(DATA_PREFIX ${CMAKE_INSTALL_PREFIX})
ENDIF(NOT DATA_PREFIX)
IF(NOT LOCALE_DIR)
SET(LOCALE_DIR ${CMAKE_INSTALL_PREFIX})
ENDIF(NOT LOCALE_DIR)
IF(NOT BIN_PREFIX)
SET(BIN_PREFIX ${CMAKE_INSTALL_PREFIX})
ENDIF(NOT BIN_PREFIX)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Windows)
message(STATUS "${PROJECT_NAME} build options --")
MESSAGE(STATUS "${PROJECT_NAME} build options --\n")
# Preset variables
if (NOT LANGUAGES)
set(LANGUAGES ar cs da de el es_AR es_ES fil_PH fr ga_IE hu id is it_IT ja ko nb nl pl pt_BR ro
ru sr tr uk_UA zh_CN zh_TW)
endif ()
IF(NOT LANGUAGES)
# English is included to workaround a libintl bug that affects performance
# on MinGW targets. See lang/CMakeList.txt for more information.
SET (LANGUAGES en de es_AR es_ES fr it_IT ja ko pt_BR ru zh_CN zh_TW)
ENDIF(NOT LANGUAGES)
if (GIT_BINARY)
set(GIT_EXECUTABLE ${GIT_BINARY})
else ()
find_package(Git)
if (NOT GIT_FOUND)
message(WARNING
"Git binary not found. Build version will be set to NULL. \
Install Git package or use -DGIT_BINARY to set path to git binary.")
endif ()
endif ()
IF (GIT_BINARY)
SET(GIT_EXECUTABLE ${GIT_BINARY})
ELSE (GIT_BINARY)
FIND_PACKAGE(Git)
IF (NOT GIT_FOUND)
MESSAGE(WARNING "Git binary not found. Build version will be set to NULL. Install Git package or use -DGIT_BINARY to set path to git binary.")
ENDIF (NOT GIT_FOUND)
ENDIF (GIT_BINARY)
IF (PREFIX)
ADD_DEFINITIONS(-DPREFIX=${PREFIX})
ENDIF (PREFIX)
# Can't compile curses and tiles build's at same time
if (TILES)
set(CURSES OFF)
endif ()
IF(TILES)
SET(CURSES OFF)
ENDIF(TILES)
# Set build types and display info
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(RELEASE 0)
message(STATUS "Build ${PROJECT} in development mode --")
message(STATUS "Binaries will be located in: " ${CMAKE_SOURCE_DIR})
set(CMAKE_VERBOSE_MAKEFILE ON)
IF(CMAKE_BUILD_TYPE STREQUAL Debug)
MESSAGE("\n")
MESSAGE(STATUS "Build ${PROJECT} in development mode --\n")
MESSAGE(STATUS "Binaries will be located in: " ${CMAKE_SOURCE_DIR})
SET(CMAKE_VERBOSE_MAKEFILE ON)
# Since CataclysmDDA does not respect PREFIX for development builds
# and has funny path handlers, we should create resulting Binaries
# in the source directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR} CACHE PATH
"Single Directory for all Executables.")
set(BIN_PREFIX ${CMAKE_SOURCE_DIR})
else ()
set(RELEASE 1)
message(STATUS "CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "BIN_PREFIX : ${BIN_PREFIX}")
message(STATUS "DATA_PREFIX : ${DATA_PREFIX}")
if (LOCALIZE)
message(STATUS "LOCALE_PATH : ${LOCALE_DIR}")
endif ()
message(STATUS "DESKTOP_ENTRY_PATH : ${DESKTOP_ENTRY_PATH}")
message(STATUS "PIXMAPS_ENTRY_PATH : ${PIXMAPS_ENTRY_PATH}")
message(STATUS "PIXMAPS_UNITY_ENTRY_PATH : ${PIXMAPS_UNITY_ENTRY_PATH}")
message(STATUS "MANPAGE_ENTRY_PATH : ${MANPAGE_ENTRY_PATH}")
add_definitions(-DRELEASE)
# Use CMAKE_INSTALL_PREFIX as storage of data,gfx, etc.. Useful only on *nix OS.
if (CMAKE_INSTALL_PREFIX AND NOT WIN32 AND USE_PREFIX_DATA_DIR)
add_definitions(-DPREFIX=${CMAKE_INSTALL_PREFIX})
configure_file(
"${CMAKE_SOURCE_DIR}/src/prefix.h.in"
"${CMAKE_SOURCE_DIR}/src/prefix.h"
@ONLY)
add_definitions(-DDATA_DIR_PREFIX)
endif ()
endif ()
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${CMAKE_SOURCE_DIR}
CACHE PATH "Single Directory for all Executables."
)
SET(BIN_PREFIX ${CMAKE_SOURCE_DIR})
ELSE (CMAKE_BUILD_TYPE STREQUAL Debug)
MESSAGE(STATUS "CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX}")
MESSAGE(STATUS "BIN_PREFIX : ${BIN_PREFIX}")
MESSAGE(STATUS "DATA_PREFIX : ${DATA_PREFIX}")
IF(LOCALIZE)
MESSAGE(STATUS "LOCALE_PATH : ${LOCALE_DIR}")
ENDIF(LOCALIZE)
MESSAGE(STATUS "DESKTOP_ENTRY_PATH : ${DESKTOP_ENTRY_PATH}")
MESSAGE(STATUS "PIXMAPS_ENTRY_PATH : ${PIXMAPS_ENTRY_PATH}")
MESSAGE(STATUS "PIXMAPS_UNITY_ENTRY_PATH : ${PIXMAPS_UNITY_ENTRY_PATH}")
MESSAGE(STATUS "MANPAGE_ENTRY_PATH : ${MANPAGE_ENTRY_PATH}\n")
ADD_DEFINITIONS(-DRELEASE)
# Use PREFIX as storage of data,gfx, etc.. Useful only on *nix OS.
IF (PREFIX AND NOT WIN32)
ADD_DEFINITIONS(-DDATA_DIR_PREFIX)
ENDIF (PREFIX AND NOT WIN32)
ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)
message(STATUS "GIT_BINARY : ${GIT_EXECUTABLE}")
message(STATUS "DYNAMIC_LINKING : ${DYNAMIC_LINKING}")
message(STATUS "TILES : ${TILES}")
message(STATUS "CURSES : ${CURSES}")
message(STATUS "SOUND : ${SOUND}")
message(STATUS "BACKTRACE : ${BACKTRACE}")
message(STATUS "LOCALIZE : ${LOCALIZE}")
message(STATUS "USE_HOME_DIR : ${USE_HOME_DIR}")
message(STATUS "LANGUAGES : ${LANGUAGES}")
message(STATUS "See doc/COMPILING/COMPILING-CMAKE.md for details and more info --")
MESSAGE(STATUS "GIT_BINARY : ${GIT_EXECUTABLE}")
MESSAGE(STATUS "DYNAMIC_LINKING : ${DYNAMIC_LINKING}")
MESSAGE(STATUS "TILES : ${TILES}")
MESSAGE(STATUS "CURSES : ${CURSES}")
MESSAGE(STATUS "SOUND : ${SOUND}")
MESSAGE(STATUS "BACKTRACE : ${BACKTRACE}")
MESSAGE(STATUS "LOCALIZE : ${LOCALIZE}")
MESSAGE(STATUS "USE_HOME_DIR : ${USE_HOME_DIR}\n")
if (NOT MSVC)
set(CATA_WARNINGS
"-Werror -Wall -Wextra \
-Wformat-signedness \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Woverloaded-virtual \
-Wpedantic \
-Wsuggest-override \
-Wunused-macros \
-Wzero-as-null-pointer-constant")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CATA_WARNINGS "${CATA_WARNINGS} -Wno-unknown-warning-option")
MESSAGE(STATUS "LANGUAGES : ${LANGUAGES}\n")
MESSAGE(STATUS "See INSTALL file for details and more info --\n")
IF(MSVC)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D_AMD64_)
else()
set(CATA_WARNINGS "${CATA_WARNINGS} -Wno-unknown-warning")
add_definitions(-D_X86_)
endif()
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
set(CATA_WARNINGS "${CATA_WARNINGS} -Wredundant-decls")
endif ()
set(CATA_OTHER_FLAGS "${CATA_OTHER_FLAGS} -fsigned-char")
ELSE()
SET(CATA_WARNINGS
"-Werror -Wall -Wextra \
-Wformat-signedness \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Woverloaded-virtual \
-Wpedantic \
-Wsuggest-override \
-Wunused-macros \
-Wzero-as-null-pointer-constant \
-Wno-unknown-warning-option")
IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES Windows)
SET(CATA_WARNINGS "${CATA_WARNINGS} -Wredundant-decls")
ENDIF()
# Compact the whitespace in the warning string
string(REGEX REPLACE "[\t ]+" " " CATA_WARNINGS "${CATA_WARNINGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS} ${CATA_OTHER_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
endif ()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
ENDIF()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
SET(CMAKE_CXX_STANDARD 14)
# Force out-of-source build
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR
"This project requires an out of source build. \
Remove the file 'CMakeCache.txt' found in this directory before continuing; \
create a separate build directory and run 'cmake [options] <srcs>' from there. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
MESSAGE(FATAL_ERROR
"This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, create a separate build
directory and run 'cmake [options] <srcs>' from there.\nSee INSTALL file for details and more info\n"
)
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
#set(THREADS_USE_PTHREADS_WIN32 True)
set(CMAKE_THREAD_PREFER_PTHREAD True)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
#SET(THREADS_USE_PTHREADS_WIN32 True)
SET(CMAKE_THREAD_PREFER_PTHREAD True)
FIND_PACKAGE(Threads REQUIRED)
# Check for build types and libraries
if (TILES)
IF(TILES)
# Find SDL, SDL_ttf & SDL_image for graphical install
message(STATUS "Searching for SDL2 library --")
find_package(SDL2)
if (NOT (SDL2_FOUND OR TARGET SDL2::SDL2))
message(FATAL_ERROR
"This project requires SDL2 to be installed to compile in graphical mode. \
Please install the SDL2 development libraries, \
or try compiling without -DTILES=1 for a text-only compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
MESSAGE(STATUS "Searching for SDL2 library --")
FIND_PACKAGE(SDL2)
IF(NOT SDL2_FOUND)
MESSAGE(FATAL_ERROR
"This project requires SDL2 to be installed to be compiled in graphical mode. Please install the SDL2 development libraries, or try compiling
without the -DTILES=1 for a text only compilation.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT SDL2_FOUND)
if (NOT DYNAMIC_LINKING)
# SDL, SDL_Image, SDL_ttf deps are required for static build
message(STATUS "Searching for SDL deps libraries --")
find_package(Freetype REQUIRED)
find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
endif ()
IF (NOT DYNAMIC_LINKING)
# SDL, SDL_Image, SDL_ttf deps are required for static build
MESSAGE(STATUS "Searching for SDL deps libraries --")
FIND_PACKAGE(Freetype REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(BZip2 REQUIRED)
ENDIF (NOT DYNAMIC_LINKING)
message(STATUS "Searching for SDL2_TTF library --")
if (NOT VCPKG_MANIFEST_MODE)
find_package(SDL2_ttf)
else()
find_package(sdl2-ttf)
endif()
if (NOT (SDL2_TTF_FOUND OR TARGET SDL2::SDL2_ttf OR TARGET SDL2::SDL2_ttf-static))
message(FATAL_ERROR
"This project requires SDL2_ttf to be installed to compile in graphical mode. \
Please install the SDL2_ttf development libraries, \
or try compiling without -DTILES=1 for a text-only compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
MESSAGE(STATUS "Searching for SDL2_TTF library --")
FIND_PACKAGE(SDL2_ttf)
IF(NOT SDL2_TTF_FOUND)
MESSAGE(FATAL_ERROR
"This project requires SDL2_ttf to be installed to be compiled in graphical mode. Please install the SDL2_ttf development libraries, or try
compiling without the -DTILES=1 for a text only compilation.\nSee INSTALL file for details and moreinfo\n"
)
ENDIF(NOT SDL2_TTF_FOUND)
message(STATUS "Searching for SDL2_image library --")
if(VCPKG_MANIFEST_MODE)
find_package(sdl2-image)
else()
find_package(SDL2_image)
endif()
if (NOT (SDL2_IMAGE_FOUND OR TARGET SDL2::SDL2_image))
message(FATAL_ERROR
"This project requires SDL2_image to be installed to compile in graphical mode. \
Please install the SDL2_image development libraries, \
or try compiling without -DTILES=1 for a text-only compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
add_definitions(-DTILES)
endif ()
MESSAGE(STATUS "Searching for SDL2_image library --\n")
FIND_PACKAGE(SDL2_image)
IF(NOT SDL2_IMAGE_FOUND)
MESSAGE(FATAL_ERROR
"This project requires SDL2_image to be installed to be compiled in graphical mode. Please install the SDL2_image development libraries, or try
compiling without the -DTILES=1 for a text only compilation.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT SDL2_IMAGE_FOUND)
ADD_DEFINITIONS(-DTILES)
ENDIF(TILES)
if (CURSES)
IF(CURSES)
# Find the ncurses library for a text based compile
message(STATUS "Searching for Curses library --")
set(CURSES_NEED_NCURSES TRUE)
set(CURSES_NEED_WIDE TRUE)
find_package(Curses)
if (NOT CURSES_FOUND)
message(FATAL_ERROR
"This project requires ncurses to be installed to be compiled in text-only mode. \
Please install the ncurses development libraries, \
or try compiling with -DTILES=1 for a graphical compilation. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info")
endif ()
if (NOT DYNAMIC_LINKING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNCURSES_STATIC")
endif ()
endif ()
MESSAGE(STATUS "Searching for Curses library --\n")
SET(CURSES_NEED_NCURSES TRUE)
SET(CURSES_NEED_WIDE TRUE)
FIND_PACKAGE(Curses)
IF(NOT CURSES_FOUND)
MESSAGE(FATAL_ERROR
"This project requires ncurses to be installed to be compiled in text only mode. Please install the ncurses development libraries, or try compiling
with the -DTILES=1 for a graphical compilation.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT CURSES_FOUND)
ENDIF(CURSES)
if (SOUND)
IF(SOUND)
# You need TILES to be able to use SOUND
if (NOT TILES)
message(FATAL_ERROR
"You must enable graphical support with -DTILES=1 \
to be able to enable sound support. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif ()
IF(NOT TILES)
MESSAGE(FATAL_ERROR
"You must enable graphical support with -DTILES=1 to be able to enable sound support.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT TILES)
# Sound requires SDL_mixer library
if(VCPKG_MANIFEST_MODE)
message(STATUS "Searching for sdl2-mixer library --")
find_package(sdl2-mixer)
if (NOT TARGET SDL2::SDL2_mixer)
message(FATAL_ERROR
"You need the sdl2-mixer development library \
to be able to compile with sound enabled. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif()
else()
message(STATUS "Searching for SDL2_mixer library --")
find_package(SDL2_mixer)
# if (NOT TARGET SDL2_mixer::SDL2_mixer-static) # TODO x64-mingw-static ?
if (NOT SDL2_MIXER_FOUND)
message(FATAL_ERROR
"You need the SDL2_mixer development library \
to be able to compile with sound enabled. \
See doc/COMPILING/COMPILING-CMAKE.md for details and more info.")
endif()
endif()
endif ()
MESSAGE(STATUS "Searching for SDL2_mixer library --\n")
FIND_PACKAGE(SDL2_mixer)
IF(NOT SDL2_MIXER_FOUND)
MESSAGE(FATAL_ERROR
"You need the SDL2_mixer development library to be able to compile with sound enabled.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT SDL2_MIXER_FOUND)
ENDIF(SOUND)
if (BACKTRACE)
add_definitions(-DBACKTRACE)
if (LIBBACKTRACE)
add_definitions(-DLIBBACKTRACE)
endif ()
endif ()
if ((LOCALIZE OR BUILD_TESTING) AND "${GETTEXT_MSGFMT_BINARY}" STREQUAL "")
if(MSVC)
list(APPEND Gettext_ROOT C:\\msys64\\usr)
list(APPEND Gettext_ROOT C:\\Program\ Files\\Git\\usr)
endif(MSVC)
find_package(Gettext)
endif ()
if (NOT GETTEXT_MSGFMT_EXECUTABLE )
set(GETTEXT_MSGFMT_EXECUTABLE "${GETTEXT_MSGFMT_BINARY}")
endif()
IF(BACKTRACE)
ADD_DEFINITIONS(-DBACKTRACE)
IF(LIBBACKTRACE)
ADD_DEFINITIONS(-DLIBBACKTRACE)
ENDIF(LIBBACKTRACE)
ENDIF(BACKTRACE)
# Ok. Now create build and install recipes
if (LOCALIZE)
IF(LOCALIZE)
IF(WIN32)
FIND_PACKAGE(Libintl)
IF(NOT LIBINTL_FOUND)
MESSAGE(FATAL_ERROR
"You need the libintl development library to be able to compile with Localize support.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT LIBINTL_FOUND)
FIND_PACKAGE(Iconv)
IF(NOT ICONV_FOUND)
MESSAGE(FATAL_ERROr
"You need the iconv development library to be able to compile with Localize support.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT ICONV_FOUND)
ENDIF(WIN32)
add_subdirectory(lang)
add_definitions(-DLOCALIZE)
endif ()
ADD_DEFINITIONS(-DLOCALIZE)
ENDIF(LOCALIZE)
if (USE_HOME_DIR)
add_definitions(-DUSE_HOME_DIR)
endif ()
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND AND CATA_CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ccache)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
set(CMAKE_C_LINKER_LAUNCHER ccache)
set(CMAKE_CXX_LINKER_LAUNCHER ccache)
endif ()
IF(USE_HOME_DIR)
ADD_DEFINITIONS(-DUSE_HOME_DIR)
ENDIF(USE_HOME_DIR)
add_subdirectory(src)
add_subdirectory(data)
if (NOT MSVC)
add_subdirectory(src/chkjson)
endif()
if(TESTS)
add_subdirectory(tests)
endif()
add_subdirectory(tests)
if (JSON_FORMAT)
add_subdirectory(tools/format)
endif()
if (CATA_CLANG_TIDY_PLUGIN OR CATA_CLANG_TIDY_EXECUTABLE)
if (CATA_CLANG_TIDY_PLUGIN)
add_subdirectory(tools/clang-tidy-plugin)
endif()
install(DIRECTORY doc gfx
DESTINATION ${DATA_PREFIX}
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
if (RELEASE)
install(FILES
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/LICENSE.txt
${CMAKE_SOURCE_DIR}/LICENSE-OFL-Terminus-Font.txt
${CMAKE_SOURCE_DIR}/VERSION.txt
DESTINATION ${README_DIR})
if (TILES)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/gfx DESTINATION ${DATA_PREFIX})
endif()
endif()
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
# vim:noet
+160
View File
@@ -0,0 +1,160 @@
#.rst:
# CMakeParseArguments
# -------------------
#
#
#
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
# <multi_value_keywords> args...)
#
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions
# for parsing the arguments given to that macro or function. It
# processes the arguments and defines a set of variables which hold the
# values of the respective options.
#
# The <options> argument contains all options for the respective macro,
# i.e. keywords which can be used when calling the macro without any
# value following, like e.g. the OPTIONAL keyword of the install()
# command.
#
# The <one_value_keywords> argument contains all keywords for this macro
# which are followed by one value, like e.g. DESTINATION keyword of the
# install() command.
#
# The <multi_value_keywords> argument contains all keywords for this
# macro which can be followed by more than one value, like e.g. the
# TARGETS or FILES keywords of the install() command.
#
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
# keywords listed in <options>, <one_value_keywords> and
# <multi_value_keywords> a variable composed of the given <prefix>
# followed by "_" and the name of the respective keyword. These
# variables will then hold the respective value from the argument list.
# For the <options> keywords this will be TRUE or FALSE.
#
# All remaining arguments are collected in a variable
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
# whether your macro was called with unrecognized parameters.
#
# As an example here a my_install() macro, which takes similar arguments
# as the real install() command:
#
# ::
#
# function(MY_INSTALL)
# set(options OPTIONAL FAST)
# set(oneValueArgs DESTINATION RENAME)
# set(multiValueArgs TARGETS CONFIGURATIONS)
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# ...
#
#
#
# Assume my_install() has been called like this:
#
# ::
#
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
#
#
#
# After the cmake_parse_arguments() call the macro will have set the
# following variables:
#
# ::
#
# MY_INSTALL_OPTIONAL = TRUE
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
# MY_INSTALL_DESTINATION = "bin"
# MY_INSTALL_RENAME = "" (was not used)
# MY_INSTALL_TARGETS = "foo;bar"
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
#
#
#
# You can then continue and process these variables.
#
# Keywords terminate lists of values, e.g. if directly after a
# one_value_keyword another recognized keyword follows, this is
# interpreted as the beginning of the new option. E.g.
# my_install(TARGETS foo DESTINATION OPTIONAL) would result in
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION
# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
#=============================================================================
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
return()
endif()
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach()
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach()
set(${prefix}_UNPARSED_ARGUMENTS)
set(insideValues FALSE)
set(currentArgName)
# now iterate over all arguments and fill the result variables
foreach(currentArg ${ARGN})
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
if(insideValues)
if("${insideValues}" STREQUAL "SINGLE")
set(${prefix}_${currentArgName} ${currentArg})
set(insideValues FALSE)
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
else()
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif()
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
set(insideValues FALSE)
elseif(NOT ${singleArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "SINGLE")
elseif(NOT ${multiArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "MULTI")
endif()
endif()
endforeach()
# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach()
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction()
+78
View File
@@ -0,0 +1,78 @@
#.rst:
# CheckLibraryExists
# ------------------
#
# Check if the function exists.
#
# CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
#
# ::
#
# LIBRARY - the name of the library you are looking for
# FUNCTION - the name of the function
# LOCATION - location where the library should be found
# VARIABLE - variable to store the result
#
#
#
# The following variables may be set before calling this macro to modify
# the way the check is run:
#
# ::
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
if(${VARIABLE} MATCHES "^${VARIABLE}$")
set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
endif()
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION}
-DLINK_DIRECTORIES:STRING=${LOCATION}
OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE})
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"passed with the following output:\n"
"${OUTPUT}\n\n")
else()
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"failed with the following output:\n"
"${OUTPUT}\n\n")
endif()
endif()
endmacro()
+198
View File
@@ -0,0 +1,198 @@
#.rst:
# FindCurses
# ----------
#
# Find the curses include file and library
#
#
#
# ::
#
# CURSES_FOUND - system has Curses
# CURSES_INCLUDE_DIR - the Curses include directory
# CURSES_LIBRARIES - The libraries needed to use Curses
# CURSES_HAVE_CURSES_H - true if curses.h is available
# CURSES_HAVE_NCURSES_H - true if ncurses.h is available
# CURSES_HAVE_NCURSES_NCURSES_H - true if ncurses/ncurses.h is available
# CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
# CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
#
#
#
# Set CURSES_NEED_NCURSES to TRUE before the find_package() command if
# NCurses functionality is required.
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_library(CURSES_CURSES_LIBRARY NAMES curses )
find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
set(CURSES_USE_NCURSES FALSE)
if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES))
set(CURSES_USE_NCURSES TRUE)
endif()
# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
# cygwin ncurses stopped providing curses.h symlinks see above
# message. Cygwin is an ncurses package, so force ncurses on
# cygwin if the curses.h is missing
if(CYGWIN)
if(NOT EXISTS /usr/include/curses.h)
set(CURSES_USE_NCURSES TRUE)
endif()
endif()
# Not sure the logic is correct here.
# If NCurses is required, use the function wsyncup() to check if the library
# has NCurses functionality (at least this is where it breaks on NetBSD).
# If wsyncup is in curses, use this one.
# If not, try to find ncurses and check if this has the symbol.
# Once the ncurses library is found, search the ncurses.h header first, but
# some web pages also say that even with ncurses there is not always a ncurses.h:
# http://osdir.com/ml/gnome.apps.mc.devel/2002-06/msg00029.html
# So at first try ncurses.h, if not found, try to find curses.h under the same
# prefix as the library was found, if still not found, try curses.h with the
# default search paths.
if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
if( CURSES_NCURSES_HAS_WSYNCUP)
set(CURSES_USE_NCURSES TRUE)
endif()
endif()
endif()
if(NOT CURSES_USE_NCURSES)
find_file(CURSES_HAVE_CURSES_H curses.h )
find_path(CURSES_CURSES_H_PATH curses.h )
get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload a cache wqith these variables set
set(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
CACHE FILEPATH "The curses include path")
set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
CACHE FILEPATH "The curses library")
else()
# we need to find ncurses
get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
find_file(CURSES_HAVE_NCURSES_H ncurses.h)
find_file(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
find_file(CURSES_HAVE_NCURSES_CURSES_H ncurses/curses.h)
find_file(CURSES_HAVE_CURSES_H curses.h
HINTS "${_cursesParentDir}/include")
find_path(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
ncurses/curses.h)
find_path(CURSES_NCURSES_INCLUDE_PATH curses.h
HINTS "${_cursesParentDir}/include")
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload
# however if the value of the variable has NOTFOUND in it, then
# it is OK to force, and we need to force in order to have it work.
# a cache wqith these variables set
# only put ncurses include and library into
# variables if they are found
if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
get_filename_component(CURSES_NCURSES_INCLUDE_PATH
"${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
endif()
if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
set( FORCE_IT )
if(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
set(FORCE_IT FORCE)
endif()
set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
CACHE FILEPATH "The curses include path" ${FORCE_IT})
set( FORCE_IT)
if(CURSES_LIBRARY MATCHES NOTFOUND)
set(FORCE_IT FORCE)
endif()
set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
CACHE FILEPATH "The curses library" ${FORCE_IT})
endif()
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
cbreak "" CURSES_NCURSES_HAS_CBREAK)
if(NOT CURSES_NCURSES_HAS_CBREAK)
find_library(CURSES_EXTRA_LIBRARY tinfo HINTS "${_cursesLibDir}")
find_library(CURSES_EXTRA_LIBRARY tinfo )
CHECK_LIBRARY_EXISTS("${CURSES_EXTRA_LIBRARY}"
cbreak "" CURSES_TINFO_HAS_CBREAK)
endif()
endif()
if (NOT CURSES_TINFO_HAS_CBREAK)
find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
find_library(CURSES_EXTRA_LIBRARY cur_colr )
endif()
find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
find_library(CURSES_FORM_LIBRARY form )
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload a cache
# qith these variables set
set(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
CACHE FILEPATH "The curses form library")
# Need to provide the *_LIBRARIES
set(CURSES_LIBRARIES ${CURSES_LIBRARY})
if(CURSES_EXTRA_LIBRARY)
set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
endif()
if(CURSES_FORM_LIBRARY)
set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
endif()
# Proper name is *_INCLUDE_DIR
set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
CURSES_LIBRARY CURSES_INCLUDE_PATH)
mark_as_advanced(
CURSES_INCLUDE_PATH
CURSES_LIBRARY
CURSES_CURSES_INCLUDE_PATH
CURSES_CURSES_LIBRARY
CURSES_NCURSES_INCLUDE_PATH
CURSES_NCURSES_LIBRARY
CURSES_EXTRA_LIBRARY
FORM_LIBRARY
CURSES_LIBRARIES
CURSES_INCLUDE_DIR
CURSES_CURSES_HAS_WSYNCUP
CURSES_NCURSES_HAS_WSYNCUP
CURSES_NCURSES_HAS_CBREAK
CURSES_TINFO_HAS_CBREAK
)
@@ -0,0 +1,351 @@
#.rst:
# FindPackageHandleStandardArgs
# -----------------------------
#
#
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
#
# This function is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED, QUIET and version-related arguments to
# find_package(). It also sets the <packagename>_FOUND variable. The
# package is considered found if all variables <var1>... listed contain
# valid results, e.g. valid filepaths.
#
# There are two modes of this function. The first argument in both
# modes is the name of the Find-module where it is called (in original
# casing).
#
# The first simple mode looks like this:
#
# ::
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
#
# If the variables <var1> to <varN> are all valid, then
# <UPPERCASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given
# as second argument, then the function will generate itself useful
# success and error messages. You can also supply a custom error
# message for the failure case. This is not recommended.
#
# The second mode is more powerful and also supports version checking:
#
# ::
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>]
# [REQUIRED_VARS <var1>...<varN>]
# [VERSION_VAR <versionvar>]
# [HANDLE_COMPONENTS]
# [CONFIG_MODE]
# [FAIL_MESSAGE "Custom failure message"] )
#
#
#
# In this mode, the name of the result-variable can be set either to
# either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the
# FOUND_VAR option. Other names for the result-variable are not
# allowed. So for a Find-module named FindFooBar.cmake, the two
# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended
# to use the original case version. If the FOUND_VAR option is not
# used, the default is <UPPERCASED_NAME>_FOUND.
#
# As in the simple mode, if <var1> through <varN> are all valid,
# <packagename>_FOUND will be set to TRUE. After REQUIRED_VARS the
# variables which are required for this package are listed. Following
# VERSION_VAR the name of the variable can be specified which holds the
# version of the package which has been found. If this is done, this
# version will be checked against the (potentially) specified required
# version used in the find_package() call. The EXACT keyword is also
# handled. The default messages include information about the required
# version and the version which has been actually found, both if the
# version is ok or not. If the package supports components, use the
# HANDLE_COMPONENTS option to enable handling them. In this case,
# find_package_handle_standard_args() will report which components have
# been found and which are missing, and the <packagename>_FOUND variable
# will be set to FALSE if any of the required components (i.e. not the
# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option
# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a
# find_package(... NO_MODULE) call. In this case VERSION_VAR will be
# set to <NAME>_VERSION and the macro will automatically check whether
# the Config module was found. Via FAIL_MESSAGE a custom failure
# message can be specified, if this is not used, the default message
# will be displayed.
#
# Example for mode 1:
#
# ::
#
# find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
#
#
#
# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to
# TRUE. If it is not found and REQUIRED was used, it fails with
# FATAL_ERROR, independent whether QUIET was used or not. If it is
# found, success will be reported, including the content of <var1>. On
# repeated Cmake runs, the same message won't be printed again.
#
# Example for mode 2:
#
# ::
#
# find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND
# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
# VERSION_VAR LibXslt_VERSION_STRING)
#
# In this case, LibXslt is considered to be found if the variable(s)
# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and
# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in
# LibXslt_FOUND . Also the version of LibXslt will be checked by using
# the version contained in LibXslt_VERSION_STRING. Since no
# FAIL_MESSAGE is given, the default messages will be printed.
#
# Another example for mode 2:
#
# ::
#
# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
# find_package_handle_standard_args(Automoc4 CONFIG_MODE)
#
# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4
# NO_MODULE) and adds an additional search directory for automoc4. Here
# the result will be stored in AUTOMOC4_FOUND. The following
# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
# success/error message.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_msg}")
else ()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_msg}")
endif ()
endif ()
endmacro()
# internal helper macro to generate the failure message when used in CONFIG_MODE:
macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
if(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
else()
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
if(${_NAME}_CONSIDERED_CONFIGS)
set(configsText "")
list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
math(EXPR configsCount "${configsCount} - 1")
foreach(currentConfigIndex RANGE ${configsCount})
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
set(configsText "${configsText} ${filename} (version ${version})\n")
endforeach()
if (${_NAME}_NOT_FOUND_MESSAGE)
set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
endif()
endif()
endmacro()
function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
# new extended or in the "old" mode:
set(options CONFIG_MODE HANDLE_COMPONENTS)
set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
set(multiValueArgs REQUIRED_VARS)
set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
if(${INDEX} EQUAL -1)
set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
set(FPHSA_REQUIRED_VARS ${ARGN})
set(FPHSA_VERSION_VAR)
else()
CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
if(FPHSA_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT FPHSA_FAIL_MESSAGE)
set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
endif()
endif()
# now that we collected all arguments, process them
if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
endif()
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
if(FPHSA_CONFIG_MODE)
list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
endif()
if(NOT FPHSA_REQUIRED_VARS)
message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
endif()
list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
string(TOUPPER ${_NAME} _NAME_UPPER)
string(TOLOWER ${_NAME} _NAME_LOWER)
if(FPHSA_FOUND_VAR)
if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
set(_FOUND_VAR ${FPHSA_FOUND_VAR})
else()
message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
endif()
else()
set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
endif()
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
set(MISSING_VARS "")
set(DETAILS "")
# check if all passed variables are valid
unset(${_FOUND_VAR})
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR})
set(${_FOUND_VAR} FALSE)
set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
else()
set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
endif()
endforeach()
if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE")
set(${_FOUND_VAR} TRUE)
endif()
# component handling
unset(FOUND_COMPONENTS_MSG)
unset(MISSING_COMPONENTS_MSG)
if(FPHSA_HANDLE_COMPONENTS)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(${_NAME}_${comp}_FOUND)
if(NOT DEFINED FOUND_COMPONENTS_MSG)
set(FOUND_COMPONENTS_MSG "found components: ")
endif()
set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
else()
if(NOT DEFINED MISSING_COMPONENTS_MSG)
set(MISSING_COMPONENTS_MSG "missing components: ")
endif()
set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_FOUND_VAR} FALSE)
set(MISSING_VARS "${MISSING_VARS} ${comp}")
endif()
endif()
endforeach()
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
endif()
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
set(VERSION ${${FPHSA_VERSION_VAR}} )
if (${_NAME}_FIND_VERSION)
if(VERSION)
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
endif ()
else() # minimum version specified:
if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
endif ()
endif()
else()
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
else()
set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
endif()
endif()
else ()
if(VERSION)
set(VERSION_MSG "(found version \"${VERSION}\")")
endif()
endif ()
if(VERSION_OK)
set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
else()
set(${_FOUND_VAR} FALSE)
endif()
# print the result:
if (${_FOUND_VAR})
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
else ()
if(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
else()
if(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
else()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
endif()
endif()
endif ()
set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE)
endfunction()
+57
View File
@@ -0,0 +1,57 @@
#.rst:
# FindPackageMessage
# ------------------
#
#
#
# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
#
# This macro is intended to be used in FindXXX.cmake modules files. It
# will print a message once for each unique find result. This is useful
# for telling the user where a package was found. The first argument
# specifies the name (XXX) of the package. The second argument
# specifies the message to display. The third argument lists details
# about the find result so that if they change the message will be
# displayed again. The macro also obeys the QUIET argument to the
# find_package command.
#
# Example:
#
# ::
#
# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
# else()
# ...
# endif()
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REGEX REPLACE "[\n]" "" details "${details}")
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
endif()
endif()
endfunction()
@@ -16,7 +16,7 @@
#
#
#
# For backward compatibility the following variables are also set:
# For backward compatiblity the following variables are also set:
#
# ::
#
@@ -89,7 +89,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image
REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS
VERSION_VAR SDL2_IMAGE_VERSION_STRING)
# for backward compatibility
# for backward compatiblity
set(SDL2IMAGE_LIBRARY ${SDL2_IMAGE_LIBRARIES})
set(SDL2IMAGE_INCLUDE_DIR ${SDL2_IMAGE_INCLUDE_DIRS})
set(SDL2IMAGE_FOUND ${SDL2_IMAGE_FOUND})
@@ -16,7 +16,7 @@
#
#
#
# For backward compatibility the following variables are also set:
# For backward compatiblity the following variables are also set:
#
# ::
#
@@ -89,7 +89,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer
REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS
VERSION_VAR SDL2_MIXER_VERSION_STRING)
# for backward compatibility
# for backward compatiblity
set(SDL2MIXER_LIBRARY ${SDL2_MIXER_LIBRARIES})
set(SDL2MIXER_INCLUDE_DIR ${SDL2_MIXER_INCLUDE_DIRS})
set(SDL2MIXER_FOUND ${SDL2_MIXER_FOUND})
@@ -15,7 +15,7 @@
#
#
#
# For backward compatibility the following variables are also set:
# For backward compatiblity the following variables are also set:
#
# ::
#
@@ -88,7 +88,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
VERSION_VAR SDL2_TTF_VERSION_STRING)
# for backward compatibility
# for backward compatiblity
set(SDL2TTF_LIBRARY ${SDL2_TTF_LIBRARIES})
set(SDL2TTF_INCLUDE_DIR ${SDL2_TTF_INCLUDE_DIRS})
set(SDL2TTF_FOUND ${SDL2_TTF_FOUND})
-71
View File
@@ -1,71 +0,0 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"description": "Base Build Configuration",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"hidden": true
},
{
"name": "windows",
"description": "Windows Build Configuration",
"condition": {
"type": "allOf",
"conditions": [
{
"type": "equals",
"lhs": "$env{MSYSTEM}",
"rhs": ""
},
{
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
]
},
"cacheVariables": {
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/build-scripts"
},
"hidden": true
},
{
"name": "MSVC",
"inherits": [ "windows" ],
"description": "Visual C++ Configuration",
"toolchainFile": "${sourceDir}/build-scripts/MSVC.cmake",
"cacheVariables": {
"VCPKG_ROOT": "C:/vcpkg"
},
"hidden": true
},
{
"name": "x64-windows-static",
"inherits": [ "base", "MSVC" ],
"description": "Link Statically",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"DYNAMIC_LINKING": "False"
},
"hidden": true
},
{
"name": "windows-tiles-sounds-x64-msvc",
"inherits": [ "x64-windows-static" ],
"displayName": "Windows Tiles Sounds x64 MSVC",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
"cacheVariables": {
"CMAKE_PROJECT_INCLUDE_BEFORE": "${sourceDir}/build-scripts/windows-tiles-sounds-x64-msvc.cmake",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"RELEASE": "True",
"CURSES": "False",
"LOCALIZE": "True",
"TILES": "True",
"SOUND": "True",
"TESTS": "False"
}
}
]
}
+297
View File
@@ -0,0 +1,297 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Cataclysm" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Release">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os -O2" />
<Add option="-DRELEASE=1" />
</Compiler>
</Target>
<Target title="Release (Localized)">
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/ReleaseLocalized/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os -O2" />
<Add option="-DLOCALIZE" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend/include" />
</Compiler>
<Linker>
<Add library="libintl.dll.a" />
<Add library="libiconv.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Release (SDL)">
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/ReleaseSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os -O2" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Release (SDL, Sound)">
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/ReleaseSoundSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os -O2" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DSDL_SOUND" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add library="libSDL2_mixer.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Release (SDL, Localized)">
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/ReleaseLocalizedSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os -O2" />
<Add option="-DLOCALIZE" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add library="libintl.dll.a" />
<Add library="libiconv.dll.a" />
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Release (SDL, Loc, Sound)">
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/ReleaseLocalizedSoundSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-Os -O2" />
<Add option="-DLOCALIZE" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DSDL_SOUND" />
<Add option="-DRELEASE=1" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add library="libintl.dll.a" />
<Add library="libiconv.dll.a" />
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add library="libSDL2_mixer.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Debug">
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg -g" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
</Linker>
</Target>
<Target title="Debug (Localized)">
<Option output="CataclysmWin" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/DebugLocalized/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg -g" />
<Add option="-DLOCALIZE" />
<Add directory="WinDepend/include" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="libintl.dll.a" />
<Add library="libiconv.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Debug (SDL)">
<Option output="CataclysmWin-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/DebugSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-pg -g" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Debug (SDL, Sound)">
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/DebugSoundSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-pg -g" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DSDL_SOUND" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add library="libSDL2_mixer.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Debug (SDL, Localized)">
<Option output="CataclysmWin-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/DebugLocalizedSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-pg -g" />
<Add option="-DLOCALIZE" />
<Add option="-DSDLTILES" />
<Add option="-DTILES" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="libintl.dll.a" />
<Add library="libiconv.dll.a" />
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
<Target title="Debug (SDL, Loc, Sound)">
<Option output="Cataclysm-Tiles" prefix_auto="0" extension_auto="1" />
<Option object_output="obj/DebugLocalizedSoundSDL/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-pg -g" />
<Add option="-DLOCALIZE" />
<Add option="-DTILES" />
<Add option="-DSDLTILES" />
<Add option="-DSDL_SOUND" />
<Add directory="WinDepend/include" />
<Add directory="WinDepend/include/SDL2" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add library="libintl.dll.a" />
<Add library="libiconv.dll.a" />
<Add library="libSDL2.dll.a" />
<Add library="libSDL2main.a" />
<Add library="libSDL2_ttf.dll.a" />
<Add library="libSDL2_image.dll.a" />
<Add library="libSDL2_mixer.dll.a" />
<Add directory="WinDepend/lib" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wextra" />
<Add option="-Wall" />
<Add option="-std=c++14" />
<Add option="-DCB_BUILD" />
<Add option="-D_WINDOWS -D_MINGW -D_WIN32 -DWIN32 -D__MINGW__" />
</Compiler>
<Linker>
<Add option="-Wl,-stack,12000000,-subsystem,windows" />
<Add option="-static" />
<Add library="gdi32" />
<Add library="winmm" />
</Linker>
<ExtraCommands>
<Add before="cmd /c git --version || echo &apos;git&apos; command not found!" />
<Add before="cmd /c git describe --tags --always --dirty &gt; version.tmp || echo no-git&gt; version.tmp" />
<Add before='cmd /c for /F &quot;tokens=*&quot; %%i in (version.tmp) do echo #define VERSION &quot;%%i&quot; &gt; src/version.h' />
<Add before="cmd /c del version.tmp" />
<Mode after="always" />
</ExtraCommands>
<UnitsGlob directory="src" recursive="0" />
<Unit filename="src/resource.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Extensions>
<code_completion />
<debugger />
<envvars />
<DoxyBlocks>
<comment_style block="0" line="0" />
<doxyfile_project />
<doxyfile_build />
<doxyfile_warnings />
<doxyfile_output />
<doxyfile_dot />
<general />
</DoxyBlocks>
</Extensions>
</Project>
</CodeBlocks_project_file>
-6
View File
@@ -1,12 +1,6 @@
Copyright (c) 2019 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".
Copyright (c) 2017 tisimst
with Reserved Font Name "Vecterminus"
Copyright (c) 2011 Tilman Blumenbach,
with Reserved Font Name "Terminus (TTF)".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
+3 -5
View File
@@ -1,19 +1,17 @@
Cataclysm is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
GNU Unifont (data/font/unifont.ttf) is licensed under GNU General Public License v2+ with the GNU font embedding exception. Visit http://unifoundry.com/LICENSE.txt for details.
The Square font (data/font/square.ttf) is copyright Wouter van Oortmerssen, licensed under Creative Commons Attribution 3.0 Unported License. See http://strlen.com/square for more information.
GNU Unifont (data/font/unitfont.ttf) is licensed under GNU General Public License v2+ with the GNU font embedding exception. Visit http://unifoundry.com/LICENSE.txt for details.
Terminus Font (data/font/terminus.ttf) is licensed under the SIL Open Font License (see LICENSE-OFL-Terminus-Font.txt).
Vecterminus Font (data/font/VecTerminus12Medium.otf) is licensed under the SIL Open Font License (see LICENSE-OFL-Terminus-Font.txt).
CATCH unit-test framework (tests/catch/catch.hpp) is licensed under the Boost Software License. Visit https://github.com/philsquared/Catch/blob/master/LICENSE.txt to read the license.
PLF List and PLF Colony (src/list.h, src/colony.h) are licensed under the zLib license (https://www.zlib.net/zlib_license.html).
getpost (tools/json_tools/format/getpost.h) is licensed under the MIT license, see file for text of license.
gulrak filesystem (src/third-party/ghc/*) is licensed under the MIT license, see file for text of license.
libbacktrace is licensed under a BSD license (https://github.com/ianlancetaylor/libbacktrace/blob/master/LICENSE). The full license text is as follows:
# Copyright (C) 2012-2016 Free Software Foundation, Inc.
+208 -375
View File
File diff suppressed because it is too large Load Diff
+24 -31
View File
@@ -1,10 +1,16 @@
# Cataclysm: Dark Days Ahead
# Catalcysm: Dark Days Ahead
Cataclysm: Dark Days Ahead is a turn-based survival game set in a post-apocalyptic world. While some have described it as a "zombie game", there is far more to Cataclysm than that. Struggle to survive in a harsh, persistent, procedurally generated world. Scavenge the remnants of a dead civilization for food, equipment, or, if you are lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, who want what you have...
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. While some have described it as a "zombie game", there is far more to Cataclysm than that. Struggle to survive in a harsh, persistent, procedurally generated world. Scavenge the remnants of a dead civilization for food, equipment, or, if you are lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, who want what you have...
<p align="center">
<img src="./data/screenshots/ultica-showcase-sep-2021.png" alt="Tileset: Ultica">
</p>
<a href="https://repology.org/project/cataclysm-dda/versions">
<img src="https://repology.org/badge/vertical-allrepos/cataclysm-dda.svg" alt="Packaging Status" align="right">
</a>
[![Build Status](https://travis-ci.org/CleverRaven/Cataclysm-DDA.svg?branch=master)](https://travis-ci.org/CleverRaven/Cataclysm-DDA)
[![Coverage Status](https://coveralls.io/repos/github/CleverRaven/Cataclysm-DDA/badge.svg?branch=master)](https://coveralls.io/github/CleverRaven/Cataclysm-DDA?branch=master)
[![Open Source Helpers](https://www.codetriage.com/cleverraven/cataclysm-dda/badges/users.svg)](https://www.codetriage.com/cleverraven/cataclysm-dda)
[![Commit Activity](https://img.shields.io/github/commit-activity/m/CleverRaven/Cataclysm-DDA)](https://github.com/CleverRaven/Cataclysm-DDA/graphs/contributors)
[![Lines of Code](https://tokei.rs/b1/github/CleverRaven/Cataclysm-DDA?category=code)](https://github.com/XAMPPRocky/tokei)
## Downloads
@@ -12,34 +18,23 @@ Cataclysm: Dark Days Ahead is a turn-based survival game set in a post-apocalypt
**Source** - The source can be downloaded as a [.zip archive](https://github.com/CleverRaven/Cataclysm-DDA/archive/master.zip), or cloned from our [GitHub repo](https://github.com/CleverRaven/Cataclysm-DDA/).
<a href="https://repology.org/project/cataclysm-dda/versions">
<img src="https://repology.org/badge/vertical-allrepos/cataclysm-dda.svg" alt="Packaging Status" align="right">
</a>
[![General build matrix](https://github.com/CleverRaven/Cataclysm-DDA/actions/workflows/matrix.yml/badge.svg)](https://github.com/CleverRaven/Cataclysm-DDA/actions/workflows/matrix.yml)
[![Coverage Status](https://coveralls.io/repos/github/CleverRaven/Cataclysm-DDA/badge.svg?branch=master)](https://coveralls.io/github/CleverRaven/Cataclysm-DDA?branch=master)
[![Open Source Helpers](https://www.codetriage.com/cleverraven/cataclysm-dda/badges/users.svg)](https://www.codetriage.com/cleverraven/cataclysm-dda)
[![Commit Activity](https://img.shields.io/github/commit-activity/m/CleverRaven/Cataclysm-DDA)](https://github.com/CleverRaven/Cataclysm-DDA/graphs/contributors)
[![Lines of Code](https://tokei.rs/b1/github/CleverRaven/Cataclysm-DDA?category=code)](https://github.com/XAMPPRocky/tokei)
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/CleverRaven/Cataclysm-DDA)](https://www.tickgit.com/browse?repo=github.com/CleverRaven/Cataclysm-DDA)
### Packaging status
#### Arch Linux
Ncurses and tiles versions are available in the [community repo](https://www.archlinux.org/packages/?q=cataclysm-dda).
Ncurses and tiles version available in [community repo](https://www.archlinux.org/packages/?q=cataclysm-dda).
`sudo pacman -S cataclysm-dda`
#### Fedora
Ncurses and tiles versions are available in the [official repos](https://src.fedoraproject.org/rpms/cataclysm-dda).
Ncurses and tiles version available in [official repos](https://src.fedoraproject.org/rpms/cataclysm-dda).
`sudo dnf install cataclysm-dda`
#### Debian / Ubuntu
Ncurses and tiles versions are available in the [official repos](https://tracker.debian.org/pkg/cataclysm-dda).
Ncurses and tiles version available in [official repos](https://tracker.debian.org/pkg/cataclysm-dda).
`sudo apt install cataclysm-dda-curses cataclysm-dda-sdl`
@@ -54,19 +49,12 @@ We also have the following build guides:
## Contribute
Cataclysm: Dark Days Ahead is the result of contributions from over 1000 volunteers under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See https://creativecommons.org/licenses/by-sa/3.0/ for details.
Some code distributed with the project is not part of the project and is released under different software licenses; the files covered by different software licenses have their own license notices.
Cataclysm: Dark Days Ahead is the result of contributions from over 1000 volunteers under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
Some code distributed with the project is not part of the project and is released under different software licenses, the files covered by different software licenses have their own license notices.
[<img src="https://www.bountysource.com/badge/tracker?tracker_id=146201" alt="Bountysource" align="right">](https://www.bountysource.com/trackers/146201-clever-raven-cataclysm-dda?utm_source=146201&utm_medium=shield&utm_campaign=TRACKER_BADGE)
Please see [CONTRIBUTING.md](doc/CONTRIBUTING.md) for details.
Special thanks to the contributors, including but not limited to, people below:
<a href="https://github.com/cleverraven/cataclysm-dda/graphs/contributors">
<img src="https://contrib.rocks/image?repo=cleverraven/cataclysm-dda" />
</a>
Made with [contrib.rocks](https://contrib.rocks).
Please see [CONTRIBUTING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/.github/CONTRIBUTING.md) for details.
## Community
@@ -74,13 +62,14 @@ Forums:
https://discourse.cataclysmdda.org
Wiki:
https://cddawiki.chezzo.com/cdda_wiki/index.php
http://cddawiki.chezzo.com/cdda_wiki/index.php
GitHub repo:
https://github.com/CleverRaven/Cataclysm-DDA
IRC:
`#CataclysmDDA` on [Libera Chat](https://libera.chat), https://web.libera.chat/#CataclysmDDA
`irc.freenode.net` ; `#CataclysmDDA`
http://webchat.freenode.net/?channels=#CataclysmDDA
Official Discord:
https://discord.gg/jFEc7Yp
@@ -106,3 +95,7 @@ Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Catac
#### I would like to make a suggestion. What should I do?
Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Cataclysm-DDA/issues/) using [feature request template](https://github.com/CleverRaven/Cataclysm-DDA/issues/new?template=feature_request.md).
You can also submit your suggestions or vote for existing suggestions on [our FeatHub page](https://feathub.com/CleverRaven/Cataclysm-DDA). Most voted suggestions are:
[![Feature Requests](https://feathub.com/CleverRaven/Cataclysm-DDA?format=svg)](https://feathub.com/CleverRaven/Cataclysm-DDA)
-1
View File
@@ -63,4 +63,3 @@ Paul Bransford (draeath) <draeath@gmail.com>
Mark Langsdorf (mlangsdorf) <mark.langsdorf@gmail.com> / <mlangsdo@redhat.com>
Ratul Saha (sahaRatul) <ratul.saha@arrakis.in> / <50.ratulsaha@gmail.com>
Davis Bray (Kaltag1925) <pdavisbray@gmail.com>
Nicolas Appriou <nicolas.appriou@gmail.com>
+1 -2
View File
@@ -11,11 +11,10 @@
/app/jni/SDL2_image
/app/jni/SDL2_mixer
/app/jni/SDL2_ttf
/app/jni/libhidapi
/app/jni/libintl-lite
/app/jni/lua
/app/jni/mpg-123
/app/build
/app/src/main/assetsWinHost
/build
/captures
/local.properties
+44 -100
View File
@@ -99,11 +99,6 @@ if (localProperties.getProperty('override_ndkBuildAppPlatform') != null) {
override_ndkBuildAppPlatform = localProperties.getProperty("override_ndkBuildAppPlatform")
}
def override_ndkVersion = getProperty("override_ndkVersion")
if (localProperties.getProperty('override_ndkVersion') != null) {
override_ndkVersion = localProperties.getProperty('override_ndkVersion')
}
println("Using [ njobs]: $njobs")
println("Using [ localize]: $localize")
println("Using [ deps]: $deps")
@@ -113,7 +108,6 @@ println("Using [ compileSdkVersion]: $override_compileSdkVersion")
println("Using [ minSdkVersion]: $override_minSdkVersion")
println("Using [ targetSdkVersion]: $override_targetSdkVersion")
println("Using [ndkBuildAppPlatform]: $override_ndkBuildAppPlatform")
println("Using [ ndkVersion]: $override_ndkVersion")
println("Using [ abi_arm_32]: $abi_arm_32")
println("Using [ abi_arm_64]: $abi_arm_64")
println("Using [ abi_x86_32]: $abi_x86_32")
@@ -134,10 +128,6 @@ if (!override_version.isEmpty()) {
}
}
def projectRoot = './../..'
def assetsDir = 'src/main/assets'
def assetsDirWindows = 'src/main/assetsWinHost'
task unzipDeps(type: Copy) {
println("Using dependencies file: $deps")
def zipFile = new File("$deps")
@@ -147,100 +137,64 @@ task unzipDeps(type: Copy) {
}
task makeLocalization(type: Exec) {
def args = []
if (localize) {
println("Building with localization")
println("Building with localization'")
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
args = ['make', 'localization', 'LANGUAGES=all']
workingDir './../..'
commandLine 'make', 'localization', 'LANGUAGES=all'
break
case OperatingSystem.WINDOWS:
args = ['sh.exe', 'lang/compile_mo.sh']
workingDir './../..'
commandLine 'sh.exe', 'android/app/makelocalizations.sh'
break
default:
args = ['echo', 'Building without localization']
workingDir './../..'
commandLine 'echo', 'Building without localization'
break
}
} else {
args = ['echo', 'Building without localization']
if (OperatingSystem.current() == OperatingSystem.WINDOWS) {
args = ['cmd.exe', '/k'] + args
}
}
workingDir projectRoot
commandLine args
}
task generateVersionHeader() {
// this taks imitates `make version` while respecting version_header_path
if (override_version.isEmpty()) {
println("Generating version number to $version_header_path")
def output = new ByteArrayOutputStream()
exec {
workingDir projectRoot
commandLine 'git', 'describe', '--tags', '--always', '--dirty', '--match', '"[0-9A-Z]*.[0-9A-Z]*"'
standardOutput output
}
override_version = output.toString()
override_version = override_version.split()[0] // strip whitespaces
} else {
println("Overriding version number to $override_version")
}
def define = "// NOLINT(cata-header-guard)\n#define VERSION \"$override_version\"\n"
def versionHeader = new File("$version_header_path")
if (!versionHeader.exists() || versionHeader.text != define) {
versionHeader.text = define
}
}
task createWindowsJunctionLinks() {
onlyIf {
OperatingSystem.current() == OperatingSystem.WINDOWS
}
doLast {
def mkJunction = { to, from ->
def errOut = new ByteArrayOutputStream()
exec {
commandLine 'cmd', '/k', "mklink /J $to $from"
errorOutput errOut
standardOutput new ByteArrayOutputStream() // don't print the output
}
def errString = errOut.toString()
if (!errString.isEmpty() && !errString.endsWith('already exists.\r\n')) {
// we have an error that is not 'file already exists'
errString = errString.substring(0, errString.size() - 2) // discard \r\n
throw new GradleException("$errString")
}
}
println("Creating junctions for the assets")
mkdir assetsDirWindows
mkdir "$assetsDirWindows/lang"
def rootDir = projectRoot.replace('/', '\\')
def unixAssetsDir = assetsDir.replace('/', '\\')
def winAssetsDir = assetsDirWindows.replace('/', '\\')
mkJunction("$winAssetsDir\\android", "$unixAssetsDir\\android")
for (dir in ['data', 'gfx', 'lang\\mo']) {
mkJunction("$winAssetsDir\\$dir", "$rootDir\\$dir")
}
workingDir './../..'
commandLine 'echo', 'Building without localization'
}
}
makeLocalization
unzipDeps.dependsOn makeLocalization
preBuild.dependsOn unzipDeps
preBuild.dependsOn makeLocalization
preBuild.dependsOn generateVersionHeader
preBuild.dependsOn createWindowsJunctionLinks
createWindowsJunctionLinks.dependsOn makeLocalization
android {
namespace "com.cleverraven.cataclysmdda"
compileSdkVersion override_compileSdkVersion
ndkVersion override_ndkVersion
if (override_version.isEmpty()) {
println("Generating version number to $version_header_path")
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
exec {
workingDir './../..'
commandLine 'make', 'version'
}
break
case OperatingSystem.WINDOWS:
exec {
workingDir './../..'
commandLine 'sh.exe', '-c', 'make version'
}
break
default:
exec {
workingDir './../..'
commandLine 'make', 'version'
}
break
}
} else {
println("Overriding version number to $override_version")
exec {
workingDir './../..'
commandLine 'echo', '#define VERSION $override_version', '>', '$version_header_path'
}
}
defaultConfig {
minSdkVersion override_minSdkVersion
@@ -318,7 +272,7 @@ android {
debug {
storeFile file(keystoreProperties.getProperty("debug_storeFile"))
storePassword keystoreProperties.getProperty("debug_storePassword")
keyAlias keystoreProperties.getProperty("debug_keyAlias")
keyAlias keystoreProperties.getProperty("debug_seyAlias")
keyPassword keystoreProperties.getProperty("debug_keyPassword")
}
} else {
@@ -335,12 +289,9 @@ android {
}
externalNativeBuild {
ndkBuild {
cFlags "-DNDEBUG", "-DRELEASE", "-Os", "-g"
cFlags "-DNDEBUG", "-DRELEASE", "-Os"
}
}
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
debug {
@@ -351,12 +302,9 @@ android {
}
externalNativeBuild {
ndkBuild {
cFlags "-g"
}
}
ndk {
debugSymbolLevel 'FULL'
}
}
}
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
@@ -374,10 +322,6 @@ android {
abortOnError false
}
if (OperatingSystem.current() == OperatingSystem.WINDOWS) {
sourceSets.main.assets.srcDirs = ['src/main/assetsWinHost']
}
if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -2,9 +2,9 @@
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
APP_STL := c++_shared
APP_CPPFLAGS += -std=c++17
APP_CPPFLAGS += -std=c++14
ifneq ($(OS),Windows_NT)
APP_LDFLAGS += -fuse-ld=lld
APP_LDFLAGS += -fuse-ld=gold
endif
# Do not specify APP_OPTIM here, it is done through ndk-build NDK_DEBUG=0/1 setting instead
+1
View File
@@ -0,0 +1 @@
../../../src
-30
View File
@@ -1,30 +0,0 @@
LOCAL_PATH := $(call my-dir)/../../../../src
include $(CLEAR_VARS)
LOCAL_MODULE := main
LOCAL_CPP_FEATURES := exceptions rtti
# Add your application source files here...
CATA_SRCS := $(sort $(wildcard $(LOCAL_PATH)/*.cpp))
LOCAL_SRC_FILES := $(sort $(CATA_SRCS:$(LOCAL_PATH)/%=%))
LOCAL_STATIC_LIBRARIES := third-party
LOCAL_SHARED_LIBRARIES := libhidapi SDL2 SDL2_mixer SDL2_image SDL2_ttf mpg123
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lz
LOCAL_CFLAGS += -DTILES=1 -DSDL_SOUND=1 -DBACKTRACE=1 -DLOCALIZE=1 -Wextra -Wall -fsigned-char
LOCAL_LDFLAGS += $(LOCAL_CFLAGS)
ifeq ($(OS),Windows_NT)
# needed to bypass 8191 character limit on Windows command line
LOCAL_SHORT_COMMANDS := true
endif
include $(BUILD_SHARED_LIBRARY)
include $(LOCAL_PATH)/../android/app/jni/src/third-party/Android.mk
-24
View File
@@ -1,24 +0,0 @@
LOCAL_PATH := $(call my-dir)/../../../../../src/third-party
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/..
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_MODULE := third-party
LOCAL_CPP_FEATURES := exceptions rtti
# Add your application source files here...
FLATBUFFERS_SRCS := $(sort $(wildcard $(LOCAL_PATH)/flatbuffers/*.cpp))
LOCAL_SRC_FILES := $(sort $(FLATBUFFERS_SRCS:$(LOCAL_PATH)/%=%))
LOCAL_CFLAGS += -DBACKTRACE=1 -DLOCALIZE=1 -Wextra -Wall -fsigned-char
ifeq ($(OS),Windows_NT)
# needed to bypass 8191 character limit on Windows command line
LOCAL_SHORT_COMMANDS := true
endif
include $(BUILD_STATIC_LIBRARY)
+3 -3
View File
@@ -3,6 +3,7 @@
com.gamemaker.game
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cleverraven.cataclysmdda"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
@@ -42,8 +43,7 @@
android:launchMode="singleInstance"
android:keepScreenOn="true"
android:screenOrientation="userLandscape"
android:configChanges="keyboardHidden|keyboard|orientation|screenSize|navigation"
android:exported="true"
android:configChanges="keyboardHidden|keyboard|orientation|screenSize"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -55,7 +55,7 @@
android:launchMode="singleInstance"
android:keepScreenOn="true"
android:screenOrientation="userLandscape"
android:configChanges="keyboardHidden|keyboard|orientation|screenSize|navigation"
android:configChanges="keyboardHidden|keyboard|orientation|screenSize"
>
</activity>
</application>
@@ -13,8 +13,6 @@ import android.content.res.Configuration;
public class CataclysmDDA extends SDLActivity {
private static final String TAG = "CDDA";
private NativeUI nativeUI = new NativeUI(CataclysmDDA.this);
public void vibrate(int duration) {
try {
Vibrator v = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
@@ -59,12 +57,4 @@ public class CataclysmDDA extends SDLActivity {
public boolean getDefaultSetting(final String settingsName, boolean defaultValue) {
return PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean(settingsName, defaultValue);
}
public String getSystemLang() {
return getResources().getConfiguration().locale.toLanguageTag().replace('-', '_');
}
public NativeUI getNativeUI() {
return nativeUI;
}
}
@@ -1,29 +0,0 @@
package com.cleverraven.cataclysmdda;
import java.util.List;
import android.content.Context;
import android.view.accessibility.AccessibilityManager;
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.pm.ServiceInfo;
import android.widget.Toast;
public class CataclysmDDA_Helpers {
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceInfo(Context context) {
AccessibilityManager am = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> enabledServicesInfo = am.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK);
return enabledServicesInfo;
}
public static String getEnabledAccessibilityServiceNames(Context context) {
List<AccessibilityServiceInfo> enabledServicesInfo = getEnabledAccessibilityServiceInfo( context );
String service_names = "";
for (AccessibilityServiceInfo enabledService : enabledServicesInfo) {
ServiceInfo enabledServiceInfo = enabledService.getResolveInfo().serviceInfo;
String service_name = enabledServiceInfo.name;
service_names = service_names + "\n" + service_name;
}
return service_names;
}
}
@@ -1,162 +0,0 @@
package com.cleverraven.cataclysmdda;
import java.util.concurrent.Semaphore;
import android.app.AlertDialog;
import android.content.DialogInterface;
public class NativeUI {
enum YesNoDialogResponse {
YES,
NO
}
private CataclysmDDA activity;
NativeUI(CataclysmDDA activity) {
this.activity = activity;
}
private class Popup {
private Semaphore semaphore = new Semaphore(0, true);
public void popup(final String message) {
activity.runOnUiThread(new Runnable() {
public void run() {
AlertDialog dialog = new AlertDialog.Builder(activity, R.style.AlertDialogTheme)
.setTitle("")
.setCancelable(false)
.setMessage(message)
.setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
semaphore.release();
}
}).create();
dialog.show();
}
});
try {
semaphore.acquire();
} catch (InterruptedException ex) {
// No-op
}
}
}
private class QueryYN {
private Semaphore semaphore = new Semaphore(0, true);
private YesNoDialogResponse response;
public boolean queryYN(final String message) {
activity.runOnUiThread(new Runnable() {
public void run() {
AlertDialog dialog = new AlertDialog.Builder(activity, R.style.AlertDialogTheme)
.setTitle("")
.setCancelable(false)
.setMessage(message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
response = YesNoDialogResponse.YES;
semaphore.release();
}
})
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
response = YesNoDialogResponse.NO;
semaphore.release();
}
}).create();
dialog.show();
}
});
try {
semaphore.acquire();
} catch (InterruptedException ex) {
// No-op
}
return response == YesNoDialogResponse.YES;
}
}
private class SingleChoiceList {
private Semaphore semaphore = new Semaphore(0, true);
private int singleChoiceResponse;
private final int cancel = -1;
private final int init = -2;
private String[] mixOptionsText(final String[] options, final boolean[] enabled) {
String[] result = new String[options.length];
for (int i = 0; i < options.length; i++) {
if (enabled[i]) {
result[i] = options[i];
} else {
result[i] = String.format("%s [%s]", options[i], activity.getString(R.string.unavailable));
}
}
return result;
}
public int singleChoiceList(final String text, final String[] options, final boolean[] enabled) {
singleChoiceResponse = init;
final String[] choices = mixOptionsText(options, enabled);
while (singleChoiceResponse == init
|| (singleChoiceResponse != cancel && enabled[singleChoiceResponse] == false)) {
activity.runOnUiThread(new Runnable() {
public void run() {
AlertDialog dialog = new AlertDialog.Builder(activity, R.style.AlertDialogTheme)
.setTitle(text)
.setItems(choices, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
singleChoiceResponse = which;
semaphore.release();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
singleChoiceResponse = cancel;
semaphore.release();
}
})
.create();
dialog.show();
}
});
try {
semaphore.acquire();
} catch (InterruptedException ex) {
// No-op
}
if (singleChoiceResponse != cancel && enabled[singleChoiceResponse] == false) {
new Popup().popup(activity.getString(R.string.unavailableOption));
}
}
return singleChoiceResponse;
}
}
public void popup(final String message) {
final Popup popup = new Popup();
popup.popup(message);
}
public boolean queryYN(final String message) {
final QueryYN queryYN = new QueryYN();
return queryYN.queryYN(message);
}
public int singleChoiceList(final String text, final String[] options, final boolean[] enabled) {
final SingleChoiceList singleChoiceList = new SingleChoiceList();
return singleChoiceList.singleChoiceList(text, options, enabled);
}
}
@@ -1,8 +1,6 @@
package com.cleverraven.cataclysmdda;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
@@ -16,29 +14,22 @@ import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.DialogInterface;
import android.content.DialogInterface.OnShowListener;
import android.content.pm.PackageInfo;
import android.content.res.AssetManager;
import android.net.Uri;
import android.os.*;
import android.preference.PreferenceManager;
import android.util.Log;
import com.cleverraven.cataclysmdda.CataclysmDDA_Helpers;
public class SplashScreen extends Activity {
private static final String TAG = "Splash";
private static final int INSTALL_DIALOG_ID = 0;
private ProgressDialog installDialog;
private AlertDialog accessibilityServicesAlert;
public CharSequence[] mSettingsNames;
public boolean[] mSettingsValues = { false, false, true, true };
public CharSequence[] mSettingsNames = { "Software rendering", "Force fullscreen", "Trap Back button" };
public boolean[] mSettingsValues = { false, false, true };
private String getVersionName() {
try {
@@ -51,118 +42,18 @@ public class SplashScreen extends Activity {
}
}
private void showCrashAlert() {
String externalFilesDir = getExternalFilesDir(null).getPath();
File crashAlertPrompt = new File(externalFilesDir + "/config/crash.log.prompt");
try {
crashAlertPrompt.delete();
if(crashAlertPrompt.exists()) { // Sometimes .delete() doesn't really delete the file and I don't know why
crashAlertPrompt.getCanonicalFile().delete();
}
} catch(IOException e) {
return;
}
File crashLog = new File(externalFilesDir + "/config/crash.log");
StringBuilder text = new StringBuilder();
text.append(getString(R.string.crashMessage));
text.append("\n\n");
try {
BufferedReader br = new BufferedReader(new FileReader(crashLog));
String line;
while((line = br.readLine()) != null) {
text.append(line);
text.append("\n");
}
br.close();
} catch (IOException e) {
return;
}
final String message = text.toString();
this.runOnUiThread(new Runnable() {
public void run() {
AlertDialog errorAlert = new AlertDialog.Builder(SplashScreen.this)
.setTitle(getString(R.string.crashAlert))
.setCancelable(false)
.setMessage(message)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SplashScreen.this.startGameActivity(false);
}
}).create();
errorAlert.show();
}
});
}
@Override
protected void onStart() {
Log.e(TAG, "onStart()");
super.onStart();
}
@Override
protected void onPause() {
Log.e(TAG, "onPause()");
super.onPause();
accessibilityServicesAlert.dismiss();
}
@Override
protected void onResume() {
Log.e(TAG, "onResume()");
super.onResume();
Context context = getApplicationContext();
String service_names = CataclysmDDA_Helpers.getEnabledAccessibilityServiceNames(context);
accessibilityServicesAlert.setMessage( String.format( getString(R.string.accessibilityServicesMessage), service_names ) );
if (!service_names.isEmpty()) {
accessibilityServicesAlert.show();
} else {
SplashScreen.this.installOrRun();
}
}
protected void installOrRun() {
Log.e(TAG, "onCreate()");
accessibilityServicesAlert.dismiss();
// Start the game if already installed, otherwise start installing...
if (getVersionName().equals(PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("installed", ""))) {
// Show an alert box if the game crashed last time
String externalFilesDir = getExternalFilesDir(null).getPath();
File crashAlertPrompt = new File(externalFilesDir + "/config/crash.log.prompt");
if(crashAlertPrompt.exists()) {
showCrashAlert();
} else {
startGameActivity(false);
}
}
else {
new InstallProgramTask().execute();
}
return;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.e(TAG, "onCreate()");
super.onCreate(savedInstanceState);
accessibilityServicesAlert = new AlertDialog.Builder(SplashScreen.this)
.setTitle(getString(R.string.accessibilityServicesTitle))
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SplashScreen.this.installOrRun();
return;
}
})
.setNeutralButton(getString(R.string.showAccessibilitySettings), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
startActivityForResult(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS), 0);
dialog.dismiss();
return;
}
}).create();
// Start the game if already installed, otherwise start installing...
if (getVersionName().equals(PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("installed", ""))) {
startGameActivity(false);
}
else {
new InstallProgramTask().execute();
}
}
@Override
@@ -254,32 +145,23 @@ public class SplashScreen extends Activity {
}
}).create();
mSettingsNames = new CharSequence[] {
getString(R.string.softwareRendering),
getString(R.string.forceFullscreen),
getString(R.string.trapBackButton),
getString(R.string.nativeAndroidUI)
};
settingsAlert = new AlertDialog.Builder(SplashScreen.this)
.setTitle(getString(R.string.settings))
.setTitle("Settings")
.setMultiChoiceItems(SplashScreen.this.mSettingsNames, SplashScreen.this.mSettingsValues, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
SplashScreen.this.mSettingsValues[which] = isChecked;
}})
.setCancelable(false)
.setPositiveButton(getString(R.string.startGame), new DialogInterface.OnClickListener() {
.setPositiveButton("Start game", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Software rendering", SplashScreen.this.mSettingsValues[0]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Force fullscreen", SplashScreen.this.mSettingsValues[1]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Trap Back button", SplashScreen.this.mSettingsValues[2]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Native Android UI", SplashScreen.this.mSettingsValues[3]).commit();
for (int i = 0; i < mSettingsNames.length; ++i)
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean(SplashScreen.this.mSettingsNames[i].toString(), SplashScreen.this.mSettingsValues[i]).commit();
SplashScreen.this.startGameActivity(false);
return;
}
})
.setNeutralButton(getString(R.string.showHelp), new DialogInterface.OnClickListener() {
.setNeutralButton("Show help", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
helpAlert.show();
return;
@@ -53,12 +53,7 @@ class HIDDeviceUSB implements HIDDevice {
public String getSerialNumber() {
String result = null;
if (Build.VERSION.SDK_INT >= 21) {
try {
result = mDevice.getSerialNumber();
}
catch (SecurityException exception) {
//Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());
}
result = mDevice.getSerialNumber();
}
if (result == null) {
result = "";
@@ -146,6 +146,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
"SDL2_mixer",
// "SDL2_net",
"SDL2_ttf",
"intl-lite",
"main"
};
}
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="installTitle">Installiere Spieldaten...</string>
<string name="upgradeTitle">Aktualisiere Spieldaten...</string>
<string name="helpTitle">Hilfe &amp; Steuerung</string>
<string name="helpMessage">\"Wischen\" für Richtungsbewegung (Halten für virtuellen Joystick). \"Tippen\" um Auswahl in Menüs zu bestätigen oder pausiere einen Zug In-Game (Halten zum pausieren mehrerer Züge). \"Doppel Tippen\" zum Abbrechen oder Zurück in Menüs (Wie ESC auf Tastatur). \"Zusammenkneifen\" zum Rein/Raus zoomen (In-Game). Drücke Hardware \"Zurück\" Knopf fürs Umschalten der virtuellen Tastaur (Halten zum Umschalten der Tastatur Shortcuts).</string>
<string name="softwareRendering">Software-Rendering</string>
<string name="forceFullscreen">Erwzinge Vollbild</string>
<string name="trapBackButton">Verstecke Zurück Knopf</string>
<string name="settings">Einstellungen</string>
<string name="startGame">Starte Spiel</string>
<string name="showHelp">Zeige Hilfe</string>
<string name="crashAlert">Das Spiel wurde beim letzten Mal nicht richtig beendet</string>
<string name="crashMessage">Der Crash Report der sich in ./config/crash.log befindet könnten den Entwicklern helfen Programmfehler zu beheben.</string>
<string name="yes">Ja</string>
<string name="no">Nein</string>
<string name="cancel">Abbrechen</string>
</resources>
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="installTitle">Instalando información de juego…</string>
<string name="upgradeTitle">Actualizando información de juego…</string>
<string name="helpTitle">Ayuda y Controles</string>
<string name="helpMessage">\"Deslizar\" para moverse (si tenés apretado aparece el joystick virtual). \"Click\" para confirmar la selección en el menú o Pausar un turno en el juego (mantené apretado para Pausar varios turnos). \"Doble click\" para cancelar o volver en el menú (funciona como la tecla Escape). \"Pellizcar\" para hacer zoom (en el juego). Usá el botón físico \"Volver\" para activar el teclado virtual (mantené apretado para los atajos de teclado).</string>
<string name="softwareRendering">Render por software</string>
<string name="forceFullscreen">Forzar pantalla completa</string>
<string name="trapBackButton">Fijar botón Volver</string>
<string name="settings">Configuración</string>
<string name="startGame">Empezar juego</string>
<string name="showHelp">Mostrar ayuda</string>
<string name="crashAlert">El juego no fue cerrado correctamente la última vez</string>
<string name="crashMessage">El registro del error localizado en ./config/crash.log puede ayudar a los desarrolladores a solucionar errores.</string>
<string name="yes">Sí</string>
<string name="no">No</string>
<string name="cancel">Cancelar</string>
</resources>
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="installTitle">Instalando los datos del juego...</string>
<string name="upgradeTitle">Actualizando los datos del juego...</string>
<string name="helpTitle">Ayuda &amp; Controles</string>
<string name="helpMessage">\"Deslizar\" para el movimiento direccional (mantenlo presionado para el joystick virtual). \"Toque\" para confirmar la selección en el menú o Pausar un turno en-juego (mantenlo presionado para varios turnos en-juego). \"Toque doble\" para cancelar o ir hacia atrás en los menús (funciona como la tecla Escape). \"Pellizcar\" para zoom dentro/fuera (en-juego). Usa el botón \"Atrás\" físico para mostrar/ocultar el teclado virtual (mantenlo pulsado para alternar los atajos de teclado).</string>
<string name="softwareRendering">Render por software</string>
<string name="forceFullscreen">Forzar pantalla completa</string>
<string name="trapBackButton">Capturar Botón de atrás</string>
<string name="settings">Opciones</string>
<string name="startGame">Comenzar el juego</string>
<string name="showHelp">Mostrar ayuda</string>
<string name="crashAlert">El juego no finalizó correctamente la última vez</string>
<string name="crashMessage">El informe de fallos que se encuentra en ./config/crash.log puede ayudar a los desarrolladores a solucionar los errores del programa. </string>
<string name="yes">Sí</string>
<string name="no">No</string>
<string name="cancel">Cancelar</string>
</resources>
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="installTitle">Installation des données de jeu ...</string>
<string name="softwareRendering">Rendu logiciel</string>
<string name="forceFullscreen">Forcer plein écran</string>
<string name="settings">Réglages</string>
<string name="startGame">Démarrer le jeu</string>
<string name="yes">Oui</string>
<string name="no">Non</string>
<string name="cancel">Annuler</string>
</resources>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="installTitle">memasang data game</string>
<string name="upgradeTitle">mengupgrade data game</string>
<string name="helpTitle">Bantuan &amp; Kontrol</string>
<string name="helpMessage">\"Geser\" untuk pergerakan arah (tahan untuk joystik virtual). \"Tekan\" untuk konfirmasi pilihan di menu atau Jeda satu giliran dalam game (tahan untuk Jeda beberapa giliran dalam game). \"Dua Kali Tap\" untuk batal atau ke menu (seperti tombol Escape). \"Cubit\" untuk perbesar/perkecil tampilan (dalam game). Tombol \"Kembali\" di hp untuk menampilkan keyboard virtual (tahan untuk menampilkan jalan pintas keyboard\").</string>
<string name="softwareRendering">Render Perangkat Lunak</string>
<string name="forceFullscreen">Paksa Layar Penuh</string>
<string name="settings">Pengaturan</string>
<string name="startGame">Mulai game</string>
<string name="showHelp">Tampilkan Bantuan</string>
<string name="crashAlert">Game tidak keluar dengan benar</string>
<string name="crashMessage">Laporan Crash berada di ./config/crash.log mungkin dapat membantu pengembang memecahkan masalah pada program.</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More