You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SPC/toolchain/ClangNativeToolchain.php
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,17 @@ public function initEnv(): void
22
22
23
23
publicfunctionafterInit(): void
24
24
{
25
-
// check clang exists
26
-
match (PHP_OS_FAMILY) {
27
-
'Linux' => LinuxSystemUtil::findCommand('clang++') ?? thrownewWrongUsageException('Clang++ not found, please install it or manually set CC/CXX to a valid path.'),
28
-
'Darwin' => MacOSSystemUtil::findCommand('clang++') ?? thrownewWrongUsageException('Clang++ not found, please install it or set CC/CXX to a valid path.'),
29
-
'BSD' => FreeBSDSystemUtil::findCommand('clang++') ?? thrownewWrongUsageException('Clang++ not found, please install it or set CC/CXX to a valid path.'),
30
-
default => thrownewWrongUsageException('Clang is not supported on ' . PHP_OS_FAMILY . '.'),
31
-
};
25
+
foreach (['CC', 'CXX', 'AR', 'LD'] as$env) {
26
+
$command = getenv($env);
27
+
if (!$command || is_file($command)) {
28
+
continue;
29
+
}
30
+
match (PHP_OS_FAMILY) {
31
+
'Linux' => LinuxSystemUtil::findCommand($command) ?? thrownewWrongUsageException("{$command} not found, please install it or set {$env} to a valid path."),
32
+
'Darwin' => MacOSSystemUtil::findCommand($command) ?? thrownewWrongUsageException("{$command} not found, please install it or set {$env} to a valid path."),
33
+
'BSD' => FreeBSDSystemUtil::findCommand($command) ?? thrownewWrongUsageException("{$command} not found, please install it or set {$env} to a valid path."),
34
+
default => thrownew \RuntimeException(__CLASS__ . ' is not supported on ' . PHP_OS_FAMILY . '.'),
Copy file name to clipboardExpand all lines: src/SPC/toolchain/GccNativeToolchain.php
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,17 @@ public function initEnv(): void
22
22
23
23
publicfunctionafterInit(): void
24
24
{
25
-
// check gcc exists
26
-
match (PHP_OS_FAMILY) {
27
-
'Linux' => LinuxSystemUtil::findCommand('g++') ?? thrownewWrongUsageException('g++ not found, please install it or set CC/CXX to a valid path.'),
28
-
'Darwin' => MacOSSystemUtil::findCommand('g++') ?? thrownewWrongUsageException('g++ not found, please install it or set CC/CXX to a valid path.'),
29
-
'BSD' => FreeBSDSystemUtil::findCommand('g++') ?? thrownewWrongUsageException('g++ not found, please install it or set CC/CXX to a valid path.'),
30
-
default => thrownew \RuntimeException('GCC is not supported on ' . PHP_OS_FAMILY . '.'),
31
-
};
25
+
foreach (['CC', 'CXX', 'AR', 'LD'] as$env) {
26
+
$command = getenv($env);
27
+
if (!$command || is_file($command)) {
28
+
continue;
29
+
}
30
+
match (PHP_OS_FAMILY) {
31
+
'Linux' => LinuxSystemUtil::findCommand($command) ?? thrownewWrongUsageException("{$command} not found, please install it or set {$env} to a valid path."),
32
+
'Darwin' => MacOSSystemUtil::findCommand($command) ?? thrownewWrongUsageException("{$command} not found, please install it or set {$env} to a valid path."),
33
+
'BSD' => FreeBSDSystemUtil::findCommand($command) ?? thrownewWrongUsageException("{$command} not found, please install it or set {$env} to a valid path."),
34
+
default => thrownew \RuntimeException(__CLASS__ . ' is not supported on ' . PHP_OS_FAMILY . '.'),
0 commit comments