mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +08:00
Allow set current working dir
This commit is contained in:
@@ -17,7 +17,7 @@ class zstd
|
|||||||
public function buildWin(LibraryPackage $package): void
|
public function buildWin(LibraryPackage $package): void
|
||||||
{
|
{
|
||||||
WindowsCMakeExecutor::create($package)
|
WindowsCMakeExecutor::create($package)
|
||||||
->setRootDir("{$package->getSourceDir()}/build/cmake")
|
->setWorkingDir("{$package->getSourceDir()}/build/cmake")
|
||||||
->setBuildDir("{$package->getSourceDir()}/build/cmake/build")
|
->setBuildDir("{$package->getSourceDir()}/build/cmake/build")
|
||||||
->addConfigureArgs(
|
->addConfigureArgs(
|
||||||
'-DZSTD_BUILD_STATIC=ON',
|
'-DZSTD_BUILD_STATIC=ON',
|
||||||
|
|||||||
@@ -176,6 +176,12 @@ class WindowsCMakeExecutor extends Executor
|
|||||||
return implode(' ', array_merge($this->configure_args, $this->getDefaultCMakeArgs()));
|
return implode(' ', array_merge($this->configure_args, $this->getDefaultCMakeArgs()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setWorkingDir(string $dir): static
|
||||||
|
{
|
||||||
|
$this->cmd = $this->cmd->cd($dir);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default CMake args.
|
* Returns the default CMake args.
|
||||||
*/
|
*/
|
||||||
@@ -207,12 +213,12 @@ class WindowsCMakeExecutor extends Executor
|
|||||||
private function initBuildDir(): void
|
private function initBuildDir(): void
|
||||||
{
|
{
|
||||||
if ($this->build_dir === null) {
|
if ($this->build_dir === null) {
|
||||||
$this->build_dir = "{$this->package->getSourceDir()}\\build";
|
$this->build_dir = "{$this->package->getSourceRoot()}\\build";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function initCmd(): void
|
private function initCmd(): void
|
||||||
{
|
{
|
||||||
$this->cmd = cmd()->cd($this->package->getSourceDir());
|
$this->cmd = cmd()->cd($this->package->getSourceRoot());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user