Fix Arch determintion

This commit is contained in:
Jerry
2017-09-01 21:16:04 +08:00
committed by Anatol Belski
parent 5507b37b7d
commit a97d0bd292

View File

@@ -55,19 +55,18 @@ class Config
if (NULL === self::$currentArchName) {
/* XXX this might be not true for other compilers! */
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) {
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");
} else {
} elseif (preg_match(",x86,", $out[0])) {
self::setCurrentArchName("x86");
} else {
throw new Exception("Couldn't determine Arch.");
}
}