Skip to content

Commit 4e841cf

Browse files
Update src/Package/Target/php/windows.php
Co-authored-by: Copilot <[email protected]>
1 parent 6d292b4 commit 4e841cf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Package/Target/php/windows.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,15 @@ public function patchBeforeBuildconfForWindows(TargetPackage $package): void
181181
// Fix PHP VS version
182182
// get vs version
183183
$vc = WindowsUtil::findVisualStudio();
184-
$vc_matches = match ($vc['major_version']) {
185-
'17' => ['VS17', 'Visual C++ 2022'],
186-
'16' => ['VS16', 'Visual C++ 2019'],
187-
default => ['unknown', 'unknown'],
188-
};
184+
if ($vc === false) {
185+
$vc_matches = ['unknown', 'unknown'];
186+
} else {
187+
$vc_matches = match ($vc['major_version']) {
188+
'17' => ['VS17', 'Visual C++ 2022'],
189+
'16' => ['VS16', 'Visual C++ 2019'],
190+
default => ['unknown', 'unknown'],
191+
};
192+
}
189193
// patch php-src/win32/build/confutils.js
190194
FileSystem::replaceFileStr(
191195
"{$package->getSourceDir()}\\win32\\build\\confutils.js",

0 commit comments

Comments
 (0)