Compare commits

..

2 commits

Author SHA1 Message Date
Charles Dang
037a8214f7 asdfghjkl 2024-03-11 17:43:27 -04:00
Charles Dang
f415ca9de1 [WIP] New tweening-based API for the outro screen 2024-03-11 17:41:24 -04:00
22154 changed files with 613601 additions and 755075 deletions

View file

@ -1,4 +0,0 @@
---
Checks: '-*,modernize-use-nullptr,performance-unnecessary-value-param'
WarningsAsErrors: true
...

View file

@ -13,7 +13,3 @@ indent_size = 4
[*.{cpp,hpp}]
indent_style = tab
indent_size = 4
[*.lua]
indent_style = tab
indent_size = 4

View file

@ -1,5 +1,5 @@
name: Bug Report
description: Create a bug report to help us improve the game.
description: Create a report to help us improve the game.
labels: ['Bug']
body:
@ -8,11 +8,17 @@ body:
attributes:
label: Game and System Information
description: |
- What version of the game are you running? (If you built wesnoth yourself, mention the exact commit)
- What version of the game are you running?
- Where did you download it from? (Steam, Mac App Store, our website, built from source, etc.)
- If you're using a custom build, what compiler did you use, and what commit did you build at?
- What OS are you running?
value: |
- **Version:**
- **Downloaded from:**
- **Build info:**
- **OS:**
validations:
required: true
- type: textarea
id: description

View file

