use pkgconfig to determine libs

This commit is contained in:
DubbleClick
2025-07-21 12:10:14 +07:00
parent 81a59be0c4
commit e98e221d93
5 changed files with 51 additions and 7 deletions

View File

@@ -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.
*