diff --git a/scripts/build-web.bat b/scripts/build-web.bat index 5947c1d..45d1770 100644 --- a/scripts/build-web.bat +++ b/scripts/build-web.bat @@ -4,34 +4,34 @@ REM Build the Web (WASM) target. Requires Emscripten 3.1+ and Ninja on PATH. setlocal if not exist thirdparty\leanclr\CMakeLists.txt ( - git submodule update --init --recursive + git submodule update --init --recursive ) findstr /C:"LEANCLR_FATAL_ON_RAISE_NOT_IMPLEMENTED_ERROR 1" thirdparty\leanclr\src\runtime\build_config.h >nul 2>&1 if %errorlevel% == 0 ( - echo [build-web] 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" + echo [build-web] 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" ) REM Assume Emscripten is on PATH (emsdk_env.bat / emsdk activated). where emcc >nul 2>&1 if errorlevel 1 ( - echo [build-web] emcc not found on PATH. Activate Emscripten via emsdk_env.bat first. 1>&2 - exit /b 1 + echo [build-web] emcc not found on PATH. Activate Emscripten via emsdk_env.bat first. 1>&2 + exit /b 1 ) echo [build-web] Using emcc from PATH. -emcmake cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Release +cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Debug if errorlevel 1 ( - echo [build-web] Initial cmake configure failed, running binding generator and retrying... - python3 tools\binding_generator\generate_bindings.py --api build-web\_deps\godot-cpp-src\gdextension\extension_api.json - if errorlevel 1 exit /b 1 - emcmake cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Release || exit /b 1 + echo [build-web] Initial cmake configure failed, running binding generator and retrying... + python3 tools\binding_generator\generate_bindings.py --api build-web\_deps\godot-cpp-src\gdextension\extension_api.json + if errorlevel 1 exit /b 1 + cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Debug ) -cmake --build build-web --target leanclr_godot || exit /b 1 +cmake --build build-web --config Release --target leanclr_godot -dotnet msbuild managed\GodotSharpCompat\GodotSharpCompat.csproj -p:Configuration=Debug || exit /b 1 -dotnet msbuild project\Game.csproj -p:Configuration=Debug || exit /b 1 +dotnet msbuild managed\GodotSharpCompat\GodotSharpCompat.csproj -p:Configuration=Debug +dotnet msbuild project\Game.csproj -p:Configuration=Debug echo [build-web] Done. Output: project\bin\Release\libleanclr_godot.wasm echo [build-web] Export the project for Web in the Godot editor to run. diff --git a/scripts/build-windows.bat b/scripts/build-windows.bat index 2e10143..e4c1d80 100644 --- a/scripts/build-windows.bat +++ b/scripts/build-windows.bat @@ -5,26 +5,26 @@ REM Run from the repo root. setlocal if not exist thirdparty\leanclr\CMakeLists.txt ( - git submodule update --init --recursive + git submodule update --init --recursive ) 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 ( - 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" + 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" ) cmake -S . -B build-master -DCMAKE_BUILD_TYPE=Debug if errorlevel 1 ( - 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 || exit /b 1 + 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 ) -cmake --build build-master --config Debug --target leanclr_godot || exit /b 1 +cmake --build build-master --config Debug --target leanclr_godot -dotnet msbuild managed\GodotSharpCompat\GodotSharpCompat.csproj -p:Configuration=Debug || exit /b 1 -dotnet msbuild project\Game.csproj -p:Configuration=Debug || exit /b 1 +dotnet msbuild managed\GodotSharpCompat\GodotSharpCompat.csproj -p:Configuration=Debug +dotnet msbuild project\Game.csproj -p:Configuration=Debug echo [build-windows] Done. Run with: "C:\path\to\Godot.exe" --path project