Skip to content

Commit 5c21ab5

Browse files
committed
fix: build.bat call ready.bat incorrect.
chg: update _config.bat tips, redefine var WIN_SDK_PATH location (bin's parent folder) test: MSVC v143 build tools
1 parent 13c7c52 commit 5c21ab5

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

_config.bat

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@
22

33

44
:: VC2019 complier path
5+
:: ====================
56
:: e.g., C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.29.30133
6-
set VC_TOOLS_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.29.30133
7+
:: e.g., C:\VS2022\VC\Tools\MSVC\14.41.34120
8+
set VC_TOOLS_PATH=C:\VS2022\VC\Tools\MSVC\14.41.34120
79

810

911
:: Windows SDK path
10-
:: e.g., D:\Windows Kits OR C:\Program Files (x86)\Microsoft SDKs\Windows Kits
11-
set WIN_SDK_PATH=D:\Windows Kits
12+
:: ================
13+
:: e.g., C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10
14+
:: e.g., C:\Windows Kits\10
15+
set WIN_SDK_PATH=C:\Windows Kits\10
1216

1317

1418
:: Windows SDK version
19+
:: ===================
20+
:: see SDKManifest.xml FileList\PlatformIdentity attribute
1521
:: e.g., 10.0.22621.0
1622
set WIN_SDK_VERSION=10.0.22621.0
1723

1824

1925
:: Enable NTS
26+
:: ==========
2027
:: Default is 1, for FastCGI, set blank for SAPI
2128
set PHP_NTS=1

_ready.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ set BUILD_PATH=%BUILD_PATH:~0,-1%
1616
set PHP_SDK_PATH=%BUILD_PATH%\php-sdk
1717
set PHP_EXT_SDK_PATH=%BUILD_PATH%\php-sdk-ext
1818
set PHP_SRC_PATH=%BUILD_PATH%\php-src
19-
set INCLUDE=%VC_TOOLS_PATH%\include;%WIN_SDK_PATH%\10\Include\%WIN_SDK_VERSION%\shared;%WIN_SDK_PATH%\10\Include\%WIN_SDK_VERSION%\ucrt;%WIN_SDK_PATH%\10\Include\%WIN_SDK_VERSION%\um
20-
set LIB=%VC_TOOLS_PATH%\lib\x64;%WIN_SDK_PATH%\10\Lib\%WIN_SDK_VERSION%\um\x64;%WIN_SDK_PATH%\10\Lib\%WIN_SDK_VERSION%\ucrt\x64
19+
set INCLUDE=%VC_TOOLS_PATH%\include;%WIN_SDK_PATH%\Include\%WIN_SDK_VERSION%\shared;%WIN_SDK_PATH%\Include\%WIN_SDK_VERSION%\ucrt;%WIN_SDK_PATH%\Include\%WIN_SDK_VERSION%\um
20+
set LIB=%VC_TOOLS_PATH%\lib\x64;%WIN_SDK_PATH%\Lib\%WIN_SDK_VERSION%\um\x64;%WIN_SDK_PATH%\Lib\%WIN_SDK_VERSION%\ucrt\x64
2121
set ORIGN_PATH=%path%
2222

2323
set path=%PATH%;%VC_TOOLS_PATH%\bin\HostX64\x64
24-
set path=%PATH%;%WIN_SDK_PATH%\10\bin\%WIN_SDK_VERSION%\x64
24+
set path=%PATH%;%WIN_SDK_PATH%\bin\%WIN_SDK_VERSION%\x64
2525
set path=%PATH%;%PHP_SDK_PATH%;%PHP_SDK_PATH%\bin;%PHP_SDK_PATH%\msys2\usr\bin
2626
set path=%PATH%;%PHP_EXT_SDK_PATH%
2727
set path=%PATH%;%PHP_SRC_PATH%

build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ echo Done!
2323

2424

2525
::------------------------------------------------------------------------------
26+
cd /d %BUILD_PATH%\
2627
call _ready.bat end

readme.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,28 @@ Links:
1818

1919
# Prepare
2020

21-
- Run [Visual Studio Setup], select `MSVC v142 VS2019 C++ x64/x86 build tools` and `Windows 11 SDK (10.0.22621.0)`, complete the installation according to the wizard.
21+
- Run Visual Studio Setup, select `MSVC v142 VS2019 C++ x64/x86 build tools` or high version, select `Windows 11 SDK (10.0.22621.0)` or high version, complete the installation according to the wizard.
2222
- Extract this tools to a empty folder, e.g., `c:\build` alias `{build}`
2323
- Extract SDKs and sources to specified folder, excluding the first level directory if exist:
2424
- PHP SDK -> `{build}\php-sdk`
2525
- PHP Source -> `{build}\php-src`
2626
- PhpRedis Source -> `{build}\php-src\ext\redis`
27-
- **Edit `{build}\_config.bat`** !!!
27+
- **Edit `{build}\_config.bat` !!!** Specify the correct parameters: VC_TOOLS_PATH, WIN_SDK_PATH, WIN_SDK_VERSION, PHP_NTS
2828

2929
# Run
3030

3131
Open CMD console, cd `{build}`, run
3232

3333
`init.bat`
3434

35-
if no error accured, next
35+
if no error accured, run
3636

3737
`build.bat`
3838

3939
# Output
4040

41-
`php_redis_nts.dll` or `php_redis_ts.dll` you will find in `{build}\release`
41+
`php_redis_nts.dll` or `php_redis_ts.dll` you will find in `{build}\release`.
4242

4343
# Remark
4444

45-
- Open CMD console,run `{build}\env.bat` to initialize runtime environment,if you want to run tools related.
46-
- This script is support x64 only.
45+
- Support x64 only.

0 commit comments

Comments
 (0)