Skip to content

Commit 66a2915

Browse files
authored
Merge branch 'develop' into cleaners_etc
2 parents 54b92fc + 09d3789 commit 66a2915

File tree

270 files changed

+9085
-5549
lines changed

Some content is hidden

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

270 files changed

+9085
-5549
lines changed

.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: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ 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: Install build dependencies
7272
run: |
73-
sudo apt-get update
74-
sudo apt-get install ccache
73+
choco install sccache
74+
pip install Jinja2
75+
- name: Install doc dependencies
76+
if: inputs.docs
77+
run: |
78+
pip install sphinx
7579
- name: Clone DFHack
7680
uses: actions/checkout@v4
7781
with:
@@ -108,49 +112,82 @@ jobs:
108112
ref: main
109113
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
110114
path: depends/steam
115+
- name: Prepare output directories
116+
run: |
117+
mkdir output
118+
mkdir pdb
119+
- name: Get sccache path
120+
run: echo ("SCCACHE_DIR=" + $env:LOCALAPPDATA + "\Mozilla\sccache\cache") >> $env:GITHUB_ENV
111121
- name: Fetch ccache
112122
if: inputs.platform-files
113123
uses: actions/cache/restore@v4
114124
with:
115-
path: build/win64-cross/ccache
125+
path: ${{ env.SCCACHE_DIR }}
116126
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
117127
restore-keys: |
118128
win-msvc-${{ inputs.cache-id }}
119129
win-msvc
120-
- name: Cross-compile
130+
- uses: ilammy/msvc-dev-cmd@v1
131+
- name: Configure DFHack
132+
run: |
133+
cmake `
134+
-S . `
135+
-B build `
136+
-GNinja `
137+
-DDFHACK_BUILD_ARCH=64 `
138+
-DCMAKE_BUILD_TYPE=Release `
139+
-DCMAKE_INSTALL_PREFIX=output `
140+
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
141+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
142+
-DBUILD_PDBS:BOOL=${{ inputs.cache-id == 'release' }} `
143+
-DDFHACK_RUN_URL='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' `
144+
-DBUILD_LIBRARY=${{ inputs.platform-files }} `
145+
-DBUILD_PLUGINS:BOOL=${{ inputs.platform-files && inputs.plugins }} `
146+
-DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} `
147+
-DBUILD_DOCS:BOOL=${{ inputs.docs }} `
148+
-DBUILD_DOCS_NO_HTML:BOOL=${{ !inputs.html }} `
149+
-DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} `
150+
-DBUILD_DFLAUNCH:BOOL=${{ inputs.launchdf }} `
151+
-DBUILD_TESTS:BOOL=${{ inputs.tests }} `
152+
-DBUILD_XMLDUMP:BOOL=${{ inputs.xml-dump-type-sizes }} `
153+
${{ inputs.xml-dump-type-sizes && '-DINSTALL_XMLDUMP:BOOL=1' || '' }}
154+
- name: Build DFHack
121155
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' || '' }}
156+
SCCACHE_CACHE_SIZE: 500M
123157
run: |
124-
cd build
125-
bash -x build-win64-from-linux.sh
158+
ninja install -C build
126159
- name: Finalize cache
127160
run: |
128161
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
162+
sccache --show-stats
163+
sccache --zero-stats
134164
- name: Save ccache
135165
if: inputs.platform-files && !inputs.cache-readonly
136166
uses: actions/cache/save@v4
137167
with:
138-
path: build/win64-cross/ccache
168+
path: ${{ env.SCCACHE_DIR }}
139169
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
140170
- name: Format artifact name
141171
if: inputs.artifact-name
142172
id: artifactname
143173
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
174+
if ("${{ inputs.append-date-and-hash }}" -eq "false") {
175+
"name=${{ inputs.artifact-name }}" | Out-File -Append $env:GITHUB_OUTPUT
176+
} else {
177+
$date = Get-Date -Format "yyyMMdd"
178+
$hash = git rev-parse --short HEAD
179+
"name=${{ inputs.artifact-name}}-$date-$hash" | Out-File -Append $env:GITHUB_OUTPUT
180+
}
181+
- name: Prep pdbs
182+
if: inputs.artifact-name && inputs.cache-id == 'release'
183+
run: |
184+
Get-ChildItem -Recurse -File -Path "build" -Filter *.pdb |
185+
Copy-Item -Destination "pdb"
149186
- name: Prep artifact
150-
if: inputs.artifact-name
151187
run: |
152-
cd build/win64-cross/output
153-
tar cjf ../../../${{ steps.artifactname.outputs.name }}.tar.bz2 .
188+
cd output
189+
7z a -ttar -so -an . |
190+
7z a -si -tbzip2 ../${{ steps.artifactname.outputs.name }}.tar.bz2
154191
- name: Upload artifact
155192
if: inputs.artifact-name
156193
uses: actions/upload-artifact@v4
@@ -162,4 +199,4 @@ jobs:
162199
uses: actions/upload-artifact@v4
163200
with:
164201
name: ${{ steps.artifactname.outputs.name }}_pdb
165-
path: build/win64-cross/pdb
202+
path: pdb

