Skip to content

Commit 4558204

Browse files
authored
Fix libavif build on VS2019 syntax error (#649)
* Test old source of libavif * Test old source of libavif * Fix libavif 1.2.0 bug
1 parent b4f3657 commit 4558204

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class libavif extends WindowsLibraryBase
1212

1313
protected function build(): void
1414
{
15+
// workaround for libavif 1.2.0 bug
16+
FileSystem::replaceFileStr($this->source_dir . '\src\read.c', 'avifFileType ftyp = {};', 'avifFileType ftyp = { 0 };');
1517
// reset cmake
1618
FileSystem::resetDir($this->source_dir . '\build');
1719

src/globals/test-extensions.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
// test php version
1515
$test_php_version = [
1616
'8.1',
17-
'8.2',
18-
'8.3',
17+
// '8.2',
18+
// '8.3',
1919
'8.4',
2020
];
2121

2222
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
2323
$test_os = [
24-
'macos-13',
25-
'macos-14',
26-
'ubuntu-latest',
27-
// 'windows-latest',
24+
// 'macos-13',
25+
// 'macos-14',
26+
// 'ubuntu-latest',
27+
'windows-2019',
28+
'windows-latest',
2829
];
2930

3031
// whether enable thread safe
@@ -41,13 +42,13 @@
4142
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
4243
$extensions = match (PHP_OS_FAMILY) {
4344
'Linux', 'Darwin' => 'gettext',
44-
'Windows' => 'bcmath',
45+
'Windows' => 'gd',
4546
};
4647

4748
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
4849
$with_libs = match (PHP_OS_FAMILY) {
4950
'Linux', 'Darwin' => '',
50-
'Windows' => '',
51+
'Windows' => 'libavif',
5152
};
5253

5354
// Please change your test base combination. We recommend testing with `common`.

0 commit comments

Comments
 (0)