2023-09-03 15:49:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
use SPC\store\FileSystem;
|
|
|
|
|
|
|
|
|
|
trait snappy
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
|
|
|
|
FileSystem::resetDir($this->source_dir . '/cmake/build');
|
|
|
|
|
|
|
|
|
|
shell()->cd($this->source_dir . '/cmake/build')
|
|
|
|
|
->exec(
|
|
|
|
|
"{$this->builder->configure_env} cmake " .
|
2023-09-03 18:59:00 +02:00
|
|
|
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
|
|
|
|
'-DCMAKE_BUILD_TYPE=Release ' .
|
|
|
|
|
'-DCMAKE_INSTALL_PREFIX=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' .
|
2023-09-03 15:49:15 +02:00
|
|
|
'-DSNAPPY_BUILD_TESTS=OFF ' .
|
|
|
|
|
'-DSNAPPY_BUILD_BENCHMARKS=OFF ' .
|
|
|
|
|
'../..'
|
|
|
|
|
)
|
|
|
|
|
->exec("cmake --build . -j {$this->builder->concurrency}")
|
2023-09-03 18:59:00 +02:00
|
|
|
->exec('make install');
|
2023-09-03 15:49:15 +02:00
|
|
|
}
|
|
|
|
|
}
|