Skip to content

Commit

Permalink
Enable building PHP extension on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-E committed Jun 17, 2023
1 parent 8997b54 commit 4259af1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions php/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pkg_files(
]) + [
"//:LICENSE",
"ext/google/protobuf/config.m4",
"ext/google/protobuf/config.w32",
"ext/google/protobuf/wkt.inc",
],
)
Expand Down
14 changes: 14 additions & 0 deletions php/ext/google/protobuf/config.w32
Original file line number Diff line number Diff line change
@@ -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<PHP_PROTOBUF_SRC_ARRAY.length; ++i) {
var basename = FSO.GetFileName(PHP_PROTOBUF_SRC_ARRAY[i]);
PHP_PROTOBUF_SOURCES = PHP_PROTOBUF_SOURCES + " " + basename;
}
ADD_SOURCES(configure_module_dirname + "/third_party/utf8_range", PHP_PROTOBUF_SOURCES, "PROTOBUF");
ADD_FLAG("CFLAGS_PROTOBUF", "/I" + configure_module_dirname + "/third_party/utf8_range");
EXTENSION("protobuf", "arena.c array.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c");
}

0 comments on commit 4259af1

Please sign in to comment.