30 lines
719 B
PHP
Raw Normal View History

2023-09-03 15:49:15 +02:00
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\builder\macos\MacOSBuilder;
use SPC\store\FileSystem;
2023-09-03 15:49:15 +02:00
use SPC\util\CustomExt;
#[CustomExt('snappy')]
class snappy extends Extension
{
public function patchBeforeConfigure(): bool
{
FileSystem::replaceFileRegex(
SOURCE_PATH . '/php-src/configure',
'/-lsnappy/',
2023-09-03 19:22:10 +02:00
$this->getLibFilesString() . ($this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++')
);
return true;
}
public function getUnixConfigureArg(bool $shared = false): string
2023-09-03 15:49:15 +02:00
{
return '--enable-snappy --with-snappy-includedir="' . BUILD_ROOT_PATH . '"';
}
}