@ -11,7 +11,7 @@ jobs:
checks: # checks that don't need a wesnoth binary
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
image: wesnoth/wesnoth:2204-master
options: --tty # docker create options
env:
CLICOLOR_FORCE: 1
@ -31,9 +31,6 @@ jobs:
- name: Whitespace and WML indentation check
if: success() || failure()
run: ./utils/CI/fix_whitespace.sh; git status; git diff --exit-code
- name: WML missing images check
if: success() || failure()
run: utils/CI/check_wml_images.sh
- name: Run luacheck
if: success() || failure()
run: luacheck .
@ -41,33 +38,31 @@ jobs:
if: success() || failure()
run: doxygen doc/doxygen/Doxyfile
copyright: # check takes a bit longer and does not need to run in docker (sound/music only)
copyright: # check takes a bit longer and does not need to run in docker
runs-on: ubuntu-latest
steps:
- { uses: actions/checkout@v4, with: { fetch-depth: 50 } }
- name: Sound/Music copyright check
run: ./update_copyrights
- name: Copyright check
run: ./update_copyrights --output=
ubuntu:
strategy:
fail-fast: false
matrix:
include:
# the check for WML tests below may need to be adjusted if configurations are changed
- { cfg: debug, tool: scons, cc: gcc, cxx: g++, std: 17, lto: false, sys_lua: false }
- { cfg: release, tool: cmake, cc: gcc, cxx: g++, std: 20, lto: true, sys_lua: false }
- { cfg: release, tool: cmake, cc: clang, cxx: clang++, std: 17, lto: true, sys_lua: true }
- { tool: scons, cc: gcc, cxx: g++, cfg: debug, lto: false, sys_lua: false }
- { tool: cmake, cc: clang, cxx: clang++, cfg: release, lto: true, sys_lua: true }
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
image: wesnoth/wesnoth:2204-master
options: --tty # docker create options
env:
TOOL: ${{ matrix.tool }}
CFG: ${{ matrix.cfg }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CXX_STD: ${{ matrix.std }}
CXX_STD: 17
LTO: ${{ matrix.lto }}
SYS_LUA: ${{ matrix.sys_lua }}
CLICOLOR_FORCE: 1
@ -90,15 +85,10 @@ jobs:
scons "$@" build="$CFG" ctool="$CC" cxxtool="$CXX" cxx_std="$CXX_STD" \
extra_flags_config="-pipe" forum_user_handler=true \
nls=false enable_lto="$LTO" system_lua="$SYS_LUA" force_color=true \
jobs=2 --debug=time glibcxx_debug=true glibcxx_assertions=true compile_db=true
jobs=2 --debug=time glibcxx_debug=true glibcxx_assertions=true
}
build strict=true wesnoth boost_unit_tests
build cdb
# disable all warnings since we have coverage on them in a standard build, and clang-tidy
# triggers false positive compiler warnings that clang itself won't
run-clang-tidy -quiet -use-color -j 2 -extra-arg="-w" -warnings-as-errors='*' '^(?!.*src/modules/|.*build/)'
apt remove -y -qq libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
build strict=false wesnothd campaignd
@ -109,7 +99,7 @@ jobs:
cmake "$@" -DCMAKE_BUILD_TYPE="$CFG" -DCXX_STD="$CXX_STD" \
-DEXTRA_FLAGS_CONFIG="-pipe" -DENABLE_MYSQL=true \
-DENABLE_NLS=false -DENABLE_LTO="$LTO" -DFORCE_COLOR_OUTPUT=true -DLTO_JOBS=2 \
-DENABLE_SYSTEM_LUA="$SYS_LUA -DCLANG_TIDY=true" .
-DENABLE_SYSTEM_LUA="$SYS_LUA" .
}
rm -R /usr/local/lib/cmake
rm /usr/local/lib/libboost*
@ -128,27 +118,18 @@ jobs:
if: success() || steps.build.outcome == 'success'
run: |
./wesnoth --version
for opt in data userdata usercache
for opt in config data userconfig userdata
do
output=$(./wesnoth --nobanner --"$opt"-path)
if [ "$output" = "" ]; then printf 'option --%s-path prints nothing to stdout!\n' "$opt" >&2; exit 1; fi
if [ "$output" = "" ]; then printf 'option --%s-path prints nothing to stdout!' "$opt" >&2; exit 1; fi
printf '%s-path: %s\n' "$opt" "$output"
done
- name: WML validation
# only run on release builds (takes ~10 times as long on debug); since there are multiple release builds
# but running the following tests multiple times doesn't make much sense use cc==clang as the check
if: matrix.cc == 'clang' && (success() || steps.build.outcome == 'success')
if: success() || steps.build.outcome == 'success'
run: ./utils/CI/schema_validation.sh
- name: Run WML tests
# only run on release builds (takes ~6 times as long on debug)
if: matrix.cc == 'clang' && (success() || steps.build.outcome == 'success')
run: ./run_wml_tests -v -v -g -c -t 20 -bt 1000 -a=--userdata-dir=ud
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cc == 'clang' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-Linux
path: ud
if: success() || steps.build.outcome == 'success'
run: ./run_wml_tests -g -c -t 20 -bt 1000
- name: Run play tests
if: success() || steps.build.outcome == 'success'
run: ./utils/CI/play_test_executor.sh
@ -212,17 +193,17 @@ jobs:
options: --tty --cap-add=ALL --privileged # docker create options
steps:
- { uses: actions/checkout@v4, with: { submodules: "recursive", fetch-depth: 500, fetch-tags: true } }
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Flatpak
run: |
# write to an ignored filename so the build is not marked as modified
jq '.modules |= map(select(.name == "wesnoth").sources[0]={type:"dir",path:"."})' packaging/flatpak/org.wesnoth.Wesnoth.json > wesnoth-manifest.json
git config --global --add safe.directory "$PWD"
branch=ci-$(git describe || git log -n 1 --format=%h) # if git describe fails fall back to the commit hash
flatpak-builder --force-clean --default-branch="$branch" --disable-rofiles-fuse --jobs=2 wesnoth-app wesnoth-manifest.json
flatpak build-export export wesnoth-app "$branch"
flatpak build-bundle export wesnoth.flatpak org.wesnoth.Wesnoth "$branch" --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
jq '.modules |= map(select(.name == "wesnoth").sources[0]={"type":"dir","path":"."}) | ."build-options".env.FLATPAK_BUILDER_N_JOBS="2"' packaging/flatpak/org.wesnoth.Wesnoth.json > wesnoth-manifest.json
flatpak-builder --force-clean --default-branch=ci --disable-rofiles-fuse wesnoth-app wesnoth-manifest.json
flatpak build-export export wesnoth-app ci
flatpak build-bundle export wesnoth.flatpak org.wesnoth.Wesnoth ci --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
- name: Upload flatpak bundle
uses: actions/upload-artifact@v4
@ -233,7 +214,7 @@ jobs:
translations:
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
image: wesnoth/wesnoth:2204-master
env:
LANGUAGE: en_US.UTF-8
LANG: en_US.UTF-8
@ -253,7 +234,7 @@ jobs:
make pot-update; echo "Ran make pot-update"
make mo-update; echo "Ran make mo-update"
make clean
scons translations build=release --debug=time nls=true jobs=2; echo "Ran scons translations"
scons pot-update; echo "Ran scons pot-update"
scons update-po4a; echo "Ran scons update-po4a"
@ -263,8 +244,8 @@ jobs:
strategy:
fail-fast: false
matrix:
cfg: [ Release ]
runs-on: macos-13
cfg: [ Debug, Release ]
runs-on: macos-11.0
env:
CFG: ${{ matrix.cfg }}
@ -288,7 +269,6 @@ jobs:
[ -x "build/$CFG/unit_tests" ] || { printf 'Failed to build unit test executable!\n' >&2; exit 1; }
- name: Create disk image
working-directory: projectfiles/Xcode
continue-on-error: true # allow failures since this is not essential and it does fail spuriously (hdiutil: create failed - Resource busy)
run: hdiutil create -volname "Wesnoth_$CFG" -fs 'HFS+' -srcfolder "build/$CFG" -ov -format UDBZ "Wesnoth_${CFG}.dmg"
- name: Upload disk image
uses: actions/upload-artifact@v4
@ -297,13 +277,7 @@ jobs:
path: projectfiles/Xcode/Wesnoth_${{ matrix.cfg }}.dmg
- name: Run WML tests
if: matrix.cfg == 'Release'
run: ./run_wml_tests -g -c -t 30 -bt 350 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth" -a=--userdata-dir="$PWD/ud"
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-MacOS
path: ud
run: ./run_wml_tests -g -c -t 30 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth"
- name: Run unit tests
run: ./run_boost_tests --path=projectfiles/Xcode/build/"$CFG" --executable=unit_tests
@ -311,7 +285,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cfg: [Release]
cfg: [Debug, Release]
env:
CFG: ${{ matrix.cfg }}
VCPKG_FEATURE_FLAGS: dependencygraph
@ -320,7 +294,7 @@ jobs:
defaults:
run:
shell: cmd
runs-on: windows-latest
runs-on: windows-2019
steps:
- { uses: actions/checkout@v4, with: { submodules: "recursive" } }
@ -343,21 +317,14 @@ jobs:
run: cmake -DCMAKE_BUILD_TYPE=%CFG% -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true
-DENABLE_TESTS=true -DENABLE_MYSQL=false -DENABLE_NLS=false
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_INSTALL_OPTIONS=--debug
-DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 17 2022" .
-DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 16 2019" .
- name: Build wesnoth, wesnothd, campaignd and unit tests
run: MSBuild.exe wesnoth.sln -p:Configuration=%CFG%
- name: Run WML unit tests
if: matrix.cfg == 'Release'
run: python run_wml_tests -v -g -c -t 20 -p %CFG%/wesnoth.exe -a=--userdata-dir=ud
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-Windows
path: ud
run: python run_wml_tests -v -g -c -t 20 -p %CFG%/wesnoth.exe
# run after all other jobs have completed to check overall build status
notification:

