From 0bc143cac38deb11ff1b03ffc0f49ba097a7aad3 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Thu, 20 Mar 2025 09:22:10 +0800 Subject: [PATCH] Fix windows curl build >= 8.3 (#660) * Test windows curl * Test windows curl * Fix windows curl build for PHP 8.3 and 8.4 --- config/lib.json | 2 +- src/SPC/builder/windows/library/curl.php | 2 ++ src/globals/test-extensions.php | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config/lib.json b/config/lib.json index 33841c7b..8e728ccd 100644 --- a/config/lib.json +++ b/config/lib.json @@ -68,7 +68,7 @@ "libcurl.a" ], "static-libs-windows": [ - "libcurl.lib" + "libcurl_a.lib" ], "headers": [ "curl" diff --git a/src/SPC/builder/windows/library/curl.php b/src/SPC/builder/windows/library/curl.php index 1ba0eb06..df195735 100644 --- a/src/SPC/builder/windows/library/curl.php +++ b/src/SPC/builder/windows/library/curl.php @@ -48,5 +48,7 @@ class curl extends WindowsLibraryBase $this->builder->makeSimpleWrapper('cmake'), "--build cmakebuild --config Release --target install -j{$this->builder->concurrency}" ); + // move libcurl.lib to libcurl_a.lib + rename(BUILD_LIB_PATH . '\libcurl.lib', BUILD_LIB_PATH . '\libcurl_a.lib'); } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index a42210b9..1f67b2eb 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,18 +13,18 @@ declare(strict_types=1); // test php version $test_php_version = [ - // '8.1', - // '8.2', + '8.1', + '8.2', '8.3', '8.4', ]; // test os (macos-13, macos-14, ubuntu-latest, windows-latest are available) $test_os = [ - 'macos-13', - 'macos-14', - 'ubuntu-latest', - // 'windows-latest', + // 'macos-13', + // 'macos-14', + // 'ubuntu-latest', + 'windows-latest', ]; // whether enable thread safe @@ -41,13 +41,13 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { 'Linux', 'Darwin' => 'gd', - 'Windows' => 'bcmath', + 'Windows' => 'bz2,ctype,curl,dom,filter,gd,iconv,mbstring,opcache,openssl,pdo,pdo_sqlite,phar,session,simplexml,sqlite3,tokenizer,xml,xmlwriter,yaml,zip,zlib', }; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = match (PHP_OS_FAMILY) { 'Linux', 'Darwin' => 'freetype', - 'Windows' => '', + 'Windows' => 'libjpeg,libavif,freetype,libwebp', }; // Please change your test base combination. We recommend testing with `common`.