Fix libavif build on VS2019 syntax error (#649)

* Test old source of libavif

* Test old source of libavif

* Fix libavif 1.2.0 bug
This commit is contained in:
Jerry Ma 2025-03-14 23:37:01 +08:00 committed by GitHub
parent b4f3657323
commit 4558204962
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 8 deletions

View File

@ -12,6 +12,8 @@ class libavif extends WindowsLibraryBase
protected function build(): void protected function build(): void
{ {
// workaround for libavif 1.2.0 bug
FileSystem::replaceFileStr($this->source_dir . '\src\read.c', 'avifFileType ftyp = {};', 'avifFileType ftyp = { 0 };');
// reset cmake // reset cmake
FileSystem::resetDir($this->source_dir . '\build'); FileSystem::resetDir($this->source_dir . '\build');

View File

@ -14,17 +14,18 @@ declare(strict_types=1);
// test php version // test php version
$test_php_version = [ $test_php_version = [
'8.1', '8.1',
'8.2', // '8.2',
'8.3', // '8.3',
'8.4', '8.4',
]; ];
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available) // test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
$test_os = [ $test_os = [
'macos-13', // 'macos-13',
'macos-14', // 'macos-14',
'ubuntu-latest', // 'ubuntu-latest',
// 'windows-latest', 'windows-2019',
'windows-latest',
]; ];
// whether enable thread safe // whether enable thread safe
@ -41,13 +42,13 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) { $extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'gettext', 'Linux', 'Darwin' => 'gettext',
'Windows' => 'bcmath', 'Windows' => 'gd',
}; };
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
$with_libs = match (PHP_OS_FAMILY) { $with_libs = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => '', 'Linux', 'Darwin' => '',
'Windows' => '', 'Windows' => 'libavif',
}; };
// Please change your test base combination. We recommend testing with `common`. // Please change your test base combination. We recommend testing with `common`.