Skip to content

Remove Boost dependency, upgrade to C++20 - #179

Merged
KevinHake merged 32 commits into
masterfrom
devbox-and-cleanup
Mar 24, 2026
Merged

KevinHake merged 32 commits into
masterfrom
devbox-and-cleanup

Conversation

@KevinHake

Copy link
Copy Markdown
Collaborator

Summary

  • Replace all Boost usages with C++20 standard library or lightweight alternatives:
    • boost::filesystemstd::filesystem
    • boost::program_options → simple OpaqueArgs parser
    • boost::interprocess::bufferstreamSpanStream
    • boost::hash_combine → inline hash_combine helper with std::hash
    • boost::crc_32_type → standalone CRC32 implementation
    • boost::adaptorsstd::views and structured bindings
    • boost::asio → standalone Asio (header-only submodule)
  • Replace spdlog with minimal SimpleLogger (~150 lines) to fix C++20 incompatibility
  • Replace png++ with minimal libpng wrapper
  • Upgrade GLSL shaders from version 130 to 150 (macOS compatibility)
  • Upgrade from C++17 to C++20
  • Add devbox.json for reproducible dev environment
  • Fix DiscreteRect::bottom() bug (returned y + width instead of y + height)
  • Add missing #include <algorithm> across 31 source files

Test plan

  • Linux CI builds (gcc-12, clang-15) in Debug and Release
  • Windows CI builds (MSVC 2022, MinGW64) in Debug and Release
  • All 1160 unit tests pass
  • Verify in-game: units render, pathfinding works, basic gameplay functional

🤖 Generated with Claude Code

KevinHake and others added 30 commits March 20, 2026 17:44
   png++ 0.2.9 is unmaintained (2015) and broken with modern libc++.
   Since we only used it for simple "create image, set pixels, write PNG"
   operations, replace it with a ~150 line header-only wrapper around
   libpng directly. This removes the libs/png++-0.2.9 dependency.
  - Add devbox.json with all C++ build dependencies
  - CMakeLists.txt: fall back to find_package(Protobuf) when the
    vendored protobuf build is not present, remove Boost static lib     requirement, handle GLEW target name differences across platforms
  - Update Boost.Asio usage for 1.87+: io_service -> io_context,
    resolver::query removal, expires_from_now -> expires_after,
    io_context.post -> boost::asio::post
  - Update protobuf usage: ByteSize() -> ByteSizeLong()
  - Fix unique_ptr<Derived> -> shared_ptr<Base> conversion for newer     libc++ strictness
  - Fix png_write.h: add missing <fstream> include, fix const_cast
  - Add CLAUDE.md and update README with devbox build instructions
macOS only supports GLSL 150+ (OpenGL 3.2 Core profile), not GLSL 130.
The shaders already used modern syntax so only the version directive needed updating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Modern GCC/libstdc++ no longer transitively includes <algorithm>
through other standard library headers, causing build failures
for std::find, std::find_if, std::sort, std::clamp, etc.
Add path-change detection to build-protobuf.sh so moving the repo
automatically triggers a clean rebuild instead of failing with stale
libtool paths.
The bug had no current callers but would produce wrong bounds
for any non-square rectangle.
CMake now generates a run.sh wrapper on Linux that prepends system
lib paths so the Nix-built binary can find the GPU driver. Updated
README with consolidated Linux/macOS build instructions and devbox
setup.
Drop the Boost.Filesystem dependency in favor of the C++17 standard
library equivalent. Add missing #include <cassert> in RadiansAngle.cpp
and gaf_test.cpp where it was previously provided transitively via
Boost headers.
Use a standard table-driven CRC32 with polynomial 0xEDB88320,
identical output to Boost.CRC and zlib. Add tests with known
reference values to verify correctness.
… helper

Add rwe::hashCombine in util/hash_combine.h, using the same algorithm
as Boost (golden ratio constant 0x9e3779b9). Replace all boost::hash
and boost::hash_combine usage in Point, DiscreteRect, GameMediaDatabase,
and test files. Remove unused hash_value ADL function from Point.
Add missing includes exposed by removing transitive Boost headers.
Add rwe::SpanStream, a lightweight std::istream wrapper over a
const char* buffer with full seek support. Replaces all
boost::interprocess::bufferstream usage across the codebase.
Add tests covering sequential reads, seeking, boundary conditions,
and binary data.
Also fixes a bug where --dir-features was mapped to pathMapping.downloads
instead of pathMapping.features.
Replace the vendored spdlog 0.14.0 (which was incompatible with C++20)
with a minimal SimpleLogger using LOG_XXX << stream macros. Log level
is controlled at compile time via RWE_LOG_LEVEL. Also upgrades the
C++ standard from C++17 to C++20 (gcc/clang and MSVC).
…, upload-artifact v6, cache v5, setup-python v6)
NSIS is not pre-installed on windows-2025 runners but WiX is.
Precompiled headers for librwe speed up builds across all platforms.
ccache added for Linux and MinGW CI builds with GitHub Actions cache.
Switch rapidcheck submodule from MHeasell fork to upstream emil-e/rapidcheck
(the fork had no custom changes). Updates from 2023 to Feb 2026, picking up
std::aligned_storage removal, C++20 fixes, and cmake_minimum_required bump
to 3.16.

Rename LICENSE to LICENSE.txt for WiX installer compatibility.
Catch2 v3 is a compiled library instead of header-only, reducing test
compilation overhead by ~80%. Key changes:
- Link Catch2::Catch2WithMain instead of defining CATCH_CONFIG_MAIN
- Replace catch2/catch.hpp with catch2/catch_test_macros.hpp
- Add catch2/catch_approx.hpp where Approx is used
- Qualify Approx as Catch::Approx (no longer in global namespace)
- Remove MSVC _HAS_DEPRECATED_RESULT_OF workaround (fixed in rapidcheck)
- Disable RC_ENABLE_CATCH to avoid target collision with Catch2 v3
@KevinHake
KevinHake merged commit a28eb74 into master Mar 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant