From 92861669c25add6d27d879c6b245810ff2829415 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 21 Mar 2026 00:31:30 +0800 Subject: [PATCH] Add nghttp2 --- config/pkg/lib/nghttp2.yml | 2 ++ src/Package/Library/nghttp2.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/config/pkg/lib/nghttp2.yml b/config/pkg/lib/nghttp2.yml index 166c33ac..11521d5a 100644 --- a/config/pkg/lib/nghttp2.yml +++ b/config/pkg/lib/nghttp2.yml @@ -22,3 +22,5 @@ nghttp2: - libnghttp2 static-libs@unix: - libnghttp2.a + static-libs@windows: + - nghttp2.lib diff --git a/src/Package/Library/nghttp2.php b/src/Package/Library/nghttp2.php index 3a85ada4..f0965947 100644 --- a/src/Package/Library/nghttp2.php +++ b/src/Package/Library/nghttp2.php @@ -8,10 +8,26 @@ use StaticPHP\Attribute\Package\BuildFor; use StaticPHP\Attribute\Package\Library; use StaticPHP\Package\LibraryPackage; use StaticPHP\Runtime\Executor\UnixAutoconfExecutor; +use StaticPHP\Runtime\Executor\WindowsCMakeExecutor; #[Library('nghttp2')] class nghttp2 { + #[BuildFor('Windows')] + public function buildWin(LibraryPackage $lib): void + { + WindowsCMakeExecutor::create($lib) + ->addConfigureArgs( + '-DENABLE_SHARED_LIB=OFF', + '-DENABLE_STATIC_LIB=ON', + '-DENABLE_STATIC_CRT=ON', + '-DENABLE_LIB_ONLY=ON', + '-DENABLE_DOC=OFF', + '-DBUILD_TESTING=OFF', + ) + ->build(); + } + #[BuildFor('Linux')] #[BuildFor('Darwin')] public function build(LibraryPackage $lib): void