From 665689c55099bba96e1d82e8f18e18cf960e575e Mon Sep 17 00:00:00 2001 From: John McCardle Date: Wed, 9 Jul 2025 23:33:09 -0400 Subject: [PATCH] hotfix: Windows build attempt --- build_windows.bat | 36 ++++++++++++++++++++++++++++++++++++ src/PyTimer.cpp | 2 +- src/UIGrid.cpp | 8 ++++---- 3 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 build_windows.bat diff --git a/build_windows.bat b/build_windows.bat new file mode 100644 index 0000000..5fb0c35 --- /dev/null +++ b/build_windows.bat @@ -0,0 +1,36 @@ +@echo off +REM Windows build script for McRogueFace +REM Run this over SSH without Visual Studio GUI + +echo Building McRogueFace for Windows... + +REM Clean previous build +if exist build_win rmdir /s /q build_win +mkdir build_win +cd build_win + +REM Generate Visual Studio project files with CMake +REM Use -G to specify generator, -A for architecture +REM Visual Studio 2022 = "Visual Studio 17 2022" +REM Visual Studio 2019 = "Visual Studio 16 2019" +cmake -G "Visual Studio 17 2022" -A x64 .. +if errorlevel 1 ( + echo CMake configuration failed! + exit /b 1 +) + +REM Build using MSBuild (comes with Visual Studio) +REM You can also use cmake --build . --config Release +msbuild McRogueFace.sln /p:Configuration=Release /p:Platform=x64 /m +if errorlevel 1 ( + echo Build failed! + exit /b 1 +) + +echo Build completed successfully! +echo Executable location: build_win\Release\mcrogueface.exe + +REM Alternative: Using cmake to build (works with any generator) +REM cmake --build . --config Release --parallel + +cd .. \ No newline at end of file diff --git a/src/PyTimer.cpp b/src/PyTimer.cpp index 7f780a3..10e2f77 100644 --- a/src/PyTimer.cpp +++ b/src/PyTimer.cpp @@ -30,7 +30,7 @@ PyObject* PyTimer::pynew(PyTypeObject* type, PyObject* args, PyObject* kwds) { } int PyTimer::init(PyTimerObject* self, PyObject* args, PyObject* kwds) { - static char* kwlist[] = {"name", "callback", "interval", NULL}; + static const char* kwlist[] = {"name", "callback", "interval", NULL}; const char* name = nullptr; PyObject* callback = nullptr; int interval = 0; diff --git a/src/UIGrid.cpp b/src/UIGrid.cpp index e65901e..251bba2 100644 --- a/src/UIGrid.cpp +++ b/src/UIGrid.cpp @@ -967,7 +967,7 @@ int UIGrid::set_perspective(PyUIGridObject* self, PyObject* value, void* closure // Python API implementations for TCOD functionality PyObject* UIGrid::py_compute_fov(PyUIGridObject* self, PyObject* args, PyObject* kwds) { - static char* kwlist[] = {"x", "y", "radius", "light_walls", "algorithm", NULL}; + static const char* kwlist[] = {"x", "y", "radius", "light_walls", "algorithm", NULL}; int x, y, radius = 0; int light_walls = 1; int algorithm = FOV_BASIC; @@ -994,7 +994,7 @@ PyObject* UIGrid::py_is_in_fov(PyUIGridObject* self, PyObject* args) PyObject* UIGrid::py_find_path(PyUIGridObject* self, PyObject* args, PyObject* kwds) { - static char* kwlist[] = {"x1", "y1", "x2", "y2", "diagonal_cost", NULL}; + static const char* kwlist[] = {"x1", "y1", "x2", "y2", "diagonal_cost", NULL}; int x1, y1, x2, y2; float diagonal_cost = 1.41f; @@ -1022,7 +1022,7 @@ PyObject* UIGrid::py_find_path(PyUIGridObject* self, PyObject* args, PyObject* k PyObject* UIGrid::py_compute_dijkstra(PyUIGridObject* self, PyObject* args, PyObject* kwds) { - static char* kwlist[] = {"root_x", "root_y", "diagonal_cost", NULL}; + static const char* kwlist[] = {"root_x", "root_y", "diagonal_cost", NULL}; int root_x, root_y; float diagonal_cost = 1.41f; @@ -1073,7 +1073,7 @@ PyObject* UIGrid::py_compute_astar_path(PyUIGridObject* self, PyObject* args, Py int x1, y1, x2, y2; float diagonal_cost = 1.41f; - static char* kwlist[] = {"x1", "y1", "x2", "y2", "diagonal_cost", NULL}; + static const char* kwlist[] = {"x1", "y1", "x2", "y2", "diagonal_cost", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "iiii|f", kwlist, &x1, &y1, &x2, &y2, &diagonal_cost)) {