mirror of
https://github.com/php/php-sdk-binary-tools.git
synced 2026-03-24 07:32:15 +01:00
Fix Arch determintion
This commit is contained in:
@@ -55,19 +55,18 @@ class Config
|
|||||||
if (NULL === self::$currentArchName) {
|
if (NULL === self::$currentArchName) {
|
||||||
/* XXX this might be not true for other compilers! */
|
/* XXX this might be not true for other compilers! */
|
||||||
passthru("where cl.exe >nul", $status);
|
passthru("where cl.exe >nul", $status);
|
||||||
if ($status) {
|
|
||||||
throw new Exception("Couldn't find cl.exe.");
|
|
||||||
}
|
|
||||||
|
|
||||||
exec("cl.exe /? 2>&1", $a, $status);
|
|
||||||
if ($status) {
|
if ($status) {
|
||||||
throw new Exception("Couldn't execute cl.exe.");
|
throw new Exception("Couldn't execute cl.exe.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match(",x64,", $a[0])) {
|
exec("cl.exe /? 2>&1", $out);
|
||||||
|
|
||||||
|
if (preg_match(",x64,", $out[0])) {
|
||||||
self::setCurrentArchName("x64");
|
self::setCurrentArchName("x64");
|
||||||
} else {
|
} elseif (preg_match(",x86,", $out[0])) {
|
||||||
self::setCurrentArchName("x86");
|
self::setCurrentArchName("x86");
|
||||||
|
} else {
|
||||||
|
throw new Exception("Couldn't determine Arch.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user