Skip to content

Commit 4cf1785

Browse files
committed
Update minimum required CMake version to 3.29...4.0
* 3.29 (minimum required CMake version) * 4.0 (CMake policy version)
1 parent 91a9ab4 commit 4cf1785

File tree

88 files changed

+118
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+118
-158
lines changed

.github/workflows/check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ jobs:
5050
run: |
5151
normalizer.cmake -- \
5252
--set normalize_indent_style=false \
53-
--set normalize_cmake_minimum_required=3.27...4.0 \
53+
--set normalize_cmake_minimum_required=3.29...4.0 \
5454
-j

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ See build system documentation for available PHP configuration variables and
5555
further information.
5656
#]=============================================================================]
5757

58-
cmake_minimum_required(VERSION 3.27...4.0)
58+
cmake_minimum_required(VERSION 3.29...4.0)
5959

6060
if(CMAKE_BINARY_DIR PATH_EQUAL CMAKE_CURRENT_LIST_DIR)
6161
message(

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# PHP build system
22

33
[![PHP version](https://img.shields.io/badge/PHP-8.3-777BB4?logo=php&labelColor=17181B)](https://www.php.net/)
4-
[![CMake version](https://img.shields.io/badge/CMake-3.27-064F8C?logo=cmake&labelColor=17181B)](https://cmake.org)
5-
[![C99](https://img.shields.io/badge/standard-C99-A8B9CC?logo=C&labelColor=17181B)](https://port70.net/~nsz/c/c99/n1256.html)
6-
[![GNU](https://img.shields.io/badge/-GNU-A42E2B?logo=gnu&labelColor=17181B)](https://www.gnu.org/)
7-
[![Ninja](https://img.shields.io/badge/%F0%9F%A5%B7-Ninja%20build-DD6620?labelColor=17181B)](https://ninja-build.org/)
4+
[![CMake version](https://img.shields.io/badge/CMake-3.29-064F8C?logo=cmake&labelColor=17181B)](https://cmake.org)
5+
[![C99](https://img.shields.io/badge/standard-C99-A8B9CC?logo=C&labelColor=17181B)](https://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf)
86

97
> [!IMPORTANT]
108
> You are browsing the `PHP-8.3` branch of this repository. For the latest

cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.27...4.0)
1+
cmake_minimum_required(VERSION 3.29...4.0)
22

33
# Configure CMake behavior.
44
include(cmake/CMakeDefaults.cmake)

cmake/Zend/cmake/Version.cmake

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ include_guard(GLOBAL)
1313

1414
# Set Zend Engine version variables.
1515
block(PROPAGATE Zend_VERSION Zend_VERSION_LABEL)
16-
set(regex "^[ \t]*#[ \t]*define[ \t]+ZEND_VERSION[ \t]+\"([0-9.]+)([^\"]*)")
17-
file(STRINGS zend.h _ REGEX "${regex}")
18-
19-
if(CMAKE_VERSION VERSION_LESS 3.29)
20-
string(REGEX MATCH "${regex}" _ "${_}")
21-
endif()
22-
16+
file(
17+
STRINGS
18+
zend.h
19+
_
20+
REGEX "^[ \t]*#[ \t]*define[ \t]+ZEND_VERSION[ \t]+\"([0-9.]+)([^\"]*)"
21+
)
2322
set(Zend_VERSION "${CMAKE_MATCH_1}")
2423
set(Zend_VERSION_LABEL "${CMAKE_MATCH_2}")
2524
endblock()
@@ -35,19 +34,21 @@ function(_zend_version_post_project)
3534
message(STATUS "Zend Engine version: ${Zend_VERSION}")
3635

3736
# Get extensions API number.
38-
set(regex "^[ \t]*#[ \t]*define[ \t]+ZEND_EXTENSION_API_NO[ \t]+([0-9]+)")
39-
file(STRINGS zend_extensions.h _ REGEX "${regex}")
40-
if(CMAKE_VERSION VERSION_LESS 3.29)
41-
string(REGEX MATCH "${regex}" _ "${_}")
42-
endif()
37+
file(
38+
STRINGS
39+
zend_extensions.h
40+
_
41+
REGEX "^[ \t]*#[ \t]*define[ \t]+ZEND_EXTENSION_API_NO[ \t]+([0-9]+)"
42+
)
4343
set(Zend_VERSION_EXTENSION_API_NO "${CMAKE_MATCH_1}")
4444

4545
# Get modules API number.
46-
set(regex "^[ \t]*#[ \t]*define[ \t]+ZEND_MODULE_API_NO[ \t]+([0-9]+)")
47-
file(STRINGS zend_modules.h _ REGEX "${regex}")
48-
if(CMAKE_VERSION VERSION_LESS 3.29)
49-
string(REGEX MATCH "${regex}" _ "${_}")
50-
endif()
46+
file(
47+
STRINGS
48+
zend_modules.h
49+
_
50+
REGEX "^[ \t]*#[ \t]*define[ \t]+ZEND_MODULE_API_NO[ \t]+([0-9]+)"
51+
)
5152
set(Zend_VERSION_MODULE_API_NO "${CMAKE_MATCH_1}")
5253

5354
return(

cmake/cmake/Version.cmake

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@ include_guard(GLOBAL)
1515

1616
# Set the PHP_VERSION_* variables from configure.ac.
1717
block(PROPAGATE PHP_VERSION)
18-
set(regex "^AC_INIT.+PHP\\],\\[([0-9.]+)([^]]*)")
19-
file(STRINGS configure.ac _ REGEX "${regex}")
20-
21-
if(CMAKE_VERSION VERSION_LESS 3.29)
22-
string(REGEX MATCH "${regex}" _ "${_}")
23-
endif()
24-
18+
file(STRINGS configure.ac _ REGEX "^AC_INIT.+PHP\\],\\[([0-9.]+)([^]]*)")
2519
set(PHP_VERSION "${CMAKE_MATCH_1}")
26-
2720
set(
2821
PHP_VERSION_LABEL "${CMAKE_MATCH_2}"
2922
CACHE STRING "Extra PHP version label suffix, e.g. '-dev', 'rc1', '-acme'"
@@ -51,13 +44,12 @@ function(_php_version_post_project)
5144
)
5245

5346
# Get PHP API version.
54-
set(regex "^[ \t]*#[ \t]*define[ \t]+PHP_API_VERSION[ \t]+([0-9]+)")
55-
file(STRINGS main/php.h _ REGEX "${regex}")
56-
57-
if(CMAKE_VERSION VERSION_LESS 3.29)
58-
string(REGEX MATCH "${regex}" _ "${_}")
59-
endif()
60-
47+
file(
48+
STRINGS
49+
main/php.h
50+
_
51+
REGEX "^[ \t]*#[ \t]*define[ \t]+PHP_API_VERSION[ \t]+([0-9]+)"
52+
)
6153
set(PHP_API_VERSION "${CMAKE_MATCH_1}")
6254

6355
return(PROPAGATE PHP_VERSION PHP_VERSION_ID PHP_API_VERSION)

cmake/cmake/modules/FindApache.cmake

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,7 @@ block()
163163
OUTPUT_STRIP_TRAILING_WHITESPACE
164164
ERROR_QUIET
165165
)
166-
if(CMAKE_VERSION VERSION_LESS 3.29)
167-
if(EXISTS ${path})
168-
set_property(CACHE Apache_APR_CONFIG_EXECUTABLE PROPERTY VALUE ${path})
169-
endif()
170-
elseif(IS_EXECUTABLE ${path})
166+
if(IS_EXECUTABLE "${path}")
171167
set_property(CACHE Apache_APR_CONFIG_EXECUTABLE PROPERTY VALUE ${path})
172168
endif()
173169
endif()
@@ -248,11 +244,7 @@ block()
248244
OUTPUT_STRIP_TRAILING_WHITESPACE
249245
ERROR_QUIET
250246
)
251-
if(CMAKE_VERSION VERSION_LESS 3.29)
252-
if(EXISTS ${path})
253-
set_property(CACHE Apache_APU_CONFIG_EXECUTABLE PROPERTY VALUE ${path})
254-
endif()
255-
elseif(IS_EXECUTABLE ${path})
247+
if(IS_EXECUTABLE "${path}")
256248
set_property(CACHE Apache_APU_CONFIG_EXECUTABLE PROPERTY VALUE ${path})
257249
endif()
258250
endif()

cmake/cmake/modules/FindRE2C.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ endif()
5757
################################################################################
5858

5959
block(PROPAGATE RE2C_VERSION _reason _re2cRequiredVars)
60-
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
61-
set(test IS_EXECUTABLE)
62-
else()
63-
set(test EXISTS)
64-
endif()
65-
66-
if(${test} ${RE2C_EXECUTABLE})
60+
if(IS_EXECUTABLE "${RE2C_EXECUTABLE}")
6761
list(APPEND _re2cRequiredVars RE2C_VERSION)
6862
execute_process(
6963
COMMAND ${RE2C_EXECUTABLE} --version

cmake/cmake/modules/PHP/AddCustomCommand/RunCommand.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Expected variables:
1111
* COMMENT
1212
#]=============================================================================]
1313

14-
cmake_minimum_required(VERSION 3.27...4.0)
14+
cmake_minimum_required(VERSION 3.29...4.0)
1515

1616
if(NOT CMAKE_SCRIPT_MODE_FILE OR NOT PHP_EXECUTABLE OR NOT PHP_COMMAND)
1717
return()

cmake/cmake/modules/PHP/Stubs/StubsGenerator.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Expected variables:
66
* PHP_COMMAND
77
#]=============================================================================]
88

9-
cmake_minimum_required(VERSION 3.27...4.0)
9+
cmake_minimum_required(VERSION 3.29...4.0)
1010

1111
if(NOT CMAKE_SCRIPT_MODE_FILE)
1212
message(FATAL_ERROR "This is a command-line script.")

0 commit comments

Comments
 (0)