fix libtiff libs being defined after configure

This commit is contained in:
DubbleClick
2025-07-20 01:13:51 +07:00
parent 2ef64e4597
commit 230879a0db
4 changed files with 35 additions and 12 deletions

View File

@@ -4,10 +4,28 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
use SPC\util\executor\UnixCMakeExecutor;
use SPC\util\SPCTarget;
trait libjxl
{
public function patchBeforeBuild(): bool
{
$depsContent = file_get_contents($this->source_dir . '/deps.sh');
if (str_contains($depsContent, '# return 0')) {
return false;
}
FileSystem::replaceFileStr(
$this->source_dir . '/deps.sh',
'return 0',
'# return 0',
);
shell()->cd($this->source_dir)
->exec('./deps.sh');
return true;
}
protected function build(): void
{
UnixCMakeExecutor::create($this)
@@ -17,7 +35,7 @@ trait libjxl
->addConfigureArgs('-DJPEGXL_ENABLE_BENCHMARK=OFF')
->addConfigureArgs('-DJPEGXL_ENABLE_PLUGINS=OFF')
->addConfigureArgs('-DJPEGXL_ENABLE_SJPEG=OFF')
->addConfigureArgs('-DJPEGXL_STATIC=ON')
->addConfigureArgs('-DJPEGXL_STATIC=' . SPCTarget::isStatic() ? 'ON' : 'OFF')
->addConfigureArgs('-DBUILD_TESTING=OFF')
->build();
}