From 8854d5b366fcb4c1a13cc706cd250c521ec402a2 Mon Sep 17 00:00:00 2001 From: John McCardle Date: Wed, 26 Nov 2025 11:22:48 -0500 Subject: [PATCH] feat: Replace libtcod with libtcod-headless fork (closes #134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace upstream libtcod with jmccardle/libtcod-headless fork that: - Builds without SDL dependency (NO_SDL compile flag) - Uses vendored dependencies (lodepng, utf8proc, stb) - Provides all core algorithms (FOV, pathfinding, BSP, noise) Changes: - Update .gitmodules to use libtcod-headless (2.2.1-headless branch) - Add NO_SDL compile definition to CMakeLists.txt - Remove old libtcod submodule Build instructions: deps/libtcod symlink should point to modules/libtcod-headless/src/libtcod (configured during build setup) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitmodules | 7 ++++--- CMakeLists.txt | 3 +++ modules/libtcod | 1 - modules/libtcod-headless | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) delete mode 160000 modules/libtcod create mode 160000 modules/libtcod-headless diff --git a/.gitmodules b/.gitmodules index 19c18d1..239bdda 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,7 @@ [submodule "modules/SFML"] path = modules/SFML url = git@github.com:SFML/SFML.git -[submodule "modules/libtcod"] - path = modules/libtcod - url = git@github.com:libtcod/libtcod.git +[submodule "modules/libtcod-headless"] + path = modules/libtcod-headless + url = git@github.com:jmccardle/libtcod-headless.git + branch = 2.2.1-headless diff --git a/CMakeLists.txt b/CMakeLists.txt index b2b905d..db78272 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,9 @@ link_directories(${CMAKE_SOURCE_DIR}/__lib) # Define the executable target before linking libraries add_executable(mcrogueface ${SOURCES}) +# Define NO_SDL for libtcod-headless headers (excludes SDL-dependent code) +target_compile_definitions(mcrogueface PRIVATE NO_SDL) + # On Windows, set subsystem to WINDOWS to hide console if(WIN32) set_target_properties(mcrogueface PROPERTIES diff --git a/modules/libtcod b/modules/libtcod deleted file mode 160000 index 34ae258..0000000 --- a/modules/libtcod +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 34ae258a863c4f6446effee28ca8ecae51b1519f diff --git a/modules/libtcod-headless b/modules/libtcod-headless new file mode 160000 index 0000000..3b4b65d --- /dev/null +++ b/modules/libtcod-headless @@ -0,0 +1 @@ +Subproject commit 3b4b65dc9aae7d21a98d3578e3e9433728b118bb