Skip to content

Commit 9babe7f

Browse files
committed
Rename setCMakeBuildDir to setBuildDir
1 parent f46b714 commit 9babe7f

File tree

7 files changed

+15
-18
lines changed

7 files changed

+15
-18
lines changed

src/SPC/builder/macos/library/glfw.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class glfw extends MacOSLibraryBase
1919
protected function build(): void
2020
{
2121
UnixCMakeExecutor::create($this)
22-
->setCMakeBuildDir("{$this->source_dir}/vendor/glfw")
22+
->setBuildDir("{$this->source_dir}/vendor/glfw")
2323
->setReset(false)
2424
->addConfigureArgs(
2525
'-DGLFW_BUILD_EXAMPLES=OFF',

src/SPC/builder/unix/library/brotli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trait brotli
1818
protected function build(): void
1919
{
2020
UnixCMakeExecutor::create($this)
21-
->setCMakeBuildDir("{$this->getSourceDir()}/build-dir")
21+
->setBuildDir("{$this->getSourceDir()}/build-dir")
2222
->build();
2323

2424
$this->patchPkgconfPrefix(['libbrotlicommon.pc', 'libbrotlidec.pc', 'libbrotlienc.pc']);

src/SPC/builder/unix/library/libaom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait libaom
1717
protected function build(): void
1818
{
1919
UnixCMakeExecutor::create($this)
20-
->setCMakeBuildDir("{$this->source_dir}/builddir")
20+
->setBuildDir("{$this->source_dir}/builddir")
2121
->addConfigureArgs('-DAOM_TARGET_GPU=generic')
2222
->build();
2323
$this->patchPkgconfPrefix(['aom.pc']);

src/SPC/builder/unix/library/snappy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait snappy
1717
protected function build(): void
1818
{
1919
UnixCMakeExecutor::create($this)
20-
->setCMakeBuildDir("{$this->source_dir}/cmake/build")
20+
->setBuildDir("{$this->source_dir}/cmake/build")
2121
->addConfigureArgs(
2222
'-DSNAPPY_BUILD_TESTS=OFF',
2323
'-DSNAPPY_BUILD_BENCHMARKS=OFF',

src/SPC/builder/unix/library/tidy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait tidy
1717
protected function build(): void
1818
{
1919
UnixCMakeExecutor::create($this)
20-
->setCMakeBuildDir("{$this->source_dir}/build-dir")
20+
->setBuildDir("{$this->source_dir}/build-dir")
2121
->addConfigureArgs('-DSUPPORT_CONSOLE_APP=OFF')
2222
->build();
2323
$this->patchPkgconfPrefix(['tidy.pc']);

src/SPC/builder/unix/library/zstd.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait zstd
1717
protected function build(): void
1818
{
1919
UnixCMakeExecutor::create($this)
20-
->setCMakeBuildDir("{$this->source_dir}/build/cmake/build")
20+
->setBuildDir("{$this->source_dir}/build/cmake/build")
2121
->addConfigureArgs(
2222
'-DZSTD_BUILD_STATIC=ON',
2323
'-DZSTD_BUILD_SHARED=OFF',

src/SPC/util/executor/UnixCMakeExecutor.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class UnixCMakeExecutor extends Executor
1616
{
17-
protected ?string $cmake_build_dir = null;
17+
protected ?string $build_dir = null;
1818

1919
protected array $configure_args = [];
2020

@@ -27,10 +27,10 @@ class UnixCMakeExecutor extends Executor
2727
public function build(string $build_pos = '..'): void
2828
{
2929
// set cmake dir
30-
$this->initCMakeBuildDir();
30+
$this->initBuildDir();
3131

3232
if ($this->reset) {
33-
FileSystem::resetDir($this->cmake_build_dir);
33+
FileSystem::resetDir($this->build_dir);
3434
}
3535

3636
// prepare environment variables
@@ -41,7 +41,7 @@ public function build(string $build_pos = '..'): void
4141
];
4242

4343
// prepare shell
44-
$shell = shell()->cd($this->cmake_build_dir)->setEnv($env);
44+
$shell = shell()->cd($this->build_dir)->setEnv($env);
4545

4646
// config
4747
$this->steps >= 1 && $shell->execWithEnv("cmake {$this->getConfigureArgs()} {$this->getDefaultCMakeArgs()} {$build_pos}");
@@ -99,9 +99,9 @@ public function toStep(int $step): static
9999
*
100100
* @param string $dir custom CMake build directory
101101
*/
102-
public function setCMakeBuildDir(string $dir): static
102+
public function setBuildDir(string $dir): static
103103
{
104-
$this->cmake_build_dir = $dir;
104+
$this->build_dir = $dir;
105105
return $this;
106106
}
107107

@@ -152,15 +152,12 @@ private function getDefaultCMakeArgs(): string
152152
/**
153153
* Initialize the CMake build directory.
154154
* If the directory is not set, it defaults to the library's source directory with '/build' appended.
155-
*
156-
* @throws FileSystemException
157155
*/
158-
private function initCMakeBuildDir(): void
156+
private function initBuildDir(): void
159157
{
160-
if ($this->cmake_build_dir === null) {
161-
$this->cmake_build_dir = "{$this->library->getSourceDir()}/build";
158+
if ($this->build_dir === null) {
159+
$this->build_dir = "{$this->library->getSourceDir()}/build";
162160
}
163-
FileSystem::resetDir($this->cmake_build_dir);
164161
}
165162

166163
/**

0 commit comments

Comments
 (0)