2024-02-22 14:37:10 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\windows\library;
|
|
|
|
|
|
|
|
|
|
use SPC\store\FileSystem;
|
|
|
|
|
|
|
|
|
|
class curl extends WindowsLibraryBase
|
|
|
|
|
{
|
|
|
|
|
public const NAME = 'curl';
|
|
|
|
|
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
|
|
|
|
// reset cmake
|
|
|
|
|
FileSystem::resetDir($this->source_dir . '\build');
|
|
|
|
|
|
|
|
|
|
// start build
|
|
|
|
|
cmd()->cd($this->source_dir)
|
|
|
|
|
->execWithWrapper(
|
|
|
|
|
$this->builder->makeSimpleWrapper('cmake'),
|
|
|
|
|
'-B build ' .
|
|
|
|
|
'-A x64 ' .
|
|
|
|
|
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
|
|
|
|
'-DCMAKE_BUILD_TYPE=Release ' .
|
|
|
|
|
'-DBUILD_SHARED_LIBS=OFF ' .
|
|
|
|
|
'-DBUILD_STATIC_LIBS=ON ' .
|
|
|
|
|
'-DBUILD_CURL_EXE=OFF ' .
|
|
|
|
|
'-DUSE_ZLIB=ON ' .
|
|
|
|
|
'-DCURL_USE_OPENSSL=ON ' .
|
|
|
|
|
'-DCURL_USE_LIBLSSH2=ON ' .
|
2024-02-23 11:41:35 +08:00
|
|
|
'-DUSE_NGHTTP2=ON ' . // php-src with curl needs nghttp2
|
2024-02-22 14:37:10 +08:00
|
|
|
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
|
|
|
|
)
|
|
|
|
|
->execWithWrapper(
|
|
|
|
|
$this->builder->makeSimpleWrapper('cmake'),
|
|
|
|
|
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|