Skip to content

Commit 92616c8

Browse files
committed
Merge branch 'develop' into world-map-port-tiles-sequel
2 parents c5b4d1f + c3ae0c3 commit 92616c8

361 files changed

Lines changed: 16517 additions & 8929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build-linux.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ on:
6666
default: false
6767
gcc-ver:
6868
type: string
69-
default: "10"
69+
default: "11"
7070

7171
jobs:
7272
build-linux64:

‎.github/workflows/build-windows.yml‎

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,20 @@ on:
6666
jobs:
6767
build-win64:
6868
name: Build win64
69-
runs-on: ubuntu-22.04
69+
runs-on: windows-2022
7070
steps:
71-
- name: Install dependencies
71+
- name: Set up Python
72+
uses: actions/setup-python@v6
73+
with:
74+
python-version: '3.x'
75+
- name: Install build dependencies
76+
run: |
77+
choco install sccache
78+
pip install Jinja2
79+
- name: Install doc dependencies
80+
if: inputs.docs
7281
run: |
73-
sudo apt-get update
74-
sudo apt-get install ccache
82+
pip install sphinx
7583
- name: Clone DFHack
7684
uses: actions/checkout@v4
7785
with:
@@ -108,49 +116,82 @@ jobs:
108116
ref: main
109117
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
110118
path: depends/steam
119+
- name: Prepare output directories
120+
run: |
121+
mkdir output
122+
mkdir pdb
123+
- name: Get sccache path
124+
run: echo ("SCCACHE_DIR=" + $env:LOCALAPPDATA + "\Mozilla\sccache\cache") >> $env:GITHUB_ENV
111125
- name: Fetch ccache
112126
if: inputs.platform-files
113127
uses: actions/cache/restore@v4
114128
with:
115-
path: build/win64-cross/ccache
129+
path: ${{ env.SCCACHE_DIR }}
116130
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
117131
restore-keys: |
118132
win-msvc-${{ inputs.cache-id }}
119133
win-msvc
120-
- name: Cross-compile
134+
- uses: ilammy/msvc-dev-cmd@v1
135+
- name: Configure DFHack
136+
run: |
137+
cmake `
138+
-S . `
139+
-B build `
140+
-GNinja `
141+
-DDFHACK_BUILD_ARCH=64 `
142+
-DCMAKE_BUILD_TYPE=Release `
143+
-DCMAKE_INSTALL_PREFIX=output `
144+
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
145+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
146+
-DBUILD_PDBS:BOOL=${{ inputs.cache-id == 'release' }} `
147+
-DDFHACK_RUN_URL='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' `
148+
-DBUILD_LIBRARY=${{ inputs.platform-files }} `
149+
-DBUILD_PLUGINS:BOOL=${{ inputs.platform-files && inputs.plugins }} `
150+
-DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} `
151+
-DBUILD_DOCS:BOOL=${{ inputs.docs }} `
152+
-DBUILD_DOCS_NO_HTML:BOOL=${{ !inputs.html }} `
153+
-DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} `
154+
-DBUILD_DFLAUNCH:BOOL=${{ inputs.launchdf }} `
155+
-DBUILD_TESTS:BOOL=${{ inputs.tests }} `
156+
-DBUILD_XMLDUMP:BOOL=${{ inputs.xml-dump-type-sizes }} `
157+
${{ inputs.xml-dump-type-sizes && '-DINSTALL_XMLDUMP:BOOL=1' || '' }}
158+
- name: Build DFHack
121159
env:
122-
CMAKE_EXTRA_ARGS: -DBUILD_PDBS:BOOL=${{ inputs.cache-id == 'release' }} -DDFHACK_RUN_URL='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' -DBUILD_LIBRARY=${{ inputs.platform-files }} -DBUILD_PLUGINS:BOOL=${{ inputs.platform-files && inputs.plugins }} -DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} -DBUILD_DOCS:BOOL=${{ inputs.docs }} -DBUILD_DOCS_NO_HTML:BOOL=${{ !inputs.html }} -DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} -DINSTALL_SCRIPTS:BOOL=${{ inputs.common-files }} -DBUILD_DFLAUNCH:BOOL=${{ inputs.launchdf }} -DBUILD_TESTS:BOOL=${{ inputs.tests }} -DBUILD_XMLDUMP:BOOL=${{ inputs.xml-dump-type-sizes }} ${{ inputs.xml-dump-type-sizes && '-DINSTALL_XMLDUMP:BOOL=1' || '' }}
160+
SCCACHE_CACHE_SIZE: 500M
123161
run: |
124-
cd build
125-
bash -x build-win64-from-linux.sh
162+
ninja install -C build
126163
- name: Finalize cache
127164
run: |
128165
cd build
129-
ccache -d win64-cross/ccache --show-stats --verbose
130-
ccache -d win64-cross/ccache --max-size ${{ inputs.cache-id == 'release' && '500M' || '150M' }}
131-
ccache -d win64-cross/ccache --cleanup
132-
ccache -d win64-cross/ccache --max-size ${{ inputs.cache-id == 'release' && '2G' || '500M' }}
133-
ccache -d win64-cross/ccache --zero-stats
166+
sccache --show-stats
167+
sccache --zero-stats
134168
- name: Save ccache
135169
if: inputs.platform-files && !inputs.cache-readonly
136170
uses: actions/cache/save@v4
137171
with:
138-
path: build/win64-cross/ccache
172+
path: ${{ env.SCCACHE_DIR }}
139173
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
140174
- name: Format artifact name
141175
if: inputs.artifact-name
142176
id: artifactname
143177
run: |
144-
if test "false" = "${{ inputs.append-date-and-hash }}"; then
145-
echo name=${{ inputs.artifact-name }} >> $GITHUB_OUTPUT
146-
else
147-
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
148-
fi
178+
if ("${{ inputs.append-date-and-hash }}" -eq "false") {
179+
"name=${{ inputs.artifact-name }}" | Out-File -Append $env:GITHUB_OUTPUT
180+
} else {
181+
$date = Get-Date -Format "yyyMMdd"
182+
$hash = git rev-parse --short HEAD
183+
"name=${{ inputs.artifact-name}}-$date-$hash" | Out-File -Append $env:GITHUB_OUTPUT
184+
}
185+
- name: Prep pdbs
186+
if: inputs.artifact-name && inputs.cache-id == 'release'
187+
run: |
188+
Get-ChildItem -Recurse -File -Path "build" -Filter *.pdb |
189+
Copy-Item -Destination "pdb"
149190
- name: Prep artifact
150-
if: inputs.artifact-name
151191
run: |
152-
cd build/win64-cross/output
153-
tar cjf ../../../${{ steps.artifactname.outputs.name }}.tar.bz2 .
192+
cd output
193+
7z a -ttar -so -an . |
194+
7z a -si -tbzip2 ../${{ steps.artifactname.outputs.name }}.tar.bz2
154195
- name: Upload artifact
155196
if: inputs.artifact-name
156197
uses: actions/upload-artifact@v4
@@ -162,4 +203,4 @@ jobs:
162203
uses: actions/upload-artifact@v4
163204
with:
164205
name: ${{ steps.artifactname.outputs.name }}_pdb
165-
path: build/win64-cross/pdb
206+
path: pdb

