@@ -45,7 +45,7 @@ https://bugs.php.net/53141
4545 capabilities.
4646
4747 ```cmake
48- set_target_properties(php_ <extension_name> PROPERTIES PHP_ZEND_EXTENSION TRUE)
48+ set_target_properties(php_ext_ <extension_name> PROPERTIES PHP_ZEND_EXTENSION TRUE)
4949 ```
5050
5151* `PHP_EXTENSION_<extension>_DEPS`
@@ -195,9 +195,9 @@ function(_php_extensions_parse_dependencies extension result)
195195 # Command invocation:
196196 "add_dependencies[ \t ]*\\ ("
197197 # Target name:
198- "[ \t\r\n ]*php_ ${extension} [ \t\r\n ]+"
198+ "[ \t\r\n ]*php_ext_ ${extension} [ \t\r\n ]+"
199199 # Dependencies:
200- "[\" ]?(php_ [a-zA-Z0-9_; \t\r\n ]+)"
200+ "[\" ]?(php_ext_ [a-zA-Z0-9_; \t\r\n ]+)"
201201 )
202202
203203 string (REGEX MATCHALL "${regex} " matches "${content} " )
@@ -209,7 +209,7 @@ function(_php_extensions_parse_dependencies extension result)
209209 if (CMAKE_MATCH_1)
210210 string (STRIP "${CMAKE_MATCH_1} " dependencies)
211211 string (REPLACE " " ";" dependencies "${dependencies} " )
212- list (TRANSFORM dependencies REPLACE "^php_ " "" )
212+ list (TRANSFORM dependencies REPLACE "^php_ext_ " "" )
213213 list (APPEND allDependencies ${dependencies} )
214214 endif ()
215215 endif ()
@@ -364,17 +364,17 @@ endfunction()
364364
365365# Postconfigure extension right after it has been configured.
366366function (php_extensions_postconfigure extension)
367- if (NOT TARGET php_ ${extension} )
367+ if (NOT TARGET php_ext_ ${extension} )
368368 return ()
369369 endif ()
370370
371371 # If extension is enabled, enable also all its dependencies.
372372 get_target_property (
373373 dependencies
374- php_ ${extension}
374+ php_ext_ ${extension}
375375 MANUALLY_ADDED_DEPENDENCIES
376376 )
377- list (TRANSFORM dependencies REPLACE "^php_ " "" )
377+ list (TRANSFORM dependencies REPLACE "^php_ext_ " "" )
378378 get_property (alwaysEnabledExtensions GLOBAL PROPERTY PHP_ALWAYS_ENABLED_EXTENSIONS)
379379 get_property (allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS)
380380
@@ -409,18 +409,18 @@ function(php_extensions_postconfigure extension)
409409 endif ()
410410 endforeach ()
411411
412- if (NOT TARGET PHP::${extension} )
413- add_library (PHP::${extension} ALIAS php_ ${extension} )
412+ if (NOT TARGET PHP::ext :: ${extension} )
413+ add_library (PHP::ext :: ${extension} ALIAS php_ext_ ${extension} )
414414 endif ()
415415
416416 # Set target output filename to "<extension>".
417- get_target_property (output php_ ${extension} OUTPUT_NAME )
417+ get_target_property (output php_ext_ ${extension} OUTPUT_NAME )
418418 if (NOT output )
419- set_property (TARGET php_ ${extension} PROPERTY OUTPUT_NAME ${extension} )
419+ set_property (TARGET php_ext_ ${extension} PROPERTY OUTPUT_NAME ${extension} )
420420 endif ()
421421
422422 # Specify extension's default installation rules.
423- get_target_property (sets php_ ${extension} INTERFACE_HEADER_SETS)
423+ get_target_property (sets php_ext_ ${extension} INTERFACE_HEADER_SETS)
424424 set (fileSets "" )
425425 foreach (set IN LISTS sets)
426426 list (
@@ -433,7 +433,7 @@ function(php_extensions_postconfigure extension)
433433 )
434434 endforeach ()
435435 install (
436- TARGETS php_ ${extension}
436+ TARGETS php_ext_ ${extension}
437437 ARCHIVE EXCLUDE_FROM_ALL
438438 RUNTIME
439439 DESTINATION ${PHP_EXTENSION_DIR}
@@ -443,24 +443,24 @@ function(php_extensions_postconfigure extension)
443443 )
444444
445445 # Configure shared extension.
446- get_target_property (type php_ ${extension} TYPE )
446+ get_target_property (type php_ext_ ${extension} TYPE )
447447 if (NOT type MATCHES "^(MODULE|SHARED)_LIBRARY$" )
448448 return ()
449449 endif ()
450450
451- target_compile_definitions (php_ ${extension} PRIVATE ZEND_COMPILE_DL_EXT)
451+ target_compile_definitions (php_ext_ ${extension} PRIVATE ZEND_COMPILE_DL_EXT)
452452
453453 set_target_properties (
454- php_ ${extension}
454+ php_ext_ ${extension}
455455 PROPERTIES
456456 POSITION_INDEPENDENT_CODE ON
457457 )
458458
459459 # Set build-phase location for shared extensions.
460- get_target_property (location php_ ${extension} LIBRARY_OUTPUT_DIRECTORY )
460+ get_target_property (location php_ext_ ${extension} LIBRARY_OUTPUT_DIRECTORY )
461461 if (NOT location )
462462 set_property (
463- TARGET php_ ${extension}
463+ TARGET php_ext_ ${extension}
464464 PROPERTY LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR} /modules"
465465 )
466466 endif ()
@@ -471,13 +471,13 @@ endfunction()
471471function (php_extensions_configure_headers)
472472 get_property (extensions GLOBAL PROPERTY PHP_EXTENSIONS)
473473 foreach (extension IN LISTS extensions)
474- if (NOT TARGET php_ ${extension} )
474+ if (NOT TARGET php_ext_ ${extension} )
475475 continue ()
476476 endif ()
477477
478478 string (TOUPPER "COMPILE_DL_${extension} " macro)
479479
480- get_target_property (type php_ ${extension} TYPE )
480+ get_target_property (type php_ext_ ${extension} TYPE )
481481 if (type MATCHES "^(MODULE|SHARED)_LIBRARY$" )
482482 set (${macro} TRUE )
483483 endif ()
@@ -492,7 +492,7 @@ function(php_extensions_configure_headers)
492492 "#cmakedefine ${macro} 1\n "
493493 )
494494
495- get_target_property (binaryDir php_ ${extension} BINARY_DIR)
495+ get_target_property (binaryDir php_ext_ ${extension} BINARY_DIR)
496496 set (current "" )
497497 if (EXISTS ${binaryDir} /config.h)
498498 file (READ ${binaryDir} /config.h current)
@@ -511,21 +511,21 @@ function(_php_extensions_validate)
511511 list (TRANSFORM extensions REPLACE "${CMAKE_CURRENT_SOURCE_DIR} /" "" )
512512
513513 foreach (extension IN LISTS extensions)
514- if (NOT TARGET php_ ${extension} )
514+ if (NOT TARGET php_ext_ ${extension} )
515515 continue ()
516516 endif ()
517517
518518 get_target_property (
519519 dependencies
520- php_ ${extension}
520+ php_ext_ ${extension}
521521 MANUALLY_ADDED_DEPENDENCIES
522522 )
523523
524524 if (NOT dependencies)
525525 continue ()
526526 endif ()
527527
528- list (TRANSFORM dependencies REPLACE "^php_ " "" )
528+ list (TRANSFORM dependencies REPLACE "^php_ext_ " "" )
529529
530530 get_property (allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS)
531531
@@ -535,7 +535,7 @@ function(_php_extensions_validate)
535535 continue ()
536536 endif ()
537537
538- if (NOT TARGET php_ ${dependency} OR NOT dependency IN_LIST extensions)
538+ if (NOT TARGET php_ext_ ${dependency} OR NOT dependency IN_LIST extensions)
539539 string (TOUPPER "${dependency} " dependencyUpper)
540540 message (
541541 SEND_ERROR
@@ -546,8 +546,8 @@ function(_php_extensions_validate)
546546 )
547547 endif ()
548548
549- get_target_property (dependencyType php_ ${dependency} TYPE )
550- get_target_property (extensionType php_ ${extension} TYPE )
549+ get_target_property (dependencyType php_ext_ ${dependency} TYPE )
550+ get_target_property (extensionType php_ext_ ${extension} TYPE )
551551
552552 if (
553553 dependencyType MATCHES "^(MODULE|SHARED)_LIBRARY$"
0 commit comments