feat(build): add automated Windows build script with multi-variant support - #172
Open
SebZar wants to merge 1 commit into
Open
feat(build): add automated Windows build script with multi-variant support#172SebZar wants to merge 1 commit into
SebZar wants to merge 1 commit into
Conversation
This was referenced Jun 13, 2026
…pport
Adds build/build-windows.ps1 and build/build-windows.md for building
php-sapnwrfc on Windows without manual VS environment setup.
Key features:
- Discovers all PHP variants (TS/NTS, version, toolset, arch) from
zip files placed in build\php\ — no git clone or internet access needed
- Auto-detects installed Visual Studio via vswhere; handles cross-toolset
builds (e.g. vs16/vs17 PHP zips on VS 2026 host) via vcvarsall -vcvars_ver
- Produces versioned DLL filenames encoding extension, PHP, and SDK versions:
php_sapnwrfc-{ext}+php.{php}-{ts|nts}-{toolset}-{arch}.sdk.{sdk}.dll
- All DLLs collected flat in build\output\; no per-variant subdirectories
- Optional -RunTests flag runs nmake test after each build using the
same MSVC environment as the build step (correct for cross-toolset)
- Reliable exit-code capture: build steps wrapped in CMD subroutine so
|| exit /b 1 guards exit the subroutine, not the outer bat — the exit
file is always written regardless of which step fails
Also updates .gitignore: replaces the blanket build/ exclusion with
specific subdirectory entries (output/, php/, sap/, workspace/) so that
the script and documentation are tracked, and adds Windows build artefacts
(x64/, x86/, configure.bat, *.log) to the ignore list.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SebZar
force-pushed
the
feat/windows-build
branch
from
June 14, 2026 13:14
75b732c to
411ef04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a self-contained PowerShell build script (
build/build-windows.ps1) and accompanying documentation (build/build-windows.md) for building the extension on Windows across multiple PHP variants.build\php\— no git clone or internet access neededvswhere; handles cross-toolset builds (e.g. vs16/vs17 PHP zips on a VS 2026 host) viavcvarsall -vcvars_verphp_sapnwrfc-{ext}+php.{php}-{ts|nts}-{toolset}-{arch}.sdk.{sdk}.dllbuild\output\-RunTestsflag runsnmake testafter each build using the same MSVC environment as the build step (correct for cross-toolset)Also updates
.gitignore: replaces the blanketbuild/exclusion with specific subdirectory entries (output/,php/,sap/,workspace/) so the script and documentation are tracked, and adds Windows build artefacts (x64/,x86/,configure.bat,*.log) to the ignore list.Test plan
.\build-windows.ps1on a VS 2026 machine with vs16 and vs17 components installedphp -m | findstr sapnwrfc)-RunTestsand confirm test output is reported per variantbuild\output\,build\php\,build\sap\,build\workspace\are excluded fromgit status🤖 Generated with Claude Code