Skip to content

Commit 719bde8

Browse files
committed
allow compilation with empty target
1 parent d8ee308 commit 719bde8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/SPC/util/SPCTarget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,13 @@ public static function getLibcVersion(): ?string
8686
*/
8787
public static function getTargetOS(): string
8888
{
89-
$target = getenv('SPC_TARGET');
90-
if ($target === false) {
91-
return PHP_OS_FAMILY;
92-
}
89+
$target = (string) getenv('SPC_TARGET');
9390
return match (true) {
9491
str_contains($target, '-linux') => 'Linux',
9592
str_contains($target, '-macos') => 'Darwin',
9693
str_contains($target, '-windows') => 'Windows',
9794
str_contains($target, '-native') => PHP_OS_FAMILY,
98-
default => throw new WrongUsageException('Cannot parse target.'),
95+
default => PHP_OS_FAMILY,
9996
};
10097
}
10198
}

0 commit comments

Comments
 (0)