create helper method to pass environment variables to 'make'

This commit is contained in:
DubbleClick
2023-10-24 12:21:36 +02:00
parent 9b9644fe63
commit c24dc8f518
3 changed files with 16 additions and 3 deletions

View File

@@ -319,6 +319,18 @@ abstract class BuilderBase
$this->options[$key] = $value;
}
public function getEnvString(array $vars = ['cc', 'cxx', 'ar', 'ld']): string
{
$env = [];
foreach ($vars as $var) {
$var = strtoupper($var);
if (getenv($var) !== false) {
$env[] = "{$var}=" . getenv($var);
}
}
return implode(' ', $env);
}
/**
* Check if all libs are downloaded.
* If not, throw exception.