‎.github/workflows/generate-symbols.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ on:
3636
default: default
3737
options:
3838
- default
39+
- experimental
3940
- testing
4041
- adventure_test
4142
- beta
@@ -133,7 +134,7 @@ jobs:
133134
+quit
134135
tar xjf dfhack-symbols-linux64-build.tar.bz2 -C DF_steam
135136
xml/symbols_gen_linux.sh ${{ inputs.version == 'auto' && '50.0' || inputs.version }} STEAM DF_steam
136-
if [ "${{ inputs.version }}" = "auto" ]; then
137+
if [ "${{ inputs.version }}" == "auto" ]; then
137138
while pgrep dwarfort; do
138139
echo "waiting for DF to exit"
139140
sleep 0.5

‎.github/workflows/test.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ jobs:
5959
fail-fast: false
6060
matrix:
6161
include:
62-
- gcc: 10
62+
- gcc: 11 # baseline compatibility with ubuntu LTS 22.04
6363
plugins: "default"
64-
- gcc: 12
64+
- gcc: 12 # highest available in ubuntu 22.04
6565
plugins: "all"
6666

6767
test-windows:
@@ -96,7 +96,7 @@ jobs:
9696
dfhack_repo: ${{ inputs.dfhack_repo }}
9797
dfhack_ref: ${{ inputs.dfhack_ref }}
9898
os: ubuntu
99-
compiler: gcc-10
99+
compiler: gcc-11
100100
plugins: default
101101
config: default
102102

