mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 06:45:39 +08:00
use pkgconfig to determine libs
This commit is contained in:
@@ -24,6 +24,8 @@ class UnixCMakeExecutor extends Executor
|
||||
|
||||
protected bool $reset = true;
|
||||
|
||||
protected array $extra_env = [];
|
||||
|
||||
public function build(string $build_pos = '..'): void
|
||||
{
|
||||
// set cmake dir
|
||||
@@ -34,7 +36,7 @@ class UnixCMakeExecutor extends Executor
|
||||
}
|
||||
|
||||
// prepare shell
|
||||
$shell = shell()->cd($this->build_dir)->initializeEnv($this->library);
|
||||
$shell = shell()->cd($this->build_dir)->initializeEnv($this->library)->appendEnv($this->extra_env);
|
||||
|
||||
// config
|
||||
$this->steps >= 1 && $shell->exec("cmake {$this->getConfigureArgs()} {$this->getDefaultCMakeArgs()} {$build_pos}");
|
||||
@@ -77,6 +79,15 @@ class UnixCMakeExecutor extends Executor
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add extra environment flags
|
||||
*/
|
||||
public function addExtraEnv(array $env): static
|
||||
{
|
||||
$this->extra_env = [...$this->extra_env, ...$env];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* To build steps.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user