Skip to content

Add support for toolset #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2024
Merged

Add support for toolset #15

merged 1 commit into from
May 25, 2024

Conversation

shivammathur
Copy link
Member

This PR adds a toolset input to call vcvarsall.bat script with -vcvars_ver argument.

@shivammathur shivammathur merged commit d1036b5 into php:master May 25, 2024
@nono303
Copy link

nono303 commented May 25, 2024

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!
     )

nono303 pushed a commit to nono303/win-build-scripts that referenced this pull request May 28, 2024
@cmb69
Copy link
Member

cmb69 commented Sep 4, 2024

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.

@Jan-E
Copy link
Contributor

Jan-E commented Sep 4, 2024

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

@shivammathur shivammathur deleted the toolset branch October 12, 2024 21:54
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.

4 participants