mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-13 20:05:35 +08:00
test zig
This commit is contained in:
@@ -101,7 +101,7 @@ class GlobalEnvManager
|
|||||||
self::putenv("{$k}={$v}");
|
self::putenv("{$k}={$v}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (str_contains((string)getenv('CC'), 'zig') || str_contains((string)getenv('CXX'), 'zig')) {
|
if (str_contains((string) getenv('CC'), 'zig') || str_contains((string) getenv('CXX'), 'zig')) {
|
||||||
$zigEnv = Zig::getEnvironment();
|
$zigEnv = Zig::getEnvironment();
|
||||||
foreach ($zigEnv as $key => $value) {
|
foreach ($zigEnv as $key => $value) {
|
||||||
if ($key === 'PATH') {
|
if ($key === 'PATH') {
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||||
$test_php_version = [
|
$test_php_version = [
|
||||||
'8.1',
|
// '8.1',
|
||||||
'8.2',
|
// '8.2',
|
||||||
'8.3',
|
// '8.3',
|
||||||
'8.4',
|
'8.4',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -26,12 +26,21 @@ $test_os = [
|
|||||||
// 'macos-15',
|
// 'macos-15',
|
||||||
// 'ubuntu-latest',
|
// 'ubuntu-latest',
|
||||||
// 'ubuntu-22.04',
|
// 'ubuntu-22.04',
|
||||||
// 'ubuntu-24.04',
|
|
||||||
// 'ubuntu-22.04-arm',
|
// 'ubuntu-22.04-arm',
|
||||||
// 'ubuntu-24.04-arm',
|
'ubuntu-24.04',
|
||||||
'windows-latest',
|
'ubuntu-24.04-arm',
|
||||||
|
// 'windows-latest',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$zig = true;
|
||||||
|
// temporary!
|
||||||
|
if ($zig) {
|
||||||
|
putenv('SPC_LIBC=glibc');
|
||||||
|
putenv('SPC_LIBC_VERSION=2.17');
|
||||||
|
putenv('CC=zig-cc');
|
||||||
|
putenv('CXX=zig-c++');
|
||||||
|
}
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
$zts = true;
|
$zts = true;
|
||||||
|
|
||||||
@@ -48,13 +57,13 @@ $prefer_pre_built = true;
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'curl',
|
'Linux', 'Darwin' => 'curl,iconv',
|
||||||
'Windows' => 'intl',
|
'Windows' => 'intl',
|
||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
||||||
$shared_extensions = match (PHP_OS_FAMILY) {
|
$shared_extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux' => 'uv',
|
'Linux' => 'event,uv,intl,gettext',
|
||||||
'Darwin' => '',
|
'Darwin' => '',
|
||||||
'Windows' => '',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
@@ -208,6 +217,9 @@ switch ($argv[1] ?? null) {
|
|||||||
passthru($prefix . $down_cmd, $retcode);
|
passthru($prefix . $down_cmd, $retcode);
|
||||||
break;
|
break;
|
||||||
case 'build_cmd':
|
case 'build_cmd':
|
||||||
|
if ($zig) {
|
||||||
|
passthru("{$prefix}install-pkg zig --debug", $retcode);
|
||||||
|
}
|
||||||
passthru($prefix . $build_cmd . ' --build-cli --build-micro', $retcode);
|
passthru($prefix . $build_cmd . ' --build-cli --build-micro', $retcode);
|
||||||
break;
|
break;
|
||||||
case 'build_embed_cmd':
|
case 'build_embed_cmd':
|
||||||
|
|||||||
Reference in New Issue
Block a user