Closed shivammathur closed 6 months ago
Hi @shivammathur, Thx for this PR!
Fyi, vcvarsall.bat
doesn't exist anymore on Visual Studio 2022 Community >= 17.10 (preview)
This is my config to build PHP with vs16 & vs17
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.Net.Component.4.8.SDK",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.Net.Component.4.8.TargetingPack",
"Microsoft.VisualStudio.Component.VC.CoreIde",
"Microsoft.VisualStudio.Component.VC.14.40.17.10.x86.x64",
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.40.17.10.ATL"
],
"extensions": []
}
I had to patch this way to have it working
bin/phpsdk_setshell.bat | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/phpsdk_setshell.bat b/bin/phpsdk_setshell.bat
index 8c41734..0dcb846 100644
--- a/bin/phpsdk_setshell.bat
+++ b/bin/phpsdk_setshell.bat
@@ -211,7 +211,7 @@ if 15 gtr %PHP_SDK_VS_NUM% (
)
) else (
if NOT "%TOOLSET%"=="" (
- set PHP_SDK_VS_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" !VCVARSALL_ARCH_NAME! -vcvars_ver=%TOOLSET%
+ set PHP_SDK_VS_SHELL_CMD="!PHP_SDK_VC_DIR!\VsDevCmd.bat" -arch=!VCVARSALL_ARCH_NAME! -vcvars_ver=%TOOLSET% -winsdk=%WKITVER% -no_logo
) else (
set PHP_SDK_VS_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" !VCVARSALL_ARCH_NAME!
)
Fyi,
vcvarsall.bat
doesn't exist anymore on Visual Studio 2022 Community >= 17.10 (preview)
Possible, but that's not supposed to be the case. For me (17.11.2) it's in C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build
, and it's found by the phpsdk_setshell.bat.
Possible, but that's not supposed to be the case. For me (17.11.2) it's in
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build
Same here on my laptop with 17.11.2
This PR adds a toolset input to call
vcvarsall.bat
script with-vcvars_ver
argument.