mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-11 02:45:37 +08:00
fable output
This commit is contained in:
@@ -35,12 +35,22 @@ class curl
|
||||
#[BuildFor('Windows')]
|
||||
public function buildWin(LibraryPackage $lib): void
|
||||
{
|
||||
$lib_dir = str_replace('\\', '/', $lib->getLibDir());
|
||||
// Pass zstd's import library by absolute path. A bare name ("zstd_static.lib") lands on the
|
||||
// link line unresolved and MSVC looks for it relative to the curl build dir (LNK1181).
|
||||
$zstd_lib = "{$lib_dir}/zstd_static.lib";
|
||||
// libssh2 uses the OpenSSL crypto backend, but this curl build links Schannel and never
|
||||
// find_package(OpenSSL), so libcrypto/libssl are absent from the link line and libssh2's
|
||||
// EVP_*/RAND/PEM/ERR symbols go unresolved. Append them (plus the Win32 libs OpenSSL needs,
|
||||
// mirroring openssl.php) to every target. MSVC's linker resolves regardless of order.
|
||||
$extra_libs = "{$lib_dir}/libcrypto.lib {$lib_dir}/libssl.lib ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib";
|
||||
WindowsCMakeExecutor::create($lib)
|
||||
->optionalPackage('zstd', ...cmake_boolean_args('CURL_ZSTD'))
|
||||
->optionalPackage('brotli', ...cmake_boolean_args('CURL_BROTLI'))
|
||||
->addConfigureArgs(
|
||||
'-DBUILD_CURL_EXE=ON',
|
||||
'-DZSTD_LIBRARY=zstd_static.lib',
|
||||
'-DCMAKE_C_STANDARD_LIBRARIES=' . escapeshellarg($extra_libs),
|
||||
'-DZSTD_LIBRARY=' . escapeshellarg($zstd_lib),
|
||||
'-DBUILD_TESTING=OFF',
|
||||
'-DBUILD_EXAMPLES=OFF',
|
||||
'-DUSE_LIBIDN2=OFF',
|
||||
|
||||
Reference in New Issue
Block a user