Add reset function

This commit is contained in:
crazywhalecc
2025-06-09 01:33:21 +08:00
parent 42943b315c
commit f7871c0036

View File

@@ -20,11 +20,16 @@ class UnixCMakeExecutor extends Executor
protected int $steps = 3; protected int $steps = 3;
protected bool $reset = true;
public function build(string $build_pos = '..'): void public function build(string $build_pos = '..'): void
{ {
// set cmake dir // set cmake dir
$this->initCMakeBuildDir(); $this->initCMakeBuildDir();
FileSystem::resetDir($this->cmake_build_dir);
if ($this->reset) {
FileSystem::resetDir($this->cmake_build_dir);
}
// prepare environment variables // prepare environment variables
$env = [ $env = [
@@ -101,6 +106,12 @@ class UnixCMakeExecutor extends Executor
return $this; return $this;
} }
public function setReset(bool $reset): static
{
$this->reset = $reset;
return $this;
}
/** /**
* Get configure argument line. * Get configure argument line.
*/ */