Written by Claude with Andy's permission
Summary
A Windows build is moderately feasible but requires source-level work before CI can be added. The main application code is already largely portable; the effort is in wiring up ClanLib's existing Win32 backends and removing hardcoded X11 dependencies from the build system.
What already exists
ClanLib (bundled in external/clanlib/) already has Win32 backends written:
Application/Win32/clanapp.cpp — Windows entry point
Core/System/Win32/ — threading, mutexes, event handling
Display/Win32/ — Windows display and input
GL/WGL/ — Windows OpenGL
The main application code (lib/, ruby/, netpanzer/) has no POSIX-specific APIs and already has a #ifdef WIN32 stub in lib/flexlay.cpp.
What needs changing
1. external/clanlib/SConstruct — platform-aware source selection
Currently hardcoded to compile Unix/GLX sources. Needs sys.platform detection to select Win32 sources instead.
2. Root SConstruct — remove hardcoded X11 link flags
# Currently hardcoded:
LIBS=[..., 'X11', 'Xmu', 'GL', 'GLU', 'png', 'jpeg', 'Xxf86vm', 'Xi']
On Windows: drop the X11 libs, link against opengl32, gdi32, user32 etc. There is even a FIXME comment in the file acknowledging this.
3. Launcher scripts
netpanzer/netpanzer-editor is a shell script. A .bat / .cmd equivalent is needed that sets PATH instead of LD_LIBRARY_PATH.
4. CI (.github/workflows/c-cpp.yml)
Adding a windows-latest matrix entry is straightforward after the above is done. The current CI uses apt and X11 dev packages which don't exist on Windows, so CI cannot be added until the source-level port is complete. MSYS2 on the runner could provide GCC and some packages, but X11 headers are not available on Windows regardless.
Effort estimate
| Area |
Effort |
| ClanLib SConstruct platform detection |
4–6 h |
| Root SConstruct X11 abstraction |
2–3 h |
Launcher .bat scripts |
1 h |
| CI workflow addition |
1 h |
| Testing / debugging |
4–8 h |
| Total |
~12–19 h |
Not required
- Rewriting ClanLib platform code (already done)
- Porting the Ruby scripting layer (SWIG and Ruby are cross-platform)
- Porting Boost usage (header-only
shared_ptr, cross-platform)
Written by Claude with Andy's permission
Summary
A Windows build is moderately feasible but requires source-level work before CI can be added. The main application code is already largely portable; the effort is in wiring up ClanLib's existing Win32 backends and removing hardcoded X11 dependencies from the build system.
What already exists
ClanLib (bundled in
external/clanlib/) already has Win32 backends written:Application/Win32/clanapp.cpp— Windows entry pointCore/System/Win32/— threading, mutexes, event handlingDisplay/Win32/— Windows display and inputGL/WGL/— Windows OpenGLThe main application code (
lib/,ruby/,netpanzer/) has no POSIX-specific APIs and already has a#ifdef WIN32stub inlib/flexlay.cpp.What needs changing
1.
external/clanlib/SConstruct— platform-aware source selectionCurrently hardcoded to compile Unix/GLX sources. Needs
sys.platformdetection to select Win32 sources instead.2. Root
SConstruct— remove hardcoded X11 link flagsOn Windows: drop the X11 libs, link against
opengl32,gdi32,user32etc. There is even a FIXME comment in the file acknowledging this.3. Launcher scripts
netpanzer/netpanzer-editoris a shell script. A.bat/.cmdequivalent is needed that setsPATHinstead ofLD_LIBRARY_PATH.4. CI (
.github/workflows/c-cpp.yml)Adding a
windows-latestmatrix entry is straightforward after the above is done. The current CI usesaptand X11 dev packages which don't exist on Windows, so CI cannot be added until the source-level port is complete. MSYS2 on the runner could provide GCC and some packages, but X11 headers are not available on Windows regardless.Effort estimate
.batscriptsNot required
shared_ptr, cross-platform)