Create libtcod-headless fork for SDL-free builds #134
Labels
No Label
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: john/McRogueFace#134
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Create a fork of libtcod called
libtcod-headlessthat builds without SDL dependencies. This fulfills a long-standing community request for "ASCII-only" or "SDL-free" libtcod, and since McRogueFace implements its own graphical layer via SFML, we are naturally positioned to provide and maintain this.Key Discovery
libtcod 2.2.1 already has extensive
NO_SDLcompile-time guards!When built with
-DLIBTCOD_SDL3=disable, libtcod:libz,libstdc++,libm,libgcc_s,libcdependenciesTested build:
Implementation Notes
Minimal Changes Required
The fork should be a "light-touch modification" that can be easily rebased on each libtcod release:
CMakeLists.txt changes:
set(LIBTCOD_SDL3 "disable" CACHE STRING ...)set(LIBTCOD_HEADLESS OFF CACHE BOOL ...)Documentation:
Build system:
src/libtcod/sdl2/could be conditionally excludedFiles with
NO_SDLGuards (already in libtcod 2.2.1)McRogueFace libtcod Usage (all headless-compatible)
McRogueFace only uses libtcod's algorithm APIs, all of which work in headless mode:
TCODMap- FOV computationTCODDijkstra- Dijkstra pathfindingTCODPath- A* pathfindingTCODLine- Bresenham's line algorithmTCOD_fov_algorithm_tenum constantsUpgrade Path: 1.24.0 → 2.2.1
Current McRogueFace uses libtcod 1.24.0. Upgrading to 2.2.1:
Tasks
Benefits
References
Initial Implementation Complete
Created
2.2.1-headlessbranch with commit3b4b65dc:Changes Made
CMakeLists.txt:
src/CMakeLists.txt:
LIBTCOD_SDL3→"disable"(was"find_package")LIBTCOD_LODEPNG→"vendored"(was"find_package")LIBTCOD_UTF8PROC→"vendored"(was"vcpkg")LIBTCOD_STB→"vendored"(was"find_package")Build Verification
CMake output confirms vendored dependencies:
Library dependencies (no SDL!):
Remaining Tasks
Integration Complete
McRogueFace commit
8854d5bintegrates libtcod-headless:Changes in McRogueFace
.gitmodules: Points togit@github.com:jmccardle/libtcod-headless.gitbranch2.2.1-headlessCMakeLists.txt: Addedtarget_compile_definitions(mcrogueface PRIVATE NO_SDL)modules/libtcodsubmodule withmodules/libtcod-headlessBuild Verification
Next Steps for Fresh Clone
After cloning McRogueFace with submodules:
This issue will auto-close when the commit is pushed/merged to master.