Skip to content

Commit 5cf3c02

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 4f5a54e + a1478c2 commit 5cf3c02

File tree

2 files changed

+66
-26
lines changed

2 files changed

+66
-26
lines changed

cmake/cmake/Platform.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ Platform-specific configuration.
44

55
include_guard(GLOBAL)
66

7-
message(STATUS "Host system: ${CMAKE_HOST_SYSTEM}")
8-
message(STATUS "Host CPU: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
9-
message(STATUS "Target system: ${CMAKE_SYSTEM}")
10-
message(STATUS "Target CPU: ${CMAKE_SYSTEM_PROCESSOR}")
11-
127
# Check unused linked libraries on executable and shared/module library targets.
138
include(PHP/LinkWhatYouUse)
149

cmake/cmake/modules/PHP/FeatureSummary.cmake

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,42 +35,63 @@ include(FeatureSummary)
3535

3636
# Add new item to the summary preamble with dotted leader.
3737
function(php_feature_summary_preamble_add_item label value output)
38-
# If preamble is already set, use it to calculate column width, otherwise use
39-
# predefined helper template.
40-
if(${output})
41-
set(template "${${output}}")
42-
else()
43-
set(template " * <label> .................... : <value>")
44-
endif()
38+
# Template helper to calculate column width.
39+
set(template " * <label> .................... : <value>")
40+
string(REGEX MATCH "^ \\\* ([^ ]+ [.]+)" _ "${template}")
41+
string(LENGTH "${CMAKE_MATCH_1}" columnWidth)
4542

46-
string(REGEX MATCH "^ \\\* ([^\r\n]+ [.]+) : " _ "${template}")
47-
string(LENGTH "${CMAKE_MATCH_1}" width)
4843
string(LENGTH "${label}" length)
49-
math(EXPR numberOfDots "${width} - ${length} - 1")
44+
math(EXPR numberOfDots "${columnWidth} - ${length} - 1")
5045

51-
if(numberOfDots GREATER 0)
46+
set(leader "")
47+
if(numberOfDots GREATER_EQUAL 2)
5248
string(REPEAT "." ${numberOfDots} leader)
53-
set(leader " ${leader} ")
54-
else()
55-
set(leader "")
49+
set(leader " ${leader}")
50+
elseif(numberOfDots EQUAL 1)
51+
set(leader " ")
52+
elseif(numberOfDots EQUAL 0)
53+
set(leader " ")
54+
elseif(numberOfDots LESS 0)
55+
string(SUBSTRING "${label}" 0 ${columnWidth} label)
5656
endif()
5757

58-
string(APPEND ${output} " * ${label}${leader}: ${value}\n")
59-
set("${output}" "${${output}}" PARENT_SCOPE)
58+
string(APPEND ${output} " * ${label}${leader} : ${value}\n")
59+
return(PROPAGATE ${output})
6060
endfunction()
6161

6262
# Get summary preamble.
6363
function(php_feature_summary_preamble result)
64-
php_feature_summary_preamble_add_item("${PROJECT_NAME} version" "${PROJECT_VERSION}" preamble)
65-
php_feature_summary_preamble_add_item("PHP API version" "${PHP_API_VERSION}" preamble)
64+
php_feature_summary_preamble_add_item(
65+
"${PROJECT_NAME} version"
66+
"${${PROJECT_NAME}_VERSION}"
67+
preamble
68+
)
69+
70+
php_feature_summary_preamble_add_item(
71+
"PHP API version"
72+
"${PHP_API_VERSION}"
73+
preamble
74+
)
6675

6776
if(TARGET Zend::Zend)
6877
get_target_property(zendVersion Zend::Zend VERSION)
6978
get_target_property(zendExtensionApi Zend::Zend ZEND_EXTENSION_API_NO)
7079
get_target_property(zendModuleApi Zend::Zend ZEND_MODULE_API_NO)
71-
php_feature_summary_preamble_add_item("Zend Engine version" "${zendVersion}" preamble)
72-
php_feature_summary_preamble_add_item("Zend extension API number" "${zendExtensionApi}" preamble)
73-
php_feature_summary_preamble_add_item("Zend module API number" "${zendModuleApi}" preamble)
80+
php_feature_summary_preamble_add_item(
81+
"Zend Engine version"
82+
"${zendVersion}"
83+
preamble
84+
)
85+
php_feature_summary_preamble_add_item(
86+
"Zend extension API number"
87+
"${zendExtensionApi}"
88+
preamble
89+
)
90+
php_feature_summary_preamble_add_item(
91+
"Zend module API number"
92+
"${zendModuleApi}"
93+
preamble
94+
)
7495
endif()
7596

7697
get_property(enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES)
@@ -120,6 +141,30 @@ function(php_feature_summary_preamble result)
120141
endif()
121142
endforeach()
122143

144+
php_feature_summary_preamble_add_item(
145+
"Building on (host system)"
146+
"${CMAKE_HOST_SYSTEM}"
147+
preamble
148+
)
149+
150+
php_feature_summary_preamble_add_item(
151+
"Host CPU"
152+
"${CMAKE_HOST_SYSTEM_PROCESSOR}"
153+
preamble
154+
)
155+
156+
php_feature_summary_preamble_add_item(
157+
"Building for (target system)"
158+
"${CMAKE_SYSTEM}"
159+
preamble
160+
)
161+
162+
php_feature_summary_preamble_add_item(
163+
"Target CPU"
164+
"${CMAKE_SYSTEM_PROCESSOR}"
165+
preamble
166+
)
167+
123168
php_feature_summary_preamble_add_item(
124169
"CMake version"
125170
"${CMAKE_VERSION}"

0 commit comments

Comments
 (0)