‎.github/workflows/watch-df-release.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
# df_steam_branch: which DF Steam branch to watch
18-
# platform: leave blank to default to all
18+
# platform: for symbols generation; leave blank to default to all
1919
# structures_ref: leave blank to default to master
2020
# dfhack_ref: leave blank if no structures update is desired
2121
# steam_branch: leave blank if no DFHack steam push is desired
2222
include:
2323
- df_steam_branch: public
24-
- df_steam_branch: beta
24+
# - df_steam_branch: beta
25+
# - df_steam_branch: experimental
26+
# structures_ref: experimental
27+
# dfhack_ref: experimental
28+
# steam_branch: experimental
2529
steps:
2630
- name: Fetch state
2731
uses: actions/cache/restore@v4
@@ -31,7 +35,8 @@ jobs:
3135
- name: Compare branch metadata
3236
uses: nick-fields/retry@v3
3337
with:
34-
timeout_minutes: 2
38+
timeout_minutes: 5
39+
retry_wait_seconds: 60
3540
command: |
3641
blob=$(wget 'https://api.steamcmd.net/v1/info/975370?pretty=1' -O- | \
3742
awk '/^ *"branches"/,0' | \
@@ -117,7 +122,8 @@ jobs:
117122
- name: Compare versions
118123
uses: nick-fields/retry@v3
119124
with:
120-
timeout_minutes: 2
125+
timeout_minutes: 5
126+
retry_wait_seconds: 60
121127
command: |
122128
version=$(wget "${{ matrix.url }}" -qO- | tr '"' '\n' | fgrep 'tar.bz2' | head -n1 | sed -r 's/${{ matrix.prefix }}_([0-9]{2})_([0-9]{2})_linux.tar.bz2/\1.\2/')
123129
echo "latest ${{ matrix.channel }} version: $version"

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ build/compile_commands.json
4949
build/dfhack_setarch.txt
5050
build/ImportExecutables.cmake
5151
build/Testing
52+
build/_deps
5253

5354
# Python binding binaries
5455
*.pyc
@@ -64,6 +65,7 @@ build/CPack*Config.cmake
6465

6566
# VSCode files
6667
.vscode
68+
*.code-workspace
6769

6870
# ctags file
6971
tags

‎.pre-commit-config.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44
repos:
55
# shared across repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v5.0.0
7+
rev: v6.0.0
88
hooks:
99
- id: check-added-large-files
1010
- id: check-case-conflict
@@ -20,11 +20,11 @@ repos:
2020
args: ['--fix=lf']
2121
- id: trailing-whitespace
2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.30.0
23+
rev: 0.37.4
2424
hooks:
2525
- id: check-github-workflows
2626
- repo: https://github.com/Lucas-C/pre-commit-hooks
27-
rev: v1.5.5
27+
rev: v1.5.6
2828
hooks:
2929
- id: forbid-tabs
3030
exclude_types:

‎CMakeLists.txt‎

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
55
cmake_policy(SET CMP0048 NEW)
66
cmake_policy(SET CMP0074 NEW)
7+
set(CMAKE_INSTALL_MESSAGE "LAZY")
78

89
# set up versioning.
9-
set(DF_VERSION "51.04")
10-
set(DFHACK_RELEASE "r1")
10+
set(DF_VERSION "53.15")
11+
set(DFHACK_RELEASE "r2")
1112
set(DFHACK_PRERELEASE FALSE)
1213

1314
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")
@@ -46,8 +47,8 @@ option(REMOVE_SYMBOLS_FROM_DF_STUBS "Remove debug symbols from DF stubs. (Reduce
4647
macro(CHECK_GCC compiler_path)
4748
execute_process(COMMAND ${compiler_path} -dumpversion OUTPUT_VARIABLE GCC_VERSION_OUT)
4849
string(STRIP "${GCC_VERSION_OUT}" GCC_VERSION_OUT)
49-
if(${GCC_VERSION_OUT} VERSION_LESS "10")
50-
message(SEND_ERROR "${compiler_path} version ${GCC_VERSION_OUT} cannot be used - use GCC 10 or later")
50+
if(${GCC_VERSION_OUT} VERSION_LESS "11")
51+
message(SEND_ERROR "${compiler_path} version ${GCC_VERSION_OUT} cannot be used - use GCC 11 or later")
5152
endif()
5253
endmacro()
5354

@@ -66,7 +67,7 @@ endif()
6667

6768
if(WIN32)
6869
set(MSVC_MIN_VER 1930)
69-
set(MSVC_MAX_VER 1942)
70+
set(MSVC_MAX_VER 1944)
7071
if(NOT MSVC)
7172
message(SEND_ERROR "No MSVC found! MSVC 2022 version ${MSVC_MIN_VER} to ${MSVC_MAX_VER} is required.")
7273
elseif((MSVC_VERSION LESS MSVC_MIN_VER) OR (MSVC_VERSION GREATER MSVC_MAX_VER))
@@ -122,6 +123,9 @@ if(MSVC)
122123
# Enable C5038 - This is equivalent to gcc's -Werror=reorder, which is enabled by default by gcc -Wall
123124
add_compile_options("/w15038")
124125

126+
# Enable C4062 - Warns about missing enum case in switch statement, equivalent to gcc -Wswitch
127+
add_compile_options("/w14062")
128+
125129
# MSVC panics if an object file contains more than 65,279 sections. this
126130
# happens quite frequently with code that uses templates, such as vectors.
127131
add_compile_options("/bigobj")
@@ -223,13 +227,10 @@ set(DFHACK_DATA_DESTINATION hack)
223227

224228
## where to install things (after the build is done, classic 'make install' or package structure)
225229
# the dfhack libraries will be installed here:
226-
if(UNIX)
227-
# put the lib into DF/hack
228-
set(DFHACK_LIBRARY_DESTINATION ${DFHACK_DATA_DESTINATION})
229-
else()
230-
# windows is crap, therefore we can't do nice things with it. leave the libs on a nasty pile...
231-
set(DFHACK_LIBRARY_DESTINATION .)
232-
endif()
230+
231+
# put the lib into DF/hack
232+
# windows will find it because dfhooks will `AddDllDirectory` the hack folder at runtime
233+
set(DFHACK_LIBRARY_DESTINATION ${DFHACK_DATA_DESTINATION})
233234

234235
# external tools will be installed here:
235236
set(DFHACK_BINARY_DESTINATION .)
@@ -264,7 +265,7 @@ if(UNIX)
264265
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i686")
265266
endif()
266267
string(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
267-
set(CMAKE_INSTALL_RPATH ${DFHACK_LIBRARY_DESTINATION})
268+
set(CMAKE_INSTALL_RPATH "$ORIGIN")
268269
elseif(MSVC)
269270
# for msvc, tell it to always use 8-byte pointers to member functions to avoid confusion
270271
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /vmg /vmm /MP")
@@ -344,6 +345,17 @@ if(BUILD_LIBRARY)
344345
endif()
345346
endif()
346347

348+
# this can be made conditional once we get to better platform support for std::format
349+
INCLUDE(FetchContent)
350+
FetchContent_Declare(
351+
fmt
352+
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
353+
GIT_TAG 790b9389ae99c4ddebdd2736a8602eca1fec684e # 12.1.0 + bugfix for MSVC warning + build time improvements
354+
)
355+
FetchContent_MakeAvailable(fmt)
356+
set(FMTLIB fmt)
357+
add_definitions("-DUSE_FMTLIB")
358+
347359
if(APPLE)
348360
# libstdc++ (GCC 4.8.5 for OS X 10.6)
349361
# fixes crash-on-unwind bug in DF's libstdc++
@@ -425,7 +437,7 @@ macro(dfhack_test name files)
425437
if(BUILD_LIBRARY AND UNIX AND NOT APPLE) # remove this once our MSVC build env has been updated
426438
add_executable(${name} ${files})
427439
target_include_directories(${name} PUBLIC depends/googletest/googletest/include)
428-
target_link_libraries(${name} dfhack gtest)
440+
target_link_libraries(${name} dfhack ${FMTLIB} gtest)
429441
add_test(NAME ${name} COMMAND ${name})
430442
endif()
431443
endmacro()
@@ -523,7 +535,7 @@ if(BUILD_DOCS)
523535

524536
add_custom_command(OUTPUT ${SPHINX_OUTPUT}
525537
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/build.py"
526-
${SPHINX_BUILD_TARGETS} --sphinx="${SPHINX_EXECUTABLE}" -- -q -W
538+
${SPHINX_BUILD_TARGETS} --sphinx="${SPHINX_EXECUTABLE}" --quiet -- -W
527539
DEPENDS ${SPHINX_DEPS}
528540
COMMENT "Building documentation with Sphinx"
529541
)

‎build/.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ _CPack_Packages
77
*.tar.*
88
.cmake
99
win64-cross
10+
dest
11+
DF

0 commit comments

Comments
 (0)