Skip to content

Commit d692712

Browse files
committed
Rename php_sapis_config to php_sapi (PHP::SAPI)
1 parent bc9b2bd commit d692712

File tree

15 files changed

+89
-51
lines changed

15 files changed

+89
-51
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,27 +319,37 @@ set_target_properties(
319319
)
320320

321321
################################################################################
322-
# Pass transitive compile and link properties to PHP configuration interface.
322+
# Add transitive compile and link properties to PHP configuration interface.
323323
################################################################################
324324

325325
# Cleaner COMPILE_ONLY generator expression is available in CMake >= 3.27.
326326
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.27)
327327
target_link_libraries(php_configuration INTERFACE $<COMPILE_ONLY:Zend::Zend>)
328328
else()
329+
target_compile_definitions(
330+
php_configuration
331+
INTERFACE
332+
$<TARGET_PROPERTY:Zend::Zend,INTERFACE_COMPILE_DEFINITIONS>
333+
)
334+
target_compile_options(
335+
php_configuration
336+
INTERFACE
337+
$<TARGET_PROPERTY:Zend::Zend,INTERFACE_COMPILE_OPTIONS>
338+
)
329339
target_include_directories(
330340
php_configuration
331341
INTERFACE
332342
$<TARGET_PROPERTY:Zend::Zend,INTERFACE_INCLUDE_DIRECTORIES>
333343
)
334-
target_compile_definitions(
344+
target_link_libraries(
335345
php_configuration
336346
INTERFACE
337-
$<TARGET_PROPERTY:Zend::Zend,INTERFACE_COMPILE_DEFINITIONS>
347+
$<TARGET_PROPERTY:Zend::Zend,INTERFACE_LINK_LIBRARIES>
338348
)
339349
endif()
340350

341-
target_link_libraries(php_sapis_config INTERFACE Zend::Zend)
342-
target_sources(php_sapis_config INTERFACE $<TARGET_OBJECTS:Zend::Zend>)
351+
target_link_libraries(php_sapi INTERFACE Zend::Zend)
352+
target_sources(php_sapi INTERFACE $<TARGET_OBJECTS:Zend::Zend>)
343353

344354
################################################################################
345355
# TSRM (Thread Safe Resource Manager) is a separate directory in php-src as it

cmake/cmake/Bootstrap.cmake

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ include(PHP/InterproceduralOptimization)
3333
# Set CMAKE_POSITION_INDEPENDENT_CODE.
3434
include(PHP/PositionIndependentCode)
3535

36-
# INTERFACE library with usage requirements. All targets that need PHP compile
37-
# or link properties, such as include directories, global compile definitions,
38-
# or flags, should link to this target.
36+
# INTERFACE library with usage requirements.
3937
add_library(php_configuration INTERFACE)
4038
add_library(PHP::configuration ALIAS php_configuration)
4139
target_include_directories(
@@ -45,12 +43,10 @@ target_include_directories(
4543
${PHP_SOURCE_DIR}
4644
)
4745

48-
# INTERFACE library that ties all target objects and configuration together.
49-
# Only PHP SAPI targets should link to it.
50-
# See: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html
51-
add_library(php_sapis_config INTERFACE)
52-
add_library(PHP::PHP ALIAS php_sapis_config)
53-
target_link_libraries(php_sapis_config INTERFACE PHP::configuration)
46+
# INTERFACE library that ties objects and configuration together for PHP SAPIs.
47+
add_library(php_sapi INTERFACE)
48+
add_library(PHP::SAPI ALIAS php_sapi)
49+
target_link_libraries(php_sapi INTERFACE PHP::configuration)
5450

5551
# Create a custom target for generating files (parsers, lexers, etc.) manually:
5652
# cmake --build <dir> -t php_generate_files

cmake/cmake/modules/FindGcov.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,27 +188,29 @@ macro(gcov_generate_report)
188188
)
189189

190190
# Create a list of PHP SAPIs with genex for usage in the add_custom_command.
191-
block(PROPAGATE php_sapis)
192-
set(php_sapis "")
191+
block(PROPAGATE sapis)
192+
set(sapis "")
193193
file(GLOB directories ${PROJECT_SOURCE_DIR}/sapi/*)
194194
foreach(dir ${directories})
195195
cmake_path(GET dir FILENAME sapi)
196-
list(APPEND php_sapis "$<TARGET_NAME_IF_EXISTS:php_${sapi}>")
196+
list(APPEND sapis "$<TARGET_NAME_IF_EXISTS:php_${sapi}>")
197197
endforeach()
198198
endblock()
199199

200200
add_custom_command(
201201
OUTPUT ${PROJECT_BINARY_DIR}/php_lcov.info
202202
COMMAND ${CMAKE_COMMAND} -P "CMakeFiles/GenerateGcovReport.cmake"
203-
DEPENDS
204-
${php_sapis}
203+
DEPENDS ${sapis}
205204
COMMENT "[GCOV] Generating GCOV coverage report"
205+
VERBATIM
206+
COMMAND_EXPAND_LISTS
206207
)
207208

208-
unset(php_sapis)
209+
unset(sapis)
209210

210211
# Create target which consumes the command via DEPENDS.
211-
add_custom_target(gcov ALL
212+
add_custom_target(
213+
gcov ALL
212214
DEPENDS ${PROJECT_BINARY_DIR}/php_lcov.info
213215
COMMENT "[GCOV] Generating GCOV files"
214216
)

cmake/ext/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ foreach(extension IN LISTS extensions)
7272

7373
add_dependencies(php_${extension} Zend::Zend)
7474

75-
# Pass transitive compile and link properties to PHP configuration interface.
75+
# Add transitive compile and link properties to PHP configuration interface.
7676
# TODO: Should PHP_CLI extensions pass properties only to PHP_CLI SAPIs?
7777
get_target_property(type php_${extension} TYPE)
7878
if(NOT type MATCHES "^(MODULE|SHARED)_LIBRARY$")
@@ -102,13 +102,13 @@ foreach(extension IN LISTS extensions)
102102
)
103103

104104
target_link_libraries(
105-
php_sapis_config
105+
php_sapi
106106
INTERFACE
107107
$<IF:$<BOOL:$<TARGET_GENEX_EVAL:PHP::${extension},$<TARGET_PROPERTY:PHP::${extension},PHP_CLI>>>,$<$<BOOL:$<TARGET_PROPERTY:PHP_CLI>>:PHP::${extension}>,PHP::${extension}>
108108
)
109109

110110
target_sources(
111-
php_sapis_config
111+
php_sapi
112112
INTERFACE
113113
$<IF:$<BOOL:$<TARGET_GENEX_EVAL:PHP::${extension},$<TARGET_PROPERTY:PHP::${extension},PHP_CLI>>>,$<$<BOOL:$<TARGET_PROPERTY:PHP_CLI>>:$<TARGET_OBJECTS:PHP::${extension}>>,$<TARGET_OBJECTS:PHP::${extension}>>
114114
)

cmake/ext/skeleton/cmake/modules/FindPHP.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Components:
1313
Module defines the following `IMPORTED` target(s):
1414
1515
* `PHP::php` - The PHP package `IMPORTED` target, if found.
16-
* `PHP:embed` - The PHP embed SAPI, if found.
16+
* `PHP::embed` - The PHP embed SAPI, if found.
1717
1818
## Result variables
1919

cmake/main/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ target_link_libraries(php_main PRIVATE PHP::configuration)
119119
add_compile_definitions(ZEND_ENABLE_STATIC_TSRMLS_CACHE)
120120

121121
################################################################################
122-
# Add transitive compile and link properties to PHP interface targets.
122+
# Add transitive compile and link properties to PHP configuration interface.
123123
################################################################################
124124

125125
target_compile_definitions(
@@ -147,8 +147,8 @@ target_include_directories(
147147
$<TARGET_PROPERTY:PHP::main,INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>
148148
)
149149

150-
target_link_libraries(php_sapis_config INTERFACE PHP::main)
151-
target_sources(php_sapis_config INTERFACE $<TARGET_OBJECTS:PHP::main>)
150+
target_link_libraries(php_sapi INTERFACE PHP::main)
151+
target_sources(php_sapi INTERFACE $<TARGET_OBJECTS:PHP::main>)
152152

153153
################################################################################
154154
# Add DTrace.
@@ -259,7 +259,7 @@ add_library(php_main_internal_functions OBJECT internal_functions.c)
259259
add_library(php_main_internal_functions_cli OBJECT internal_functions_cli.c)
260260

261261
target_sources(
262-
php_sapis_config
262+
php_sapi
263263
INTERFACE
264264
$<IF:$<BOOL:$<TARGET_PROPERTY:PHP_CLI>>,$<TARGET_OBJECTS:php_main_internal_functions_cli>,$<TARGET_OBJECTS:php_main_internal_functions>>
265265
)

cmake/sapi/apache2handler/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ endif()
109109
target_link_libraries(
110110
php_apache2handler
111111
PRIVATE
112-
PHP::PHP
112+
PHP::SAPI
113113
Apache::Apache
114114
)
115115

cmake/sapi/cgi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ target_compile_definitions(php_cgi PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE)
4141
target_link_libraries(
4242
php_cgi
4343
PRIVATE
44-
PHP::PHP
44+
PHP::SAPI
4545
$<$<PLATFORM_ID:Windows>:ws2_32;kernel32;advapi32>
4646
)
4747

cmake/sapi/cli/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ target_compile_definitions(
102102
target_link_libraries(
103103
php_cli
104104
PRIVATE
105-
PHP::PHP
105+
PHP::SAPI
106106
$<$<PLATFORM_ID:Windows>:ws2_32;shell32>
107107
)
108108

@@ -158,7 +158,7 @@ if(SAPI_CLI_WIN_NO_CONSOLE)
158158
target_link_libraries(
159159
php_cli_win_no_console
160160
PRIVATE
161-
PHP::PHP
161+
PHP::SAPI
162162
shell32
163163
)
164164

cmake/sapi/embed/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ target_sources(
4747
target_link_libraries(
4848
php_embed
4949
PRIVATE
50-
PHP::PHP
50+
PHP::SAPI
5151
)
5252

5353
target_compile_definitions(php_embed PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE)

0 commit comments

Comments
 (0)