Skip to content

feat: add PowerShell build script for Windows - #169

Closed
SebZar wants to merge 2 commits into
gkralik:mainfrom
SebZar:feat/windows-build-script
Closed

feat: add PowerShell build script for Windows#169
SebZar wants to merge 2 commits into
gkralik:mainfrom
SebZar:feat/windows-build-script

Conversation

@SebZar

@SebZar SebZar commented Jun 13, 2026

Copy link
Copy Markdown

Summary

  • Adds build/build-windows.ps1 — a self-contained PowerShell 5.1+ script that builds the extension for every PHP variant (TS/NTS, x64/x86) found in a local build/php/ directory, no internet access required
  • Adds build/build-windows.md — setup and usage documentation
  • Updates .gitignore to cover Windows nmake output dirs (x64/, x86/), generated batch files (configure.bat, config.nice.bat, configure.js), and *.log; replaces the blanket build/ ignore with specific subdirs so the script and docs can be tracked

How it works

Place the following in build/:

build/
  php/   ← PHP binary zips, devel packs, php-sdk-binary-tools-*.zip
  sap/   ← SAP NW RFC SDK zip (must contain a top-level nwrfcsdk/ folder)

Then run:

.\build\build-windows.ps1

The script:

  1. Extracts SDK, PHP SDK tools, PHP binaries, and devel packs into build/workspace/ (skips already-extracted content on re-runs)
  2. Detects the installed Visual Studio via vswhere; handles cross-toolset builds automatically (e.g. vs17 PHP zips on a VS 2026 host via -vcvars_ver)
  3. Runs phpizeconfigurenmake for each variant
  4. Copies the built DLL into build/output/<variant>/php_sapnwrfc.dll

Parameters: -WorkspaceDir, -OutputDir, -Toolset (override), -RunTests

Test plan

  • Tested with PHP 8.5.7 TS/NTS x64 (vs17) on VS 2022 and VS 2026 with NW RFC SDK 7.50
  • Re-run behaviour verified: already-extracted content is skipped, build still succeeds

🤖 Generated with Claude Code

SebZar and others added 2 commits June 13, 2026 21:24
Replace blanket build/ ignore with specific subdirs (output/, php/, sap/,
workspace/) so build-windows.ps1 and build-windows.md can be tracked.
Add Windows nmake output dirs (x64/, x86/), generated batch files
(configure.bat, config.nice.bat, configure.js), and *.log.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collect built DLLs into build/output/<variant>/ instead of leaving them
in the nmake-generated x64/Release_TS/ subfolder inside the source tree.
Add -OutputDir parameter (default: build/output/) to allow overriding
the destination. Re-runs skip already-extracted workspace content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SebZar

SebZar commented Jun 13, 2026

Copy link
Copy Markdown
Author

Superseded by #172 (cleaner branch, improved PR description).

@SebZar SebZar closed this Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant