Use cmake executor instead of raw command

This commit is contained in:
crazywhalecc
2025-06-09 01:07:30 +08:00
parent 7d26aa533a
commit 1718806042
23 changed files with 151 additions and 394 deletions

View File

@@ -4,9 +4,9 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\builder\unix\executor\UnixCMakeExecutor;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait snappy
{
@@ -16,17 +16,12 @@ trait snappy
*/
protected function build(): void
{
FileSystem::resetDir($this->source_dir . '/cmake/build');
shell()->cd($this->source_dir . '/cmake/build')
->exec(
'cmake ' .
"{$this->builder->makeCmakeArgs()} " .
'-DSNAPPY_BUILD_TESTS=OFF ' .
'-DSNAPPY_BUILD_BENCHMARKS=OFF ' .
'../..'
UnixCMakeExecutor::create($this)
->setCMakeBuildDir("{$this->source_dir}/cmake/build")
->addConfigureArgs(
'-DSNAPPY_BUILD_TESTS=OFF',
'-DSNAPPY_BUILD_BENCHMARKS=OFF',
)
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install');
->build('../..');
}
}