View file

@ -6,7 +6,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
workflow_dispatch:
jobs:
analyze:
@ -16,7 +15,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
@ -50,12 +49,11 @@ jobs:
- name: Install dependencies
if: matrix.language == 'cpp'
run: |
utils/autorevision.sh -t h > src/revision.h
sudo apt update
sudo apt install scons libboost-system1.83-dev libboost-filesystem1.83-dev libboost-iostreams1.83-dev \
libboost-serialization1.83-dev libboost-locale1.83-dev libboost-regex1.83-dev libboost-random1.83-dev \
libboost-program-options1.83-dev libboost-thread1.83-dev libboost-context1.83-dev libboost-test-dev \
libboost-coroutine1.83-dev libboost-graph1.83-dev libasio-dev libsdl2-dev libsdl2-image-dev \
sudo apt install scons libboost-system1.74-dev libboost-filesystem1.74-dev libboost-iostreams1.74-dev \
libboost-serialization1.74-dev libboost-locale1.74-dev libboost-regex1.74-dev libboost-random1.74-dev \
libboost-program-options1.74-dev libboost-thread1.74-dev libboost-context1.74-dev libboost-test-dev \
libboost-coroutine1.74-dev libboost-graph1.74-dev libasio-dev libsdl2-dev libsdl2-image-dev \
libsdl2-mixer-dev libvorbis-dev libpango1.0-dev libssl-dev libcurl4-openssl-dev liblua5.4-dev
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
- name: Autobuild

View file

