26 lines
644 B
PHP
Raw Normal View History

2023-11-21 23:12:00 +08:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
2025-06-09 09:24:31 +08:00
use SPC\util\executor\UnixCMakeExecutor;
2023-11-21 23:12:00 +08:00
trait tidy
{
protected function build(): void
{
2025-06-09 15:52:17 +07:00
$cmake = UnixCMakeExecutor::create($this)
2025-06-09 09:26:39 +08:00
->setBuildDir("{$this->source_dir}/build-dir")
2025-06-09 13:08:28 +08:00
->addConfigureArgs(
'-DSUPPORT_CONSOLE_APP=OFF',
'-DBUILD_SHARED_LIB=OFF'
2025-06-09 15:52:17 +07:00
);
if (version_compare(get_cmake_version(), '4.0.0', '>=')) {
$cmake->addConfigureArgs('-DCMAKE_POLICY_VERSION_MINIMUM=3.5');
}
$cmake->build();
2023-11-21 23:12:00 +08:00
$this->patchPkgconfPrefix(['tidy.pc']);
}
}