Skip to content

Commit 5491502

Browse files
authored
Fix zlib produced lib file names from different zlib version (#1066)
1 parent 4625c6a commit 5491502

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

src/SPC/builder/windows/library/zlib.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,23 @@ protected function build(): void
3131
$this->builder->makeSimpleWrapper('cmake'),
3232
"--build build --config Release --target install -j{$this->builder->concurrency}"
3333
);
34-
copy(BUILD_LIB_PATH . '\zlibstatic.lib', BUILD_LIB_PATH . '\zlib_a.lib');
35-
unlink(BUILD_ROOT_PATH . '\bin\zlib.dll');
36-
unlink(BUILD_LIB_PATH . '\zlib.lib');
34+
$detect_list = [
35+
'zlibstatic.lib',
36+
'zs.lib',
37+
'libzs.lib',
38+
];
39+
foreach ($detect_list as $item) {
40+
if (file_exists(BUILD_LIB_PATH . '\\' . $item)) {
41+
FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlib_a.lib');
42+
FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlibstatic.lib');
43+
break;
44+
}
45+
}
46+
FileSystem::removeFileIfExists(BUILD_ROOT_PATH . '\bin\zlib.dll');
47+
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\zlib.lib');
48+
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.dll');
49+
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.lib');
50+
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.lib');
51+
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.dll');
3752
}
3853
}

src/globals/test-extensions.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// test php version (8.1 ~ 8.4 available, multiple for matrix)
1515
$test_php_version = [
16-
// '8.1',
16+
'8.1',
1717
// '8.2',
1818
// '8.3',
1919
'8.4',
@@ -23,15 +23,15 @@
2323

2424
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
2525
$test_os = [
26-
'macos-15-intel', // bin/spc for x86_64
27-
'macos-15', // bin/spc for arm64
26+
// 'macos-15-intel', // bin/spc for x86_64
27+
// 'macos-15', // bin/spc for arm64
2828
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
29-
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
30-
'ubuntu-24.04', // bin/spc for x86_64
31-
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
32-
'ubuntu-24.04-arm', // bin/spc for arm64
29+
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
30+
// 'ubuntu-24.04', // bin/spc for x86_64
31+
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
32+
// 'ubuntu-24.04-arm', // bin/spc for arm64
3333
// 'windows-2022', // .\bin\spc.ps1
34-
// 'windows-2025',
34+
'windows-2025', // .\bin\spc.ps1
3535
];
3636

3737
// whether enable thread safe
@@ -51,7 +51,7 @@
5151
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5252
$extensions = match (PHP_OS_FAMILY) {
5353
'Linux', 'Darwin' => 'pdo_odbc',
54-
'Windows' => 'com_dotnet',
54+
'Windows' => 'zlib,phar,mbstring,mbregex,sockets',
5555
};
5656

5757
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).

0 commit comments

Comments
 (0)