2023-11-21 23:12:00 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
use SPC\store\FileSystem;
|
|
|
|
|
|
|
|
|
|
trait tidy
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
|
|
|
|
FileSystem::resetDir($this->source_dir . '/build-dir');
|
|
|
|
|
shell()->cd($this->source_dir . '/build-dir')
|
|
|
|
|
->exec(
|
|
|
|
|
'cmake ' .
|
|
|
|
|
"{$this->builder->makeCmakeArgs()} " .
|
|
|
|
|
'-DBUILD_SHARED_LIB=OFF ' .
|
|
|
|
|
'-DSUPPORT_CONSOLE_APP=OFF ' .
|
|
|
|
|
'..'
|
|
|
|
|
)
|
|
|
|
|
->exec("cmake --build . -j {$this->builder->concurrency}")
|
2025-03-10 00:39:20 +08:00
|
|
|
->exec('make install');
|
2023-11-21 23:12:00 +08:00
|
|
|
$this->patchPkgconfPrefix(['tidy.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|