.github/workflows/generate-symbols.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
+quit
135135
tar xjf dfhack-symbols-linux64-build.tar.bz2 -C DF_steam
136136
xml/symbols_gen_linux.sh ${{ inputs.version == 'auto' && '50.0' || inputs.version }} STEAM DF_steam
137-
if [ "${{ inputs.version }}" = "auto" ]; then
137+
if [ "${{ inputs.version }}" == "auto" ]; then
138138
while pgrep dwarfort; do
139139
echo "waiting for DF to exit"
140140
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
# steam_branch: leave blank if no DFHack steam push is desired
2222
include:
2323
- df_steam_branch: public
24-
- df_steam_branch: beta
25-
- df_steam_branch: experimental
26-
structures_ref: experimental
27-
dfhack_ref: experimental
28-
steam_branch: experimental
24+
# - df_steam_branch: beta
25+
# - df_steam_branch: experimental
26+
# structures_ref: experimental
27+
# dfhack_ref: experimental
28+
# steam_branch: experimental
2929
steps:
3030
- name: Fetch state
3131
uses: actions/cache/restore@v4

.pre-commit-config.yaml

Lines changed: 2 additions & 2 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,7 +20,7 @@ repos:
2020
args: ['--fix=lf']
2121
- id: trailing-whitespace
2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.32.1
23+
rev: 0.36.0
2424
hooks:
2525
- id: check-github-workflows
2626
- repo: https://github.com/Lucas-C/pre-commit-hooks

CMakeLists.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_policy(SET CMP0048 NEW)
66
cmake_policy(SET CMP0074 NEW)
77

88
# set up versioning.
9-
set(DF_VERSION "51.10")
9+
set(DF_VERSION "53.10")
1010
set(DFHACK_RELEASE "r1")
1111
set(DFHACK_PRERELEASE FALSE)
1212

@@ -46,8 +46,8 @@ option(REMOVE_SYMBOLS_FROM_DF_STUBS "Remove debug symbols from DF stubs. (Reduce
4646
macro(CHECK_GCC compiler_path)
4747
execute_process(COMMAND ${compiler_path} -dumpversion OUTPUT_VARIABLE GCC_VERSION_OUT)
4848
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")
49+
if(${GCC_VERSION_OUT} VERSION_LESS "11")
50+
message(SEND_ERROR "${compiler_path} version ${GCC_VERSION_OUT} cannot be used - use GCC 11 or later")
5151
endif()
5252
endmacro()
5353

@@ -66,7 +66,7 @@ endif()
6666

6767
if(WIN32)
6868
set(MSVC_MIN_VER 1930)
69-
set(MSVC_MAX_VER 1943)
69+
set(MSVC_MAX_VER 1944)
7070
if(NOT MSVC)
7171
message(SEND_ERROR "No MSVC found! MSVC 2022 version ${MSVC_MIN_VER} to ${MSVC_MAX_VER} is required.")
7272
elseif((MSVC_VERSION LESS MSVC_MIN_VER) OR (MSVC_VERSION GREATER MSVC_MAX_VER))
@@ -122,6 +122,9 @@ if(MSVC)
122122
# Enable C5038 - This is equivalent to gcc's -Werror=reorder, which is enabled by default by gcc -Wall
123123
add_compile_options("/w15038")
124124

125+
# Enable C4062 - Warns about missing enum case in switch statement, equivalent to gcc -Wswitch
126+
add_compile_options("/w14062")
127+
125128
# MSVC panics if an object file contains more than 65,279 sections. this
126129
# happens quite frequently with code that uses templates, such as vectors.
127130
add_compile_options("/bigobj")
@@ -344,6 +347,17 @@ if(BUILD_LIBRARY)
344347
endif()
345348
endif()
346349

350+
# this can be made conditional once we get to better platform support for std::format
351+
INCLUDE(FetchContent)
352+
FetchContent_Declare(
353+
fmt
354+
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
355+
GIT_TAG 790b9389ae99c4ddebdd2736a8602eca1fec684e # 12.1.0 + bugfix for MSVC warning + build time improvements
356+
)
357+
FetchContent_MakeAvailable(fmt)
358+
set(FMTLIB fmt)
359+
add_definitions("-DUSE_FMTLIB")
360+
347361
if(APPLE)
348362
# libstdc++ (GCC 4.8.5 for OS X 10.6)
349363
# fixes crash-on-unwind bug in DF's libstdc++
@@ -425,7 +439,7 @@ macro(dfhack_test name files)
425439
if(BUILD_LIBRARY AND UNIX AND NOT APPLE) # remove this once our MSVC build env has been updated
426440
add_executable(${name} ${files})
427441
target_include_directories(${name} PUBLIC depends/googletest/googletest/include)
428-
target_link_libraries(${name} dfhack gtest)
442+
target_link_libraries(${name} dfhack ${FMTLIB} gtest)
429443
add_test(NAME ${name} COMMAND ${name})
430444
endif()
431445
endmacro()
@@ -523,7 +537,7 @@ if(BUILD_DOCS)
523537

524538
add_custom_command(OUTPUT ${SPHINX_OUTPUT}
525539
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/build.py"
526-
${SPHINX_BUILD_TARGETS} --sphinx="${SPHINX_EXECUTABLE}" -- -q -W
540+
${SPHINX_BUILD_TARGETS} --sphinx="${SPHINX_EXECUTABLE}" --quiet -- -W
527541
DEPENDS ${SPHINX_DEPS}
528542
COMMENT "Building documentation with Sphinx"
529543
)

build/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ _CPack_Packages
77
*.tar.*
88
.cmake
99
win64-cross
10+
dest

data/art/design.png

241 Bytes
Loading

depends/dfhooks

0 commit comments

Comments
 (0)