mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
try to test with zig?
This commit is contained in:
parent
55fd7ba8e6
commit
408b3b4060
@ -34,7 +34,12 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
output=$(zig cc -target ${SPC_TARGET} -lstdc++ ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" 2>&1)
|
TARGET=""
|
||||||
|
if [ -n "$SPC_TARGET" ]; then
|
||||||
|
TARGET="-target $SPC_TARGET"
|
||||||
|
else
|
||||||
|
|
||||||
|
output=$(zig cc $TARGET -lstdc++ $COMPILER_EXTRA "${PARSED_ARGS[@]}" 2>&1)
|
||||||
status=$?
|
status=$?
|
||||||
|
|
||||||
if [ $status -eq 0 ]; then
|
if [ $status -eq 0 ]; then
|
||||||
@ -43,8 +48,8 @@ if [ $status -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if echo "$output" | grep -q "version '.*' in target triple"; then
|
if echo "$output" | grep -q "version '.*' in target triple"; then
|
||||||
echo "$output" | grep -v "version '.*' in target triple"
|
echo "$output" | grep -v "version '.*' in target triple"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
exec zig cc -target ${SPC_TARGET} ${COMPILER_EXTRA} "${PARSED_ARGS[@]}"
|
exec zig cc $TARGET $COMPILER_EXTRA "${PARSED_ARGS[@]}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class ToolchainManager
|
|||||||
public static function getToolchainClass(): string
|
public static function getToolchainClass(): string
|
||||||
{
|
{
|
||||||
$libc = getenv('SPC_LIBC');
|
$libc = getenv('SPC_LIBC');
|
||||||
if ($libc !== false && !getenv('SPC_TARGET')) {
|
if ($libc && !getenv('SPC_TARGET')) {
|
||||||
// TODO: @crazywhalecc this breaks tests
|
// TODO: @crazywhalecc this breaks tests
|
||||||
// logger()->warning('SPC_LIBC is deprecated, please use SPC_TARGET instead.');
|
// logger()->warning('SPC_LIBC is deprecated, please use SPC_TARGET instead.');
|
||||||
return match ($libc) {
|
return match ($libc) {
|
||||||
|
|||||||
@ -27,8 +27,8 @@ $test_os = [
|
|||||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||||
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||||
'ubuntu-24.04', // bin/spc for x86_64
|
'ubuntu-24.04', // bin/spc for x86_64
|
||||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||||
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
'ubuntu-24.04-arm', // bin/spc for arm64
|
||||||
// 'windows-latest', // .\bin\spc.ps1
|
// 'windows-latest', // .\bin\spc.ps1
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -158,6 +158,7 @@ if ($shared_extensions) {
|
|||||||
break;
|
break;
|
||||||
case 'ubuntu-24.04':
|
case 'ubuntu-24.04':
|
||||||
case 'ubuntu-24.04-arm':
|
case 'ubuntu-24.04-arm':
|
||||||
|
putenv('SPC_TARGET=native-linux-gnu');
|
||||||
if (str_contains((string) getenv('SPC_TARGET'), '-gnu')) {
|
if (str_contains((string) getenv('SPC_TARGET'), '-gnu')) {
|
||||||
$shared_cmd = ' --build-shared=' . quote2($shared_extensions) . ' ';
|
$shared_cmd = ' --build-shared=' . quote2($shared_extensions) . ' ';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user