Skip to content

Commit 50a374e

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
2 parents a1e9a03 + bc902d0 commit 50a374e

37 files changed

+534
-521
lines changed

CMakeLists.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ project(
7676
)
7777

7878
# Configuration.
79-
block(PROPAGATE phpUrl)
79+
block(PROPAGATE php_url)
8080
set(
8181
CACHE{PHP_VERSION_DOWNLOAD}
8282
TYPE STRING
@@ -86,7 +86,7 @@ block(PROPAGATE phpUrl)
8686
mark_as_advanced(PHP_VERSION_DOWNLOAD)
8787

8888
# PHP <major>.<minor> version currently in development (the master branch).
89-
set(phpDevelopmentBranch 8.6)
89+
set(php_development_branch 8.6)
9090

9191
# Validate PHP version.
9292
if(NOT PHP_VERSION_DOWNLOAD MATCHES [[^[0-9]+\.[0-9]+(\.[0-9]+|-dev|$)]])
@@ -109,12 +109,12 @@ block(PROPAGATE phpUrl)
109109
set(branch "")
110110
set(version "")
111111

112-
if(PHP_VERSION_DOWNLOAD MATCHES "^${phpDevelopmentBranch}(-dev)?(.*)$")
112+
if(PHP_VERSION_DOWNLOAD MATCHES "^${php_development_branch}(-dev)?(.*)$")
113113
if(CMAKE_MATCH_2)
114114
message(
115115
WARNING
116-
"PHP ${phpDevelopmentBranch} is marked as development branch. Version "
117-
"has been set to ${phpDevelopmentBranch}-dev"
116+
"PHP ${php_development_branch} is marked as development branch. "
117+
"Version has been set to ${php_development_branch}-dev"
118118
)
119119
endif()
120120
set(branch "master")
@@ -154,9 +154,12 @@ block(PROPAGATE phpUrl)
154154
endif()
155155

156156
if(branch)
157-
set(phpUrl https://github.com/php/php-src/archive/refs/heads/${branch}.tar.gz)
157+
set(
158+
php_url
159+
https://github.com/php/php-src/archive/refs/heads/${branch}.tar.gz
160+
)
158161
elseif(version)
159-
set(phpUrl https://www.php.net/distributions/php-${version}.tar.gz)
162+
set(php_url https://www.php.net/distributions/php-${version}.tar.gz)
160163
else()
161164
message(FATAL_ERROR "Something went wrong.")
162165
endif()
@@ -166,7 +169,7 @@ include(FetchContent)
166169

167170
FetchContent_Declare(
168171
php
169-
URL ${phpUrl}
172+
URL ${php_url}
170173
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/php-src
171174
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/php
172175
PATCH_COMMAND
@@ -271,9 +274,9 @@ cmake_path(
271274
RELATIVE_PATH
272275
CMAKE_CURRENT_BINARY_DIR
273276
BASE_DIRECTORY ${CMAKE_SOURCE_DIR}
274-
OUTPUT_VARIABLE relativeDir
277+
OUTPUT_VARIABLE relative_dir
275278
)
276-
message(STATUS "Downloading ${phpUrl} to ${relativeDir}")
279+
message(STATUS "Downloading ${php_url} to ${relative_dir}")
277280
FetchContent_MakeAvailable(php)
278281

279282
enable_testing()

cmake/Zend/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,9 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
562562
RELATIVE_PATH
563563
CMAKE_CURRENT_BINARY_DIR
564564
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
565-
OUTPUT_VARIABLE relativeDir
565+
OUTPUT_VARIABLE relative_dir
566566
)
567-
message(STATUS "Creating ${relativeDir}/zend_config.h")
567+
message(STATUS "Creating ${relative_dir}/zend_config.h")
568568
file(
569569
CONFIGURE
570570
OUTPUT zend_config.h

cmake/Zend/cmake/Fibers.cmake

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ endfunction()
7171

7272
block()
7373
set(cpu "")
74-
set(asmFile "")
74+
set(asm_file "")
7575
set(prefix "")
76-
set(compileOptions "")
77-
set(compileDefinitions "")
76+
set(compile_options "")
77+
set(compile_definitions "")
7878

7979
# Determine files based on the architecture and platform.
8080
if(CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "x86_64")
@@ -105,76 +105,76 @@ block()
105105
endif()
106106

107107
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
108-
set(asmFile "combined_sysv_macho_gas.S")
108+
set(asm_file "combined_sysv_macho_gas.S")
109109
elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX")
110110
# AIX uses a different calling convention (shared with non-_CALL_ELF Linux).
111111
# The AIX assembler isn't GNU, but the file is compatible.
112-
set(asmFile "${prefix}_xcoff_gas.S")
112+
set(asm_file "${prefix}_xcoff_gas.S")
113113
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
114114
if(NOT cpu STREQUAL "i386")
115-
set(asmFile "${prefix}_elf_gas.S")
115+
set(asm_file "${prefix}_elf_gas.S")
116116
endif()
117117
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
118118
if(CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(x86_64|x64)")
119-
set(asmFile "x86_64_ms_pe_masm.asm")
119+
set(asm_file "x86_64_ms_pe_masm.asm")
120120
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(X86|i[3456]86)")
121-
set(asmFile "i386_ms_pe_masm.asm")
121+
set(asm_file "i386_ms_pe_masm.asm")
122122
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(ARM64|aarch64)")
123-
set(asmFile "arm64_aapcs_pe_armasm.asm")
124-
set(compileOptions /nologo -machine ARM64)
123+
set(asm_file "arm64_aapcs_pe_armasm.asm")
124+
set(compile_options /nologo -machine ARM64)
125125
endif()
126126

127-
if(asmFile AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(ARM64|aarch64)")
128-
set(compileOptions /nologo)
127+
if(asm_file AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(ARM64|aarch64)")
128+
set(compile_options /nologo)
129129

130-
set(compileDefinitions "BOOST_CONTEXT_EXPORT=EXPORT")
130+
set(compile_definitions "BOOST_CONTEXT_EXPORT=EXPORT")
131131
endif()
132132
elseif(CMAKE_SYSTEM_NAME STREQUAL "Midipix")
133133
if(CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "x86_64")
134-
set(asmFile "x86_64_ms_pe_gas.S")
134+
set(asm_file "x86_64_ms_pe_gas.S")
135135
endif()
136136
elseif(prefix)
137-
set(asmFile "${prefix}_elf_gas.S")
137+
set(asm_file "${prefix}_elf_gas.S")
138138
endif()
139139

140-
if(asmFile)
140+
if(asm_file)
141141
set(
142-
asmSources
143-
${CMAKE_CURRENT_SOURCE_DIR}/asm/jump_${asmFile}
144-
${CMAKE_CURRENT_SOURCE_DIR}/asm/make_${asmFile}
142+
asm_sources
143+
${CMAKE_CURRENT_SOURCE_DIR}/asm/jump_${asm_file}
144+
${CMAKE_CURRENT_SOURCE_DIR}/asm/make_${asm_file}
145145
)
146146

147147
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
148148
list(
149149
APPEND
150-
asmSources
150+
asm_sources
151151
${CMAKE_CURRENT_SOURCE_DIR}/asm/save_xmm_x86_64_ms_masm.asm
152152
)
153153
endif()
154154

155-
if(compileOptions)
155+
if(compile_options)
156156
set_source_files_properties(
157-
${asmSources}
157+
${asm_sources}
158158
PROPERTIES
159-
COMPILE_OPTIONS ${compileOptions}
159+
COMPILE_OPTIONS ${compile_options}
160160
)
161161
endif()
162162

163-
if(compileDefinitions)
163+
if(compile_definitions)
164164
set_source_files_properties(
165-
${asmSources}
165+
${asm_sources}
166166
PROPERTIES
167-
COMPILE_DEFINITIONS ${compileDefinitions}
167+
COMPILE_DEFINITIONS ${compile_definitions}
168168
)
169169
endif()
170170
endif()
171171

172172
message(CHECK_START "Checking for fibers switching context support")
173173

174-
if(PHP_ZEND_FIBER_ASM AND asmFile)
175-
message(CHECK_PASS "yes, Zend/asm/*.${asmFile}")
174+
if(PHP_ZEND_FIBER_ASM AND asm_file)
175+
message(CHECK_PASS "yes, Zend/asm/*.${asm_file}")
176176

177-
target_sources(zend_fibers INTERFACE ${asmSources})
177+
target_sources(zend_fibers INTERFACE ${asm_sources})
178178

179179
_php_zend_fibers_shadow_stack_syscall()
180180
else()

cmake/Zend/cmake/GenerateGrammar.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ block()
4949
REPLACE
5050
"int zendparse"
5151
"ZEND_API int zendparse"
52-
patchedContent
52+
patched_content
5353
"${content}"
5454
)
5555
if(
5656
NOT content MATCHES "ZEND_API int zendparse"
57-
AND NOT content STREQUAL "${patchedContent}"
57+
AND NOT content STREQUAL "${patched_content}"
5858
)
5959
message(STATUS "[Zend] Patching ${file}")
60-
file(WRITE "@CMAKE_CURRENT_SOURCE_DIR@/${file}" "${patchedContent}")
60+
file(WRITE "@CMAKE_CURRENT_SOURCE_DIR@/${file}" "${patched_content}")
6161
endif()
6262
endforeach()
6363
]]

cmake/cmake/BuildTypes.cmake

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,43 @@ Configure CMake build types.
55
include_guard(GLOBAL)
66

77
block()
8-
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
8+
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
99

1010
# Set default build type for single-config generators.
11-
if(NOT isMultiConfig AND NOT CMAKE_BUILD_TYPE)
11+
if(NOT is_multi_config AND NOT CMAKE_BUILD_TYPE)
1212
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY VALUE "Debug")
1313
endif()
1414

1515
if(PROJECT_IS_TOP_LEVEL)
16-
if(isMultiConfig)
16+
if(is_multi_config)
1717
if(NOT "DebugAssertions" IN_LIST CMAKE_CONFIGURATION_TYPES)
1818
list(APPEND CMAKE_CONFIGURATION_TYPES DebugAssertions)
1919
endif()
2020
else()
2121
set(
22-
allowedBuildTypes
23-
Debug # Not optimized, debug info, assertions.
24-
DebugAssertions # Custom PHP debug build type based on RelWithDebInfo:
25-
# optimized, debug info, assertions.
26-
MinSizeRel # Same as Release but optimized for size rather than
27-
# speed.
28-
Release # Optimized, no debug info, no assertions.
29-
RelWithDebInfo # Optimized, debug info, no assertions.
22+
allowed_build_types
23+
Debug # Not optimized, debug info, assertions.
24+
DebugAssertions # Custom PHP debug build type based on RelWithDebInfo:
25+
# optimized, debug info, assertions.
26+
MinSizeRel # Same as Release but optimized for size rather than
27+
# speed.
28+
Release # Optimized, no debug info, no assertions.
29+
RelWithDebInfo # Optimized, debug info, no assertions.
3030
)
3131

3232
set_property(
3333
CACHE CMAKE_BUILD_TYPE
34-
PROPERTY STRINGS "${allowedBuildTypes}"
34+
PROPERTY STRINGS "${allowed_build_types}"
3535
)
3636

3737
set_property(
3838
CACHE CMAKE_BUILD_TYPE
39-
PROPERTY HELPSTRING
40-
"Choose the type of build, options are: ${allowedBuildTypes}"
39+
PROPERTY
40+
HELPSTRING
41+
"Choose the type of build, options are: ${allowed_build_types}"
4142
)
4243

43-
if(NOT CMAKE_BUILD_TYPE IN_LIST allowedBuildTypes)
44+
if(NOT CMAKE_BUILD_TYPE IN_LIST allowed_build_types)
4445
message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}")
4546
endif()
4647
endif()
@@ -63,6 +64,5 @@ endforeach()
6364

6465
target_compile_definitions(
6566
php_config
66-
INTERFACE
67-
$<IF:$<CONFIG:Debug,DebugAssertions>,ZEND_DEBUG=1,ZEND_DEBUG=0>
67+
INTERFACE $<IF:$<CONFIG:Debug,DebugAssertions>,ZEND_DEBUG=1,ZEND_DEBUG=0>
6868
)

0 commit comments

Comments
 (0)