From 4d9bbac167a651db960c4d334fa1c47ecd5130e2 Mon Sep 17 00:00:00 2001 From: Jan Ehrhardt Date: Tue, 20 Jun 2023 14:32:00 -0700 Subject: [PATCH] Enable building PHP extension on Windows (#13097) This PR adds a config.w32 for the PHP extension and includes it in the tgz for PECL. I used this to build php_protobuf.dll for PHP 8.2.7. See https://github.com/phalcon/cphalcon/issues/16318#issuecomment-1592534432 for the request to build the extension and the result. Please review and merge. Closes #13097 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13097 from Jan-E:php-windows 4259af166872d662d719582031eaa6905c98323e PiperOrigin-RevId: 542050878 --- php/BUILD.bazel | 1 + php/ext/google/protobuf/config.w32 | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 php/ext/google/protobuf/config.w32 diff --git a/php/BUILD.bazel b/php/BUILD.bazel index e3be2225ed88..86b19e6e02d6 100644 --- a/php/BUILD.bazel +++ b/php/BUILD.bazel @@ -148,6 +148,7 @@ pkg_files( ]) + [ "//:LICENSE", "ext/google/protobuf/config.m4", + "ext/google/protobuf/config.w32", "ext/google/protobuf/wkt.inc", ], ) diff --git a/php/ext/google/protobuf/config.w32 b/php/ext/google/protobuf/config.w32 new file mode 100644 index 000000000000..825197c409bd --- /dev/null +++ b/php/ext/google/protobuf/config.w32 @@ -0,0 +1,14 @@ +ARG_ENABLE("protobuf", "whether to enable Protobuf extension", "no"); + +if (PHP_PROTOBUF != "no") { + + var PHP_PROTOBUF_SRC_ARRAY = glob(configure_module_dirname + "/third_party/utf8_range/*.c"); + var PHP_PROTOBUF_SOURCES=" "; + for (var i=0; i