Skip to content

Commit 0ed3a56

Browse files
committed
Sync variable names
1 parent abd3680 commit 0ed3a56

37 files changed

+528
-517
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
@@ -517,9 +517,9 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
517517
RELATIVE_PATH
518518
CMAKE_CURRENT_BINARY_DIR
519519
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
520-
OUTPUT_VARIABLE relativeDir
520+
OUTPUT_VARIABLE relative_dir
521521
)
522-
message(STATUS "Creating ${relativeDir}/zend_config.h")
522+
message(STATUS "Creating ${relative_dir}/zend_config.h")
523523
file(
524524
CONFIGURE
525525
OUTPUT zend_config.h

cmake/Zend/cmake/Fibers.cmake

Lines changed: 27 additions & 27 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")
@@ -101,64 +101,64 @@ block()
101101
endif()
102102

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

123-
if(asmFile AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(ARM64|aarch64)")
124-
set(compileOptions /nologo)
123+
if(asm_file AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "(ARM64|aarch64)")
124+
set(compile_options /nologo)
125125

126-
set(compileDefinitions "BOOST_CONTEXT_EXPORT=EXPORT")
126+
set(compile_definitions "BOOST_CONTEXT_EXPORT=EXPORT")
127127
endif()
128128
elseif(prefix)
129-
set(asmFile "${prefix}_elf_gas.S")
129+
set(asm_file "${prefix}_elf_gas.S")
130130
endif()
131131

132-
if(asmFile)
132+
if(asm_file)
133133
set(
134-
asmSources
135-
${CMAKE_CURRENT_SOURCE_DIR}/asm/jump_${asmFile}
136-
${CMAKE_CURRENT_SOURCE_DIR}/asm/make_${asmFile}
134+
asm_sources
135+
${CMAKE_CURRENT_SOURCE_DIR}/asm/jump_${asm_file}
136+
${CMAKE_CURRENT_SOURCE_DIR}/asm/make_${asm_file}
137137
)
138138

139-
if(compileOptions)
139+
if(compile_options)
140140
set_source_files_properties(
141-
${asmSources}
141+
${asm_sources}
142142
PROPERTIES
143-
COMPILE_OPTIONS ${compileOptions}
143+
COMPILE_OPTIONS ${compile_options}
144144
)
145145
endif()
146146

147-
if(compileDefinitions)
147+
if(compile_definitions)
148148
set_source_files_properties(
149-
${asmSources}
149+
${asm_sources}
150150
PROPERTIES
151-
COMPILE_DEFINITIONS ${compileDefinitions}
151+
COMPILE_DEFINITIONS ${compile_definitions}
152152
)
153153
endif()
154154
endif()
155155

156156
message(CHECK_START "Checking for fibers switching context support")
157157

158-
if(PHP_ZEND_FIBER_ASM AND asmFile)
159-
message(CHECK_PASS "yes, Zend/asm/*.${asmFile}")
158+
if(PHP_ZEND_FIBER_ASM AND asm_file)
159+
message(CHECK_PASS "yes, Zend/asm/*.${asm_file}")
160160

161-
target_sources(zend_fibers INTERFACE ${asmSources})
161+
target_sources(zend_fibers INTERFACE ${asm_sources})
162162

163163
_php_zend_fibers_shadow_stack_syscall()
164164
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)