@ -1,88 +0,0 @@
name: Image metadata check CI
on:
push:
branches: [ master ]
paths: [ '**.webp', '**.png', '**.jpg', '**.jpeg' ]
pull_request:
paths: [ '**.webp', '**.png', '**.jpg', '**.jpeg' ]
permissions:
contents: read
jobs:
build:
name: Image Metadata
runs-on: ubuntu-latest
env:
BASE_SHA: ${{ github.event_name == 'push' && github.event.before || github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event_name == 'push' && github.event.after || github.event.pull_request.head.sha }}
steps:
- name: exiftool installation
run: |
sudo apt-get install --assume-yes exiftool
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: check image EXIF metadata
run: |
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.(webp|je?pg)$')
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check Artist tag, fail if missing
artist="$(exiftool -p '$Artist' "$file")"
if [ "$artist" ]; then
printf 'Artist tag in %s is %s\n' "$file" "$artist"
else
printf 'no Artist EXIF tag in %s\n' "$file"
exit 1
fi
# check Copyright tag, fail if missing or wrong type
copyright="$(exiftool -p '$Copyright' "$file")"
case $copyright in
'GNU GPL v2+'|'CC BY-SA 4.0'|CC0)
printf 'Copyright tag in %s is %s\n' "$file" "$copyright"
;;
'')
printf 'no Copyright EXIF tag in %s\n' "$file"
exit 1
;;
*)
printf 'Copyright tag %s in file %s is not an accepted license! Must be one of: "GNU GPL v2+", "CC BY-SA 4.0", "CC0"\n' "$copyright" "$file"
exit 1
;;
esac
done
- name: check png XMP metadata
run: |
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.png$')
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check Creator tag, fail if missing
artist="$(exiftool -p '$XMP:Creator' "$file")"
if [ "$artist" ]; then
printf 'Creator tag in %s is %s\n' "$file" "$artist"
else
printf 'no Creator XMP tag in %s\n' "$file"
exit 1
fi
# check Rights tag, fail if missing or wrong type
copyright="$(exiftool -p '$XMP:Rights' "$file")"
case $copyright in
'GNU GPL v2+'|'CC BY-SA 4.0'|CC0)
printf 'Rights tag in %s is %s\n' "$file" "$copyright"
;;
'')
printf 'no Rights XMP tag in %s\n' "$file"
exit 1
;;
*)
printf 'Rights tag %s in file %s is not an accepted license! Must be one of: "GNU GPL v2+", "CC BY-SA 4.0", "CC0"\n' "$copyright" "$file"
exit 1
;;
esac
done

4
.gitignore vendored
View file

@ -127,7 +127,6 @@ wesnoth.plg
*.exe
*.dll
*.so
compile_commands.json
# library files
.libs
@ -166,8 +165,6 @@ po/**/Makefile*
data/tools/unit_tree/**/files
data/tools/unit_tree/**/reports
data/tools/unit_tree/**/Locale
data/tools/macro_reference.html
about.wiki
# doc
doc/doxygen/html
@ -222,7 +219,6 @@ config.h
callgrind.out.*
data/dist
clean.sh
widgets_tested.log
# clangd cache
.cache/clangd

View file

@ -1,4 +1,4 @@
# set minimum version
# set minimum version
cmake_minimum_required(VERSION 3.14)
project(wesnoth)
@ -171,7 +171,6 @@ option(GLIBCXX_ASSERTIONS "Whether to define _GLIBCXX_ASSERTIONS" OFF)
option(GLIBCXX_DEBUG "Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC. Requires a version of Boost's program_options that's compiled with __GLIBCXX_DEBUG too." OFF)
option(ENABLE_POT_UPDATE_TARGET "Enables the tools to update the pot files and manuals. This target has extra dependencies." OFF)
option(FORCE_COLOR_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
option(CLANG_TIDY "Enable clang-tidy linter checks." OFF)
if(UNIX AND NOT APPLE AND NOT CYGWIN)
option(ENABLE_NOTIFICATIONS "Enable Window manager notification messages" ON)
@ -256,11 +255,6 @@ if(NOT MSVC)
endif()
endif()
### Enable clang-tidy linting
if (CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy -Wno-unknown-warning-option")
endif()
### Set the final compiler flags.
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CXX_FLAGS_USER}")
@ -480,7 +474,7 @@ if(NOT MSVC)
else()
set(CMAKE_CXX_FLAGS "/W3 /WX /wd4503 /wd4351 /wd4250 /wd4244 /wd4267 /we4239 /wd4275 /EHsc /utf-8 /Zc:__cplusplus" CACHE STRING "Global flags used by the CXX compiler during all builds." FORCE)
set(CMAKE_C_FLAGS "/WX" CACHE STRING "Global flags used by the C compiler during all builds." FORCE)
add_definitions(-D_WIN32_WINNT=0x0A00 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG_LUA")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
@ -533,7 +527,7 @@ if(ENABLE_GAME OR ENABLE_TESTS)
find_package(VorbisFile REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Fontconfig REQUIRED)
find_package(SDL2 2.0.18 REQUIRED)
find_package(SDL2 2.0.10 REQUIRED)
if(NOT MSVC)
# for everything else, use pkgconfig
# SDL2_image and SDL2_mixer don't seem to have any cmake configuration available at all

View file

@ -2,7 +2,7 @@
## Prerequisites
Wesnoth requires a compiler with sufficient C++17 support such as GCC 11 and
Wesnoth requires a compiler with sufficient C++17 support such as GCC 8 and
later, or a version of Clang with equivalent support.
You'll need to have these libraries and their development headers installed in
@ -19,9 +19,8 @@ order to build Wesnoth:
* System
* Coroutine
* Graph
* Charconv (This requires boost 1.85 or higher and is optional but reccomended especially for clang builds)
* SDL2 libraries:
* SDL2 >= 2.0.18 (macOS: 2.0.22 due to needing https://github.com/libsdl-org/SDL/commit/3bebdaccb7bff8c40438856081d404a7ce3def30)
* SDL2 >= 2.0.10 (macOS: 2.0.22 due to needing https://github.com/libsdl-org/SDL/commit/3bebdaccb7bff8c40438856081d404a7ce3def30)
* SDL2_image >= 2.0.2 (with PNG, JPEG, and WEBP support)
* SDL2_mixer >= 2.0.0 (with Ogg Vorbis support)
* Fontconfig >= 2.4.1
@ -174,7 +173,7 @@ false value.
| `strict=<boolean>` | `ENABLE_STRICT_COMPILATION=<boolean>` | Whether to treat compiler warnings as errors or not. Primarily intended for developers. |
| `prefsdir=<directory name>` | `PREFERENCES_DIR=<directory name>` | Hardcoded user preferences and user data directory. The default is to leave this unspecified so that Wesnoth will use separate XDG paths such as .config/wesnoth and .local/share/wesnoth/<version> for its user preferences and data, respectively. |
| `cxxtool=<program>` | `CMAKE_CXX_COMPILER=<program>` | Specifies which C++ compiler to use. By default, the system's default C++ compiler will be automatically selected during configuration. |
| `ccache=<boolean>` | `CMAKE_CXX_COMPILER_LAUNCHER=ccache` | Whether to run the compiler through ccache first. Useful if the compiler executable is not a symbolic link to ccache. Requires ccache to be installed first. If using CMake, use CMAKE_C_COMPILER and CMAKE_CXX_COMPILER instead. |
| `ccache=<boolean>` | | Whether to run the compiler through ccache first. Useful if the compiler executable is not a symbolic link to ccache. Requires ccache to be installed first. If using CMake, use CMAKE_C_COMPILER and CMAKE_CXX_COMPILER instead. |
| `extra_flags_<buildtype>=<flags>` `extra_flags_config=<flags>` | `CXX_FLAGS_USER=<flags>` | Additional compiler flags to use when compiling a specific build type (SCons-only). To apply the same flags to all builds, use extra_flags_config (SCons) or CXX_FLAGS_USER (CMake) without a build type suffix. Alternatively, you may specify your flags in the CXXFLAGS environment variable. |
| `fifodir=<full path>` `server_uid=<UID>` `server_gid=<GID>` | `FIFO_DIR=<full path>` `SERVER_UID=<UID>` `SERVER_GID=<GID>` | Directory and owner id for the wesnothd control FIFO file. This is relevant only if you wish to be able to communicate with a local wesnothd instance through a named pipe. You must run wesnothd with the same UID specified at build time for this to work. |
| `enable_lto=<boolean>` | `ENABLE_LTO=<boolean>` | Controls using Link Time Optimization. Enabling will result in a smaller, faster executable at the cost of increased time to compile and link. For cmake, use LTO_JOBS=N tells how many threads to use during linking. |

View file

@ -3,7 +3,7 @@
|Branch|CI status|
|------|---------|
|Master|[![CI](https://github.com/wesnoth/wesnoth/actions/workflows/ci-main.yml/badge.svg)](https://github.com/wesnoth/wesnoth/actions/workflows/ci-main.yml?query=branch%3Amaster)|
|1.18|[![CI](https://github.com/wesnoth/wesnoth/actions/workflows/ci-main.yml/badge.svg?branch=1.18)](https://github.com/wesnoth/wesnoth/actions/workflows/ci-main.yml?query=branch%3A1.18)|
|1.16|[![CI](https://github.com/wesnoth/wesnoth/actions/workflows/ci-main.yml/badge.svg?branch=1.16)](https://github.com/wesnoth/wesnoth/actions/workflows/ci-main.yml?query=branch%3A1.16)|
About
=====
@ -50,7 +50,7 @@ Wesnoth can be played on Windows, macOS, and Linux, and can be installed using:
* standalone installers on [SourceForge](https://sourceforge.net/projects/wesnoth/files/) (Windows and macOS)
* [Flatpak](https://flathub.org/apps/details/org.wesnoth.Wesnoth) (Linux)
Additionally, Wesnoth is available for [iOS](https://apps.apple.com/us/app/battle-for-wesnoth/id575852062) and [Android](https://sourceforge.net/projects/wesnoth-on-android/files/).
Additionally, Wesnoth is available for [iOS](https://apps.apple.com/us/app/battle-for-wesnoth/id575852062) and [Android](https://play.google.com/store/apps/details?id=it.alessandropira.wesnoth114).
To build the game from source, see [INSTALL](/INSTALL.md) for instructions.

View file

@ -120,7 +120,6 @@ opts.AddVariables(
BoolVariable("OS_ENV", "Forward the entire OS environment to scons", False),
BoolVariable("history", "Clear to disable GNU history support in lua console", True),
BoolVariable('force_color', 'Always produce ANSI-colored output (GNU/Clang only).', False),
BoolVariable('compile_db', 'Produce a compile_commands.json file.', False),
)
#
@ -190,11 +189,6 @@ if env['distcc']:
if env['ccache']: env.Tool('ccache')
if env['compile_db']:
env.Tool('compilation_db')
cdb = env.CompilationDatabase()
Alias('cdb', cdb)
boost_version = "1.67"
def SortHelpText(a, b):
@ -232,7 +226,6 @@ You can make the following special build targets:
update-po = merge message catalog templates with localized message catalogs for particular lingua
update-po4a = update translations of manual and manpages
af bg ca ... = linguas for update-po
translations = build all translations
dist = make distribution tarball as wesnoth.tar.bz2 (*).
data-dist = make data tarball as wesnoth-data.tar.bz2 (*).
binary-dist = make data tarball as wesnoth-binaries.tar.bz2 (*).
@ -370,7 +363,7 @@ if env["prereqs"]:
def have_sdl_other():
return \
conf.CheckSDL2('2.0.18') & \
conf.CheckSDL2('2.0.10') & \
conf.CheckSDL2Mixer() & \
conf.CheckSDL2Image()
@ -385,7 +378,6 @@ if env["prereqs"]:
conf.CheckBoost("program_options", require_version = boost_version) & \
conf.CheckBoost("random", require_version = boost_version) & \
conf.CheckBoost("smart_ptr", header_only = True) & \
conf.CheckBoostCharconv() & \
CheckAsio(conf) & \
conf.CheckBoost("thread") & \
conf.CheckBoost("locale") & \
@ -672,7 +664,7 @@ for env in [test_env, client_env, env]:
env[d] = os.path.join(env["prefix"], env[d])
if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0A00"])
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0601"])
if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Cocoa") # Cocoa GUI

0
about.wiki Normal file
View file

View file

@ -81,7 +81,7 @@ code_blocks_target_translations = {
# XCode #
#=======#
def modify_xcode(filename, targets, remove):
def add_to_xcode(filename, targets):
"""Add the given file to the specified targets.
"""
projectfile = rootdir.joinpath(
@ -103,47 +103,36 @@ def modify_xcode(filename, targets, remove):
f"Could not find target '{tname}' in Xcode project file")
# groups are organized by directory structure under "src"
# except for tests, which have a separate root, "tests"
if pathlib.Path("tests") in filename.parents:
src_groups = project.get_groups_by_name("tests")
else:
src_groups = project.get_groups_by_name("src")
src_groups = project.get_groups_by_name("src")
if len(src_groups) != 1:
raise Exception("problem finding 'src' group in xcode project")
src_group = src_groups[0]
parent_group = src_group
for d in filename.parts[:-1]:
if d == "tests":
continue
found_groups = project.get_groups_by_name(d, parent=parent_group)
if len(found_groups) != 1:
groupname = parent_group.get_name()
raise Exception(f"problem finding '{d}' group in '{groupname}'")
parent_group = found_groups[0]
if remove :
# Remove from all targets if we want to remove
for file in project.get_files_by_name(filename.name, parent=parent_group):
project.remove_file_by_id(file.get_id())
else:
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return
# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
# that's done, save the file
project.save()
@ -153,7 +142,7 @@ def modify_xcode(filename, targets, remove):
# source_lists #
#==============#
def modify_source_list(filename, source_list, remove):
def add_to_source_list(filename, source_list):
source_list_file = rootdir.joinpath("source_lists", source_list)
sl_lines = open(source_list_file).readlines()
file_line = filename.as_posix() + '\n'
@ -162,16 +151,12 @@ def modify_source_list(filename, source_list, remove):
if filename.suffix != ".cpp":
return
if remove:
if file_line in sl_lines: sl_lines.remove(file_line)
else:
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
sl_lines.append(file_line)
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
sl_lines.append(file_line)
sl_lines.sort()
open(source_list_file, 'w').writelines(sl_lines)
@ -179,18 +164,13 @@ def add_to_source_lists(filename, targets):
translated_targets = [source_list_target_translations[t] for t in targets]
print(" source_list targets:", translated_targets)
for t in translated_targets:
modify_source_list(filename, t, False)
def remove_from_source_lists(filename):
# remove from all tagerts if -r was specified.
for t in source_list_target_translations.values():
modify_source_list(filename, t, True)
add_to_source_list(filename, t)
#==============#
# Code::Blocks #
#==============#
def modify_code_blocks_target(filename, target, remove):
def add_to_code_blocks_target(filename, target):
cbp_file = rootdir.joinpath(
"projectfiles",
"CodeBlocks",
@ -204,33 +184,30 @@ def modify_code_blocks_target(filename, target, remove):
elem = f"\t\t<Unit filename=\"{filename_for_cbp}\" />\n"
if remove:
if elem in cbp_lines: cbp_lines.remove(elem)
else:
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return
# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
index += 1
cbp_lines.insert(index, elem)
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
break
index += 1
cbp_lines.insert(index, elem)
open(cbp_file, 'w').writelines(cbp_lines)
def modify_code_blocks(filename, targets, remove):
translated_targets = code_blocks_target_translations.values() if remove else [code_blocks_target_translations[t] for t in targets]
def add_to_code_blocks(filename, targets):
translated_targets = [code_blocks_target_translations[t] for t in targets]
print(" code::blocks targets:", translated_targets)
for t in translated_targets:
modify_code_blocks_target(filename, t, remove)
add_to_code_blocks_target(filename, t)
def sanity_check_existing_cpp_hpp(filenames):
"""
@ -302,8 +279,6 @@ if __name__ == "__main__":
help="which build targets to add the file to")
ap.add_argument("--no-checks", action="store_true",
help="do not check whether the files exist, etc")
ap.add_argument("-r", "--remove", action="store_true",
help="remove the specified files from projectfiles instead of adding them, --target is then ignored")
# By default, recognise --help too
options = ap.parse_args()
@ -320,13 +295,7 @@ if __name__ == "__main__":
sanity_check_existing_cpp_hpp(filenames)
for filename in filenames:
if options.remove:
print(f"removing '{filename}' from all targets")
modify_xcode(filename, options.target, True)
remove_from_source_lists(filename)
modify_code_blocks(filename, options.target, True)
else:
print(f"adding '{filename}' to targets: {options.target}")
modify_xcode(filename, options.target, False)
add_to_source_lists(filename, options.target)
modify_code_blocks(filename, options.target, False)
print(f"adding '{filename}' to targets: {options.target}")
add_to_xcode(filename, options.target)
add_to_source_lists(filename, options.target)
add_to_code_blocks(filename, options.target)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1,014 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 B

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 174 B

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