Use failsafe for SPC_EXTRA_PHP_VARS

This commit is contained in:
crazywhalecc
2025-10-12 16:42:38 +08:00
parent 018dfae15e
commit 897cb00351
4 changed files with 8 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ class ZigToolchain implements ToolchainInterface
$cflags = getenv('SPC_DEFAULT_C_FLAGS') ?: getenv('CFLAGS') ?: '';
$has_avx512 = str_contains($cflags, '-mavx512') || str_contains($cflags, '-march=x86-64-v4');
if (!$has_avx512) {
f_putenv('SPC_EXTRA_PHP_VARS=php_cv_have_avx512=no php_cv_have_avx512vbmi=no');
GlobalEnvManager::putenv('SPC_EXTRA_PHP_VARS=php_cv_have_avx512=no php_cv_have_avx512vbmi=no');
}
}