Files
leanCLR_gdext/scripts/build-windows.bat
T

31 lines
1.4 KiB
Batchfile
Raw Normal View History

2026-06-07 22:55:56 +08:00
@echo off
REM Build the Windows (Desktop) target: native GDExtension + managed C# DLLs.
REM Run from the repo root.
setlocal
if not exist thirdparty\leanclr\CMakeLists.txt (
2026-06-07 23:55:51 +08:00
git submodule update --init --recursive
2026-06-07 22:55:56 +08:00
)
REM Re-apply the LeanCLR NotImplemented patch if a fresh submodule overwrote it.
findstr /C:"LEANCLR_FATAL_ON_RAISE_NOT_IMPLEMENTED_ERROR 1" thirdparty\leanclr\src\runtime\build_config.h >nul 2>&1
if %errorlevel% == 0 (
2026-06-07 23:55:51 +08:00
echo [build-windows] Re-applying leanclr NotImplemented patch...
powershell -Command "(Get-Content thirdparty/leanclr/src/runtime/build_config.h) -replace 'LEANCLR_FATAL_ON_RAISE_NOT_IMPLEMENTED_ERROR 1', 'LEANCLR_FATAL_ON_RAISE_NOT_IMPLEMENTED_ERROR 0' | Set-Content thirdparty/leanclr/src/runtime/build_config.h"
2026-06-07 22:55:56 +08:00
)
2026-06-07 23:14:44 +08:00
cmake -S . -B build-master -DCMAKE_BUILD_TYPE=Debug
if errorlevel 1 (
2026-06-07 23:55:51 +08:00
echo [build-windows] Initial cmake configure failed, running binding generator and retrying...
python3 tools\binding_generator\generate_bindings.py --api build-master\_deps\godot-cpp-src\gdextension\extension_api.json
if errorlevel 1 exit /b 1
cmake -S . -B build-master -DCMAKE_BUILD_TYPE=Debug
2026-06-07 23:14:44 +08:00
)
2026-06-07 23:55:51 +08:00
cmake --build build-master --config Debug --target leanclr_godot
2026-06-07 22:55:56 +08:00
2026-06-07 23:55:51 +08:00
dotnet msbuild managed\GodotSharpCompat\GodotSharpCompat.csproj -p:Configuration=Debug
dotnet msbuild project\Game.csproj -p:Configuration=Debug
2026-06-07 22:55:56 +08:00
echo [build-windows] Done. Run with: "C:\path\to\Godot.exe" --path project