mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 00:35:41 +08:00
merge cmake changes from master into icurel
This commit is contained in:
@@ -6,7 +6,7 @@ namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
|
||||
trait libzip
|
||||
{
|
||||
@@ -16,31 +16,20 @@ trait libzip
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$extra = '';
|
||||
// lib:bzip2
|
||||
$extra .= $this->builder->getLib('bzip2') ? '-DENABLE_BZIP2=ON ' : '-DENABLE_BZIP2=OFF ';
|
||||
// lib:xz
|
||||
$extra .= $this->builder->getLib('xz') ? '-DENABLE_LZMA=ON ' : '-DENABLE_LZMA=OFF ';
|
||||
// lib:zstd (disabled due to imagemagick link issue
|
||||
$extra .= /* $this->builder->getLib('zstd') ? '-DENABLE_ZSTD=ON ' : */ '-DENABLE_ZSTD=OFF ';
|
||||
// lib:openssl
|
||||
$extra .= $this->builder->getLib('openssl') ? '-DENABLE_OPENSSL=ON ' : '-DENABLE_OPENSSL=OFF ';
|
||||
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec(
|
||||
"cmake {$this->builder->makeCmakeArgs()} " .
|
||||
'-DENABLE_GNUTLS=OFF ' .
|
||||
'-DENABLE_MBEDTLS=OFF ' .
|
||||
'-DBUILD_DOC=OFF ' .
|
||||
'-DBUILD_EXAMPLES=OFF ' .
|
||||
'-DBUILD_REGRESS=OFF ' .
|
||||
'-DBUILD_TOOLS=OFF ' .
|
||||
$extra .
|
||||
'..'
|
||||
UnixCMakeExecutor::create($this)
|
||||
->optionalLib('bzip2', ...cmake_boolean_args('ENABLE_BZIP2'))
|
||||
->optionalLib('xz', ...cmake_boolean_args('ENABLE_LZMA'))
|
||||
->optionalLib('openssl', ...cmake_boolean_args('ENABLE_OPENSSL'))
|
||||
->optionalLib('zstd', ...cmake_boolean_args('ENABLE_ZSTD'))
|
||||
->addConfigureArgs(
|
||||
'-DENABLE_GNUTLS=OFF',
|
||||
'-DENABLE_MBEDTLS=OFF',
|
||||
'-DBUILD_DOC=OFF',
|
||||
'-DBUILD_EXAMPLES=OFF',
|
||||
'-DBUILD_REGRESS=OFF',
|
||||
'-DBUILD_TOOLS=OFF',
|
||||
)
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
->build();
|
||||
$this->patchPkgconfPrefix(['libzip.pc'], PKGCONF_PATCH_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user