Skip to content

Commit a0c5794

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents be2b5a1 + 2d214af commit a0c5794

File tree

5 files changed

+46
-23
lines changed

5 files changed

+46
-23
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
#[=============================================================================[
22
Zend Engine.
33
4-
## Targets
4+
Targets:
55
6-
* OBJECT library `zend` (ALIAS `Zend::Zend`) holds all Zend Engine objects
7-
and compile properties.
6+
* OBJECT library 'zend' (ALIAS Zend::Zend) holds all Zend Engine objects and
7+
compile properties.
88
9-
## Target properties
9+
Target properties:
1010
11-
CMake target properties for the `Zend::Zend` target:
11+
CMake target properties for the Zend::Zend target:
1212
13-
* `VERSION`
14-
15-
Zend Engine version as defined in the `Zend/zend.h` file.
16-
17-
* `ZEND_EXTENSION_API_NO`
13+
* VERSION
14+
Zend Engine version as defined in the Zend/zend.h file.
1815
16+
* ZEND_EXTENSION_API_NO
1917
Custom target property with internal API version number for PHP extensions
20-
(dynamically loaded with the `extension` INI directive). This is the
21-
`ZEND_MODULE_API_NO` number from the `Zend/zend_modules.h` and ensures that
22-
built extension is compatible with particular PHP build.
23-
24-
* `ZEND_MODULE_API_NO`
18+
(dynamically loaded with the 'extension' INI directive). This is the
19+
ZEND_MODULE_API_NO number from the Zend/zend_modules.h and ensures that built
20+
extension is compatible with particular PHP build.
2521
22+
* ZEND_MODULE_API_NO
2623
Custom target property with internal API version number for Zend extensions in
27-
PHP (dynamically loaded with the `zend_extension` INI directive), such as
28-
opcache, debuggers, profilers, etc. This is the `ZEND_EXTENSION_API_NO` number
29-
from the `Zend/zend_extensions.h` and ensures that built extension is
30-
compatible with particular PHP build.
24+
PHP (dynamically loaded with the 'zend_extension' INI directive), such as
25+
opcache, debuggers, profilers, etc. This is the ZEND_EXTENSION_API_NO number
26+
from the Zend/zend_extensions.h and ensures that built extension is compatible
27+
with particular PHP build.
3128
#]=============================================================================]
3229

3330
message(STATUS "")

cmake/cmake/Version.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ number from the php-src main/php.h header file.
66
77
Variables:
88
9-
* `PHP_API_VERSION`
10-
* `PHP_VERSION`
11-
* `PHP_VERSION_LABEL`
9+
* PHP_API_VERSION
10+
* PHP_VERSION
11+
* PHP_VERSION_LABEL
1212
#]=============================================================================]
1313

1414
include_guard(GLOBAL)

cmake/ext/standard/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,16 @@ target_sources(
503503
add_dependencies(php_ext_standard_functions php_ext_standard)
504504
add_dependencies(php_ext_standard_functions_cli php_ext_standard)
505505

506+
################################################################################
507+
# ext/standard depends on ext/zlib for SWC images and transitively depends on
508+
# the zlib library.
509+
# TODO: https://github.com/php/php-src/pull/4681
510+
################################################################################
511+
512+
if(PHP_EXT_ZLIB)
513+
add_dependencies(php_ext_standard php_ext_zlib)
514+
endif()
515+
506516
################################################################################
507517
# Configuration header
508518
################################################################################

cmake/ext/zlib/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ set_package_properties(
8585
PURPOSE "Necessary to enable the zlib extension."
8686
)
8787

88-
target_link_libraries(php_ext_zlib PRIVATE ZLIB::ZLIB)
88+
# Link publicly for internal_functions files.
89+
target_link_libraries(php_ext_zlib PUBLIC ZLIB::ZLIB)
8990

9091
set(HAVE_ZLIB TRUE)
9192

cmake/main/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ target_sources(php_sapi INTERFACE $<TARGET_OBJECTS:PHP::main>)
158158
# Add FastCGI target with objects for use in PHP SAPIs such as CGI and FPM.
159159
################################################################################
160160
add_library(php_main_fastcgi OBJECT fastcgi.c)
161+
add_dependencies(php_main_fastcgi php_main)
161162

162163
target_sources(
163164
php_sapi
@@ -172,6 +173,8 @@ target_sources(
172173

173174
add_library(php_main_internal_functions OBJECT internal_functions.c)
174175
add_library(php_main_internal_functions_cli OBJECT internal_functions_cli.c)
176+
add_dependencies(php_main_internal_functions php_main)
177+
add_dependencies(php_main_internal_functions_cli php_main)
175178

176179
target_sources(
177180
php_sapi
@@ -257,6 +260,18 @@ file(CONFIGURE OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/php_version.h CONTENT [[
257260
#define PHP_VERSION_ID @PHP_VERSION_ID@
258261
]])
259262

263+
################################################################################
264+
# When building external libraries with ExternalProject module, the library (and
265+
# its accompanying extension) should be built before the main target so the
266+
# internal functions files have possible library headers available when used in
267+
# extension headers (for example, php_openssl.h, php_zlib.h, etc.).
268+
################################################################################
269+
270+
get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS)
271+
foreach(extension IN LISTS extensions)
272+
add_dependencies(php_main PHP::ext::${extension})
273+
endforeach()
274+
260275
################################################################################
261276
# Generate configuration headers.
262277
################################################################################

0 commit comments

Comments
 (0)