Update src/Package/Target/php/windows.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jerry Ma 2025-12-11 14:47:14 +08:00 committed by GitHub
parent 6d292b4c54
commit 4e841cfc67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,11 +181,15 @@ trait windows
// Fix PHP VS version
// get vs version
$vc = WindowsUtil::findVisualStudio();
$vc_matches = match ($vc['major_version']) {
'17' => ['VS17', 'Visual C++ 2022'],
'16' => ['VS16', 'Visual C++ 2019'],
default => ['unknown', 'unknown'],
};
if ($vc === false) {
$vc_matches = ['unknown', 'unknown'];
} else {
$vc_matches = match ($vc['major_version']) {
'17' => ['VS17', 'Visual C++ 2022'],
'16' => ['VS16', 'Visual C++ 2019'],
default => ['unknown', 'unknown'],
};
}
// patch php-src/win32/build/confutils.js
FileSystem::replaceFileStr(
"{$package->getSourceDir()}\\win32\\build\\confutils.js",