-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 phalcon/cphalcon#16318 (comment) for the request to build the extension and the result. Please review and merge. Closes #13097 COPYBARA_INTEGRATE_REVIEW=#13097 from Jan-E:php-windows 4259af1 PiperOrigin-RevId: 542050878
- Loading branch information
1 parent
33b8c45
commit 4d9bbac
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} |
4d9bbac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is over a year ago that this was committed, but the module no longer builds under windows, as highlighted by this issue.
#17852
The above config attempts to compile all files in utf8_range, but a couple of them include <sys/time.h> which isn't compatible with windows. Only one file from the utf8_range library is needed, as is shown in the Linux build config which only compiles third_party/utf8_range/utf8_range.c
I added a workaround in the issue, but it could probably be simplified even further, fixing the issue.
I'm happy to put the work in and produce a PR, just let me know, but perhaps could gain more acceptance if it was to come from yourself.
Let me know if I can help.
@Jan-E