Add ext-zstd for Windows

This commit is contained in:
crazywhalecc
2026-04-10 21:09:46 +08:00
parent 58eb769ddf
commit e83a997d0c
3 changed files with 6 additions and 1 deletions

View File

@@ -11,5 +11,8 @@ ext-zstd:
license: MIT
depends:
- zstd
suggests:
- ext-apcu
php-extension:
arg-type: '--enable-zstd --with-libzstd=@build_root_path@'
arg-type@windows: '--enable-zstd'

View File

@@ -18,4 +18,4 @@ zstd:
static-libs@unix:
- libzstd.a
static-libs@windows:
- zstd_static.lib
- zstd.lib

View File

@@ -9,6 +9,7 @@ use StaticPHP\Attribute\Package\Library;
use StaticPHP\Package\LibraryPackage;
use StaticPHP\Runtime\Executor\UnixCMakeExecutor;
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
use StaticPHP\Util\FileSystem;
#[Library('zstd')]
class zstd
@@ -24,6 +25,7 @@ class zstd
'-DZSTD_BUILD_SHARED=OFF',
)
->build();
FileSystem::copy($package->getLibDir() . '\zstd_static.lib', $package->getLibDir() . '/zstd.lib');
}
#[BuildFor('Linux')]