Skip to content

Commit

Permalink
Fix Conflict (#2)
Browse files Browse the repository at this point in the history
* Make storage unit pallete and array of objects

All of the other JSON in data/json is.

* Gun variants: Better common token & dupe checking

Require at least 3 letters for common tokens, with some explicit
exceptions. It might be worth going to 4 letters, but going to 3 cleaned
up some issues.

Also make the dupe check an actual error (resulting in test failure)
than just a silent one.

The guns caught by the dupe check are allowed as separate by the variant
criteria, but it may be being too lenient there and they should instead
be combined.

Fix the errors that surfaced.
- two guns had 16" and 20" barrels, name the longer one long-barreled
- Two revolvers (chiappa_rhino and colt_python) were named the same,
  name the python to indicate it looks like a old west revolver
- Name the BLR magazine with a common identifier to the the gun
- Give the FN57 an identifier (FN)
- Add pistol to BAD_IDENTIFIERS, so the USP identifier is detected

Both the FN57 and USP pistol were using "pistol" as the identifier.
The BLR was using "ing".

* Sort gun variant script valid identifier list

So it's stable and looks nicer.

* Remove some unused CBM snippets

* Reuse built clang-tidy plugin across the shards

* makes lit candle more distinct

* Update NPC.md

* Initial commit

* Fire action accounts for all kinds of shoulder straps

I've noticed only "adjustable strap" works with the fire action to drawn
weapon, and only with default format (hanging like backpack). Happens
that code checks for that specific item. Solution is to check for a flag
instead, and so works with all kinds of attachments

* initial commit

* A couple small C++20 fixes

* Add versioning to vcpkg setup

* make xedra translocators examinable in faction territory

* Set SDL_HINT_APP_NAME for tiles

See https://wiki.libsdl.org/SDL2/SDL_HINT_APP_NAME

* [Xedra Evolved] Add `fey_magick` magic type (CleverRaven#79113)

* Initial commit

* Add NO_SPELLCASTING to flags too

* Focus the default selection in popups

* [Magiclysm] Biomancy is disturbing (CleverRaven#79117)

* Initial commit

* Add pain effects to some spells

* Reduce amount of pain caused

* Fix scroll name

* Fix ClangBuildAnalyzer workflow

* [MoM] Fix Mind-sight goggles special vision sprite (CleverRaven#79119)

* Extended description window shows potential deconstruction and bash yields (CleverRaven#79107)

* Basic addition of deconstruction yields to extended description

* Deduplicate and add skill info

* Add bash yields replacing the Smashable tag

* Add the extended description keybind text to the look around window

* Less lazy formatting

* [Xedra Evolved] Increase mana cost on Arvore mana-using traits (CleverRaven#79096)

* Remove ghc/filesystem polyfill now that we are on C++17 (CleverRaven#79092)

* Remove ghc/filesystem shim now that we are on C++17

* fixies

* astyle

* teach clang-tidy about <filesystem>

* Battery compartment mod can use medium storage batteries (CleverRaven#79091)

* Update toolmod.json

* Lint

---------

Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>

* [MoM] Fix Leukocyte Accumulation class (CleverRaven#79123)

* Initial commit

* Add magic class

* remove const from distance_limit

* [Xedra Evolved] Fix treesung baselard recipe (CleverRaven#79131)

* Extract special vision descriptions for translation (CleverRaven#79108)

* Extract special vision descriptions for translation

* Add includes

* Add origin arguments

* Attempt to appease flake8

* Missed iterating an array

* Fix typo

* Our flake8 makes me want to commit war crimes

* Fix various flake8 errors

* Weekly Changelog 2025-01-06 to 2025-01-13 (CleverRaven#79127)

* Weekly Changelog 2025-01-06 to 2025-01-13

* Apply suggestions from code review

---------

Co-authored-by: David Seguin <davidseguin@live.ca>
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>

* {CR} Adds three new lore log snippets! (CleverRaven#79058)

* new lore log snippets (draft)

the lore log snippets are one of my favorite things to be featured in cataclysm, and I wanted to write some of my own!

* Update e_logs.json

* Add three new lore log snippets

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* lint changes

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update data/json/snippets/e_logs.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update data/json/snippets/e_logs.json

* replace 3 spaces with 2 spaces

---------

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>
Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>

* Weekly Changelog 2024-12-30 to 2025-01-06 (CleverRaven#78977)

* Weekly Changelog 2024-12-30 to 2025-01-06

* Apply suggestions from code review

---------

Co-authored-by: David Seguin <davidseguin@live.ca>
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>

* Fix Irradiant weapon attack

* Move refugee center start from isolationist to its own scenario (CleverRaven#79140)

* Change to start outside refugee center entrance

* Move refugee center start to its own option

* Starting on path by entrance

* use test monsters in shotgun tests (CleverRaven#79141)

* use test monsters

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Don't try to GENERATE typed coordinates (CleverRaven#79137)

* Don't try to GENERATE typed coordinates

* Adjusted according to comments

* [MoM] Add null grenades (CleverRaven#79147)

* Initial commit

* Add expended grenades

* Add snippet

* Change id to avoid confusion with _null terrain etc

* Create user mods dir automatically. (CleverRaven#79057)

* mod manager

* Update src/mod_manager.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [Magiclysm] Fix werewolf aura (CleverRaven#79151)

* Initial commit

* Fixes

* typified a-f

* [Magiclysm] Rename 'Introduction to the Divine' to 'The Limits of Magical Recovery' (CleverRaven#79153)

* Initial commit

* Itemgroup changes

* Update data/mods/Magiclysm/items/spellbooks.json

---------

Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>

* Aftershock: Genetech Mutation system or Genetically engineered Catgirls. (CleverRaven#79128)

* Aftershock Genetech

* Apply suggestions from code review

Co-authored-by: Marc <altairre.atsu@gmail.com>

---------

Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>
Co-authored-by: Marc <altairre.atsu@gmail.com>

* [Aftershock] Add human++ genemods (CleverRaven#79149)

* Add genemods

* Add hobbies

* Add Genemod: Beauty

* Fix errors

* Spelling

* [Aftershock] UICA Shuttle Bases (CleverRaven#79144)

* Add UICA Shuttlebases to the Exo-Planet

* Lint

* Add a Quartermaster NPC. They can be bribed to sell you UICA gear and supplies.

* Lint

* Add Lynx Explorer Vehicle, Quartermaster has less stuff to sell, Shuttlebase spawns ground vehicles

* Add Vehicle Repair group stub

* Bump up Bribe to $3000

* Rewrite some Quartermaster dialog

* Please test gods

* Test gods please, I beg

* Correct Shuttlebase to Shuttle Base

* [ Xedrea Evolved ] Gracken Legs first tier (CleverRaven#79122)

* Legs first tier

Update harvest_monster_hunter_gracken.json

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update data/mods/Xedra_Evolved/items/gracken_trait_improvements.json

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>

* Sort docs into subfolders

* update paths to moved docs

* better name for LORE_FAQ doc, as suggested by Kevin (thanks!)

* [MoM] Concentrating on powers at higher Nether Attunement has a chance of backlash (CleverRaven#79163)

* Initial commit

* Check for backlash on concentration breaking too.

* Change backlash messages to not reference unleashing powers

* Nether Attunement vitamin at 15 or higher, not powers maintained at 15 or higher

* Spelling

* Temporary script to automate this

* Remove meaningless weight fields

* Fix compile error, remove unneeded string initialisation, correct translation, don't write required mutation string if we're about to overwrite it with incompatible bionics

* Update skyscraper_lab_modular.json

* monstergroups "name" -> "id" in /data/json

* Commit the script so out of repo + personal mods can use it

* monstergroups "name" -> "id" in /data/mods

* Update deserialisation

* Get annoyed at flake8

* Put the script in the wrong folder like a numpty

* Fix MSVC build with lld linker

* Add an ignorable error and legacy load

* flake8 is rood

* Change C++ ids called "name" to something better too

* Rename doc/COMPILING/ -> doc/c++/

* Remove string spawn item overloads (CleverRaven#79173)

* Remove evil overloads

* Deal with fallout

* Rename map:: get_global->get_abs, bub_from_abs->get_bub, omt_from_abs->get_omt (CleverRaven#79167)

* Renamed map:: getglobal->get_abs, bub_from_abs->get_bub, omt_from_abs->get_omt

* astyle

* [Magiclysm] Remove duplicate religious professions (CleverRaven#79162)

* Update professions.json

* Redirect Lost Faith to vanilla professions, add books

* Reformat item field?

* Update data/mods/Magiclysm/scenarios.json

* Add scenario EoC

* Remove debug message

* Kick tests

---------

Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>

* [ Xedra Evolved ] Fix Renfield Drops (CleverRaven#79166)

* typify game.h/cpp

* use typed point in android code

* Use sub_bodypart_str_id::NULL_ID() where appropriate

* Add attack_vector_id::NULL_ID()

* typify g - lightmap

* [MoM] Update and simplify Nether Attunement backlash EoC (CleverRaven#79175)

* More updates

* More edits

* Updating remaining effects

* Initial commit

* Initial commit

* Expand bodypart_str_id::NULL_ID() usage where appropriate

* Deal with /tests fallout

* Initial commit

* please clang

* Add CMake function do debug targets

* Add targets with dynamic linking

* Use VCPKG dynamic linking triplet

* Obey linter

* Apply review suggestions

* Fix Debug configuration linking with MSVS + LLD

* Fix zlib linking

* Prevent initialising an activity actor's type every turn it's active

* [MoM] Fix Research Facility having an oldlab underneath (CleverRaven#79191)

* Initial commit

* Implement suggestions from code review

* fix not being able to move items with charges with AIM (CleverRaven#79183)

* fix can move items with charges

* astyle

---------

Co-authored-by: marilynias <marilynias57+github@gmail.com>

* [Aftershock] Gene Clinics (CleverRaven#79197)

* Implement Gene Clinic variant 1

* Renovate Clinic to Add service room. Add Murder Bots and Moxies. Implement powered down gene editor

* Add most of the item spawn groups

* Add item groups, Monster Spawns, and Mapgen Nests

* Add trash to the ground in looted variant. Adjust spawn rates of looted vrs unlooted to 60-40 in the players favor

* Geneclinics also spawn without the Exo-Planet

* Remove redudant spawn of the larger genetech disposable group, low tier already spawns worker and combat rarely

* Mapgen now correctly murders plants when power is out

* String fixes for test gods

* Slime body can't hold cbms (CleverRaven#79086)

* [MoM] Switch mi-go psions to copy-from, giver the mindrender a power-based telepathic attack (CleverRaven#79199)

* Initial commit

* Kick tests

* [Aftershock] Ensure Outfitter always has at least one full EVA suit (CleverRaven#79218)

* Outfitter always has at least one full suit.

* Lint

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update fema_evacuee_1.json (CleverRaven#79203)

---------

Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
Co-authored-by: Sab Pyrope <99945024+Uwuewsky@users.noreply.github.com>
Co-authored-by: moxian <moxian@users.noreply.github.com>
Co-authored-by: gettingusedto <78019001+gettingusedto@users.noreply.github.com>
Co-authored-by: EliadOArias <2144359102@qq.com>
Co-authored-by: Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm <dorchadas@gmail.com>
Co-authored-by: Andrew Rosa <dev@andrewhr.io>
Co-authored-by: GuardianDll <antisim009@gmail.com>
Co-authored-by: Dee Anzorge <d.anzorge@gmail.com>
Co-authored-by: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com>
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
Co-authored-by: Anton Simakov <67688115+GuardianDll@users.noreply.github.com>
Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>
Co-authored-by: gisaku33 <jjboyd21@gmail.com>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
Co-authored-by: David Seguin <davidseguin@live.ca>
Co-authored-by: 7erracotta <89712754+7erracotta@users.noreply.github.com>
Co-authored-by: John Candlebury <johncandlebury@gmail.com>
Co-authored-by: Further Reading <roy.healy87+gh@gmail.com>
Co-authored-by: osuphobia <78858975+osuphobia@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: PatrikLundell <j.patrik.r.lundell@gmail.com>
Co-authored-by: EArias <152629049+EliadOArias@users.noreply.github.com>
Co-authored-by: Marc <altairre.atsu@gmail.com>
Co-authored-by: akrieger <akrieger@users.noreply.github.com>
Co-authored-by: mqrause <martin@qrause.de>
Co-authored-by: alef <alef@users.noreply.github.com>
Co-authored-by: marilynias <98028585+marilynias@users.noreply.github.com>
Co-authored-by: marilynias <marilynias57+github@gmail.com>
Co-authored-by: Risuga <oosyrag@gmail.com>
  • Loading branch information
1 parent 75520f4 commit acc64a7
Show file tree
Hide file tree
Showing 895 changed files with 7,140 additions and 11,652 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/cross-compile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
RUN apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

# [Optional] comment out this section unless you want to cross-compile from Linux to Windows
# This section should align with doc/COMPILING/COMPILING.md#cross-compile-to-windows-from-linux
# This section should align with doc/c++/COMPILING.md#cross-compile-to-windows-from-linux
# With the exception of the installation of packages that are already installed earlier in the Dockerfile
# Like: astyle, cmake
RUN apt-get -y install autoconf automake autopoint bash bison bzip2 flex gettext git g++ \
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/CBA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ jobs:
- uses: ammaraskar/gcc-problem-matcher@master
- name: make
run: |
clang++ --version
ClangBuildAnalyzer --start .
CLANG=clang++-14 CXXFLAGS=-ftime-trace make
CLANG=clang++ CXXFLAGS=-ftime-trace make
ClangBuildAnalyzer --stop . buildAnalysis
- name: Analyze
run: ClangBuildAnalyzer --analyze buildAnalysis
- uses: actions/upload-artifact@v4
with:
name: ClangBuildAnalyzer-analysis
path: buildAnalysis
- uses: actions/upload-artifact@v4
with:
name: ClangBuildAnalyzer-traces
Expand Down
73 changes: 44 additions & 29 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,71 @@ jobs:
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
paths: '[ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", "build-scripts/clang-tidy.sh", "build-scripts/clang-tidy-wrapper.sh", "build-scripts/get_affected_files.py", ".github/workflows/clang-tidy.yml" ]'
build:
paths: '[ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", "build-scripts/clang-tidy-build.sh", "build-scripts/clang-tidy-run.sh", "build-scripts/clang-tidy-wrapper.sh", "build-scripts/get_affected_files.py", ".github/workflows/clang-tidy.yml" ]'


build-clang-tidy:
needs: skip-duplicates
strategy:
fail-fast: true
runs-on: ubuntu-24.04
env:
COMPILER: clang++-17
steps:
- name: install LLVM 17
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
run: |
sudo apt install llvm-17 llvm-17-dev llvm-17-tools clang-17 clang-tidy-17 clang-tools-17 libclang-17-dev
sudo apt install python3-pip ninja-build cmake
pip3 install --user lit
- name: checkout repository
uses: actions/checkout@v4
- uses: ammaraskar/gcc-problem-matcher@master
- name: build clang-tidy plugin
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
run: bash ./build-scripts/clang-tidy-build.sh
- name: upload plugin
uses: actions/upload-artifact@v4
with:
name: cata-analyzer-plugin
path: build/tools/clang-tidy-plugin/libCataAnalyzerPlugin.so
retention-days: 1


run-clang-tidy:
needs: build-clang-tidy
strategy:
fail-fast: false
matrix:
# To make the run finish in the run time limit, we split it up into two
# parts: the src directory and everything else
# To make the run finish in the run time limit, we split it up into three parts:
# the files explicitly changed in the pr, the src directory and everything else
subset: [
'directly-changed',
'indirectly-changed-src',
'indirectly-changed-other'
]

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
CMAKE: 1
CLANG: clang++-17
COMPILER: clang++-17
CATA_CLANG_TIDY: plugin
CATA_CLANG_TIDY: clang-tidy-17
CATA_CLANG_TIDY_SUBSET: ${{ matrix.subset }}
TILES: 1
SOUND: 1
RELEASE: 1
LOCALIZE: 1
steps:
- name: install LLVM 17
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
sudo apt update
sudo apt install llvm-17 llvm-17-dev llvm-17-tools clang-17 clang-tidy-17 clang-tools-17 \
libclang-17-dev libflac-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev \
libpulse-dev ccache gettext jq
- name: install dependencies
run: |
sudo apt install python3-pip libncursesw5-dev ninja-build cmake gettext
pip3 install --user lit
- name: ensure clang-tidy and FileCheck commands point to LLVM 17
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
run: |
mkdir ~/llvm-command-override
ln -s /usr/bin/clang-tidy-17 ~/llvm-command-override/clang-tidy
ln -s /usr/bin/FileCheck-17 ~/llvm-command-override/FileCheck
echo "$HOME/llvm-command-override" >> $GITHUB_PATH
sudo apt install clang-17 clang-tidy-17 cmake ccache jq
sudo apt install libflac-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev gettext
- name: checkout repository
uses: actions/checkout@v4
- name: prepare
run: bash ./build-scripts/requirements.sh
- name: download plugin from the previous job in this workflow run
uses: actions/download-artifact@v4
with:
name: cata-analyzer-plugin
path: build/tools/clang-tidy-plugin/
- name: determine changed files
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v7
Expand All @@ -98,7 +113,7 @@ jobs:
- uses: ammaraskar/gcc-problem-matcher@master
- name: run clang-tidy
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
run: bash ./build-scripts/clang-tidy.sh
run: bash ./build-scripts/clang-tidy-run.sh
- name: show most time consuming checks
if: always()
run: | # the folder may not exist if there is no file to analyze
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
uses: reviewdog/action-suggester@v1
if: ${{ always() }}
with:
tool_name: '[JSON & C++ formatters](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/DEVELOPER_TOOLING.md)'
tool_name: '[JSON & C++ formatters](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/c++/DEVELOPER_TOOLING.md)'
8 changes: 4 additions & 4 deletions .github/workflows/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
branches:
- master
paths:
- 'doc/JSON_INFO.md'
- 'doc/JSON/JSON_INFO.md'
name: TOC Generator
permissions:
contents: read
Expand All @@ -15,17 +15,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx doctoc doc/JSON_INFO.md --github
- run: npx doctoc doc/JSON/JSON_INFO.md --github
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
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
title: Update the table of contents in doc/JSON/JSON_INFO.md
body: |
```sh
#### Summary
None
npx doctoc doc/JSON_INFO.md --github
npx doctoc doc/JSON/JSON_INFO.md --github
```
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ endif()
#SET(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32")
#SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32")

include(ListImportedTargets)

find_package(PkgConfig)
if (NOT DYNAMIC_LINKING)
if(NOT MSVC)
Expand Down Expand Up @@ -211,7 +213,7 @@ message(STATUS "LOCALIZE : ${LOCALIZE}")
message(STATUS "USE_XDG_DIR : ${USE_XDG_DIR}")
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 "See doc/c++/COMPILING-CMAKE.md for details and more info --")

if (NOT MSVC)
set(CATA_WARNINGS
Expand Down Expand Up @@ -255,7 +257,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
"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.")
See doc/c++/COMPILING-CMAKE.md for details and more info.")
endif ()

#set(THREADS_USE_PTHREADS_WIN32 True)
Expand Down Expand Up @@ -284,27 +286,29 @@ if (TILES)
"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.")
See doc/c++/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 OR TARGET SDL2::SDL2_ttf OR TARGET SDL2_ttf::SDL2_ttf-static))
if (NOT (SDL2_TTF_FOUND OR TARGET SDL2::SDL2_ttf OR TARGET SDL2_ttf::SDL2_ttf
OR TARGET SDL2_ttf::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.")
See doc/c++/COMPILING-CMAKE.md for details and more info.")
endif ()

message(STATUS "Searching for SDL2_image library --")
find_package(SDL2_image)
if (NOT (SDL2_IMAGE_FOUND OR TARGET SDL2::SDL2_image OR TARGET SDL2_image::SDL2_image-static))
if (NOT (SDL2_IMAGE_FOUND OR TARGET SDL2::SDL2_image OR TARGET SDL2_image::SDL2_image
OR TARGET SDL2_image::SDL2_image-static))
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.")
See doc/c++/COMPILING-CMAKE.md for details and more info.")
endif ()
add_definitions(-DTILES)
endif ()
Expand Down Expand Up @@ -358,7 +362,7 @@ if (CURSES)
"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")
See doc/c++/COMPILING-CMAKE.md for details and more info")
endif ()
if (NOT DYNAMIC_LINKING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNCURSES_STATIC")
Expand All @@ -374,7 +378,7 @@ if (SOUND)
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.")
See doc/c++/COMPILING-CMAKE.md for details and more info.")
endif()
endif ()

Expand Down
21 changes: 21 additions & 0 deletions CMakeModules/ListImportedTargets.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# A simple debug script showing the locations of imported target.
# There is no load-bearing functionality.
function(ListImportedTargets dir)
message(DEBUG "List of imported targets in ${dir}:")
get_property(tgts DIRECTORY ${dir} PROPERTY IMPORTED_TARGETS)
foreach(tgt ${tgts})
message(DEBUG " ${tgt}")
get_property(p TARGET ${tgt} PROPERTY IMPORTED_LOCATION)
message(DEBUG " IMPORTED_LOCATION=${p}")
get_property(p TARGET ${tgt} PROPERTY IMPORTED_LIBNAME)
message(DEBUG " IMPORTED_LIBNAME=${p}")
foreach(cfg in DEBUG;RELEASE)
set(VAR "IMPORTED_LOCATION_${cfg}")
get_property(p TARGET ${tgt} PROPERTY ${VAR})
message(DEBUG " ${VAR}=${p}")
set(VAR "IMPORTED_LIBNAME_${cfg}")
get_property(p TARGET ${tgt} PROPERTY ${VAR})
message(DEBUG " ${VAR}=${p}")
endforeach()
endforeach()
endfunction()
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
},
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-linux",
"VCPKG_TARGET_TRIPLET": "x64-linux-dynamic",
"VCPKG_MANIFEST_DIR": "${sourceDir}/msvc-full-features/"
}
}
Expand Down
2 changes: 1 addition & 1 deletion ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ You can update issues with labels using comment-commands. First, open a PR addin

### Questions

You should direct your questions to the forum or ask on IRC. You should also read the included documentation and additional text files, e.g. [COMPILING.md](doc/COMPILING/COMPILING.md) if you have problems building.
You should direct your questions to the forum or ask on IRC. You should also read the included documentation and additional text files, e.g. [COMPILING.md](doc/c++/COMPILING.md) if you have problems building.

## Bounties

Expand Down
2 changes: 0 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ PLF List and PLF Colony (src/list.h, src/colony.h) are licensed under the zLib l

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.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Ncurses and tiles versions are available in the [official repos](https://tracker

## Compile

Please read [COMPILING.md](doc/COMPILING/COMPILING.md) - it covers general information and more specific recipes for Linux, OS X, Windows and BSD. See [COMPILER_SUPPORT.md](doc/COMPILING/COMPILER_SUPPORT.md) for details on which compilers we support. And you can always dig for more information in [doc/](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc).
Please read [COMPILING.md](doc/c++/COMPILING.md) - it covers general information and more specific recipes for Linux, OS X, Windows and BSD. See [COMPILER_SUPPORT.md](doc/c++/COMPILER_SUPPORT.md) for details on which compilers we support. And you can always dig for more information in [doc/](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc).

We also have the following build guides:
* Building on Windows with `MSYS2` at [COMPILING-MSYS.md](doc/COMPILING/COMPILING-MSYS.md)
* Building on Windows with `vcpkg` at [COMPILING-VS-VCPKG.md](doc/COMPILING/COMPILING-VS-VCPKG.md)
* Building with `cmake` at [COMPILING-CMAKE.md](doc/COMPILING/COMPILING-CMAKE.md) (*unofficial guide*)
* Building on Windows with `MSYS2` at [COMPILING-MSYS.md](doc/c++/COMPILING-MSYS.md)
* Building on Windows with `vcpkg` at [COMPILING-VS-VCPKG.md](doc/c++/COMPILING-VS-VCPKG.md)
* Building with `cmake` at [COMPILING-CMAKE.md](doc/c++/COMPILING-CMAKE.md) (*unofficial guide*)

## Contribute

Expand Down
56 changes: 56 additions & 0 deletions build-scripts/clang-tidy-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# Shell script intended for clang-tidy check

echo "Using bash version $BASH_VERSION"
set -exo pipefail

num_jobs=3

# We might need binaries installed via pip, so ensure that our personal bin dir is on the PATH
#export PATH=$HOME/.local/bin:$PATH
build_type=MinSizeRel

cmake_extra_opts=()
cmake_extra_opts+=("-DCATA_CLANG_TIDY_PLUGIN=ON")
# Need to specify the particular LLVM / Clang versions to use, lest it
# use the older LLVM that comes by default on Ubuntu.
cmake_extra_opts+=("-DLLVM_DIR=/usr/lib/llvm-17/lib/cmake/llvm")
cmake_extra_opts+=("-DClang_DIR=/usr/lib/llvm-17/lib/cmake/clang")


mkdir -p build
cd build
cmake \
${COMPILER:+-DCMAKE_CXX_COMPILER=$COMPILER} \
-DCMAKE_BUILD_TYPE="$build_type" \
-DLOCALIZE=OFF \
"${cmake_extra_opts[@]}" \
..


echo "Compiling clang-tidy plugin"
make -j$num_jobs CataAnalyzerPlugin
#export PATH=$PWD/tools/clang-tidy-plugin/clang-tidy-plugin-support/bin:$PATH
# add FileCheck to the search path
export PATH=/usr/lib/llvm-17/bin:$PATH
if ! which FileCheck
then
echo "Missing FileCheck"
exit 1
fi
CATA_CLANG_TIDY=clang-tidy
# lit might be installed via pip, so ensure that our personal bin dir is on the PATH
export PATH=$HOME/.local/bin:$PATH
lit -v tools/clang-tidy-plugin/test
cd ..

# show that it works

echo "version:"
LD_PRELOAD=build/tools/clang-tidy-plugin/libCataAnalyzerPlugin.so clang-tidy --version
echo "all enabled checks:"
LD_PRELOAD=build/tools/clang-tidy-plugin/libCataAnalyzerPlugin.so clang-tidy --list-checks
echo "cata-specific checks:"
LD_PRELOAD=build/tools/clang-tidy-plugin/libCataAnalyzerPlugin.so clang-tidy --list-checks --checks="cata-*" | grep "cata"

Loading

0 comments on commit acc64a7

Please sign in to comment.