Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(NOT GIT_BRANCH MATCHES "^PHP-[0-9]+\.[0-9]+$")
if(NOT GIT_BRANCH MATCHES [[^PHP-[0-9]+\.[0-9]+$]])
set(GIT_BRANCH "master")
endif()

Expand Down
8 changes: 4 additions & 4 deletions bin/php.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if(
)
set(PHP_VERSION "${PHP_VERSION_FALLBACK}")
else()
string(REGEX MATCH [[php-([0-9]+.[0-9]+.[0-9]+).tar.gz]] _ "${filename}")
string(REGEX MATCH [[php-([0-9.]+)\.tar\.gz]] _ "${filename}")
set(PHP_VERSION "${CMAKE_MATCH_1}")
endif()
endblock()
Expand Down Expand Up @@ -207,7 +207,7 @@ function(php_download)
"https://github.com/php/php-src/archive/refs/heads/${branch}.tar.gz"
)
elseif(PHP_VERSION MATCHES "^.*-dev$")
string(REGEX MATCH [[(^[0-9]+)\.([0-9]+).*$]] _ "${PHP_VERSION}")
string(REGEX MATCH [[(^[0-9]+)\.([0-9]+)]] _ "${PHP_VERSION}")
set(branch "PHP-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")

list(
Expand Down Expand Up @@ -296,7 +296,7 @@ function(php_prepare_sources)
message(STATUS "Applying patches to ${PHP_SOURCE_DIR_RELATIVE}")

# Apply patches for php-src.
string(REGEX MATCH [[([0-9]+\.[0-9]+).*$]] _ "${PHP_VERSION}")
string(REGEX MATCH [[^([0-9]+\.[0-9]+)]] _ "${PHP_VERSION}")
file(GLOB_RECURSE patches ${PHP_ROOT_DIR}/patches/${CMAKE_MATCH_1}/*.patch)

foreach(patch ${patches})
Expand All @@ -318,7 +318,7 @@ function(php_prepare_sources)

# Clean temporary .git directory. Checks are done as safeguards.
if(
PHP_SOURCE_DIR MATCHES "\\/php-8\\.[0-9][.-].*$"
PHP_SOURCE_DIR MATCHES [[/php-8\.[0-9][.-].*$]]
AND IS_DIRECTORY ${PHP_SOURCE_DIR}/.git/
AND EXISTS ${PHP_SOURCE_DIR}/php.ini-development
AND EXISTS ${PHP_SOURCE_DIR}/main/php_version.h
Expand Down
2 changes: 1 addition & 1 deletion cmake/Zend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ block(PROPAGATE Zend_VERSION Zend_VERSION_LABEL)
file(READ zend.h content)
string(
REGEX MATCH
"#[ \t]*define[ \t]+ZEND_VERSION[ \t]+\"([0-9.]+)([^\"]*)"
[[#[ \t]*define[ \t]+ZEND_VERSION[ \t]+"([0-9.]+)([^"]*)]]
_
"${content}"
)
Expand Down
6 changes: 3 additions & 3 deletions cmake/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,9 @@ if(PHP_GCOV)
if(CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache")
message(
WARNING
"ccache should be disabled when PHP_GCOV='ON' option is used. You can "
"disable ccache by setting option PHP_CCACHE='OFF' or environment "
"variable CCACHE_DISABLE=1."
"When 'PHP_GCOV' is enabled, ccache should be disabled by setting the "
"'PHP_CCACHE' to 'OFF' or by setting the 'CCACHE_DISABLE' environment "
"variable."
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions cmake/cmake/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ include_guard(GLOBAL)

# Set the PHP_VERSION_* variables from configure.ac.
block(PROPAGATE PHP_VERSION)
set(regex "^AC_INIT\\(\\[PHP\\],\\[([0-9]+\.[0-9]+\.[0-9]+)([^\]]*)")
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/../configure.ac _ REGEX "${regex}")
set(regex "^AC_INIT.+PHP\\],\\[([0-9.]+)([^]]*)")
file(STRINGS configure.ac _ REGEX "${regex}")

cmake_policy(GET CMP0159 policy)
if(CMAKE_VERSION VERSION_LESS 3.29 OR NOT policy STREQUAL NEW)
Expand Down
4 changes: 1 addition & 3 deletions cmake/cmake/modules/FindApache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ block(PROPAGATE Apache_VERSION)
ERROR_QUIET
)

string(REGEX MATCH " Apache/([0-9]\.[0-9.]+\.[0-9]+) " _ "${version}")

if(CMAKE_MATCH_1)
if(version MATCHES [[ Apache/([0-9]+\.[0-9.]+)]])
set(Apache_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
Expand Down
15 changes: 9 additions & 6 deletions cmake/cmake/modules/FindCcache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Find the Ccache compiler cache tool for faster compilation times.

## Hints

* The `CCACHE_DISABLE` environment variable disables the ccache and doesn't add
it to the C and CXX launcher, see Ccache documentation for more info.
* The `CCACHE_DISABLE` regular or environment variable which disables ccache and
doesn't adjust the C and CXX launcher. For more info see Ccache documentation.
#]=============================================================================]

include(FeatureSummary)
Expand Down Expand Up @@ -45,9 +45,7 @@ block(PROPAGATE Ccache_VERSION)
OUTPUT_STRIP_TRAILING_WHITESPACE
)

string(REGEX MATCH "^ccache version ([^\r\n]+)" _ "${version}")

if(CMAKE_MATCH_1)
if(version MATCHES "^ccache version ([^\r\n]+)")
set(Ccache_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
Expand All @@ -64,11 +62,16 @@ find_package_handle_standard_args(

unset(_reason)

if(NOT Ccache_FOUND OR CCACHE_DISABLE OR "$ENV{CCACHE_DISABLE}")
if(NOT Ccache_FOUND)
message(STATUS "Ccache disabled")
return()
endif()

if(CCACHE_DISABLE OR DEFINED ENV{CCACHE_DISABLE})
message(STATUS "Ccache disabled ('CCACHE_DISABLE' is set)")
return()
endif()

if(CMAKE_C_COMPILER_LOADED)
set(CMAKE_C_COMPILER_LAUNCHER ${Ccache_EXECUTABLE})
endif()
Expand Down
4 changes: 1 addition & 3 deletions cmake/cmake/modules/FindKerberos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ block(PROPAGATE Kerberos_VERSION)
OUTPUT_QUIET
)

string(REGEX MATCH " ([0-9]\.[0-9.]+) " _ "${version}")

if(CMAKE_MATCH_1)
if(version MATCHES [[ ([0-9]\.[0-9.]+)]])
set(Kerberos_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake/modules/FindODBC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ elseif(ODBC_CONFIG)
ERROR_QUIET
)

if(NOT result EQUAL 0 OR NOT ODBC_VERSION MATCHES "[0-9]+\.[0-9.]+")
if(NOT result EQUAL 0 OR NOT ODBC_VERSION MATCHES [[[0-9]+\.[0-9.]+]])
unset(ODBC_VERSION)
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake/modules/FindTokyoCabinet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ endif()
# Get version.
block(PROPAGATE TokyoCabinet_VERSION)
if(EXISTS ${TokyoCabinet_INCLUDE_DIR}/tcutil.h)
set(regex [[^[ \t]*#[ \t]*define[ \t]+_TC_VERSION[ \t]+"?([0-9.]+)"?[ \t]*$]])
set(regex [[^[ \t]*#[ \t]*define[ \t]+_TC_VERSION[ \t]+"?([^"]+)"?[ \t]*$]])

file(STRINGS ${TokyoCabinet_INCLUDE_DIR}/tcutil.h result REGEX "${regex}")

Expand Down
4 changes: 2 additions & 2 deletions cmake/ext/odbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ elseif(PHP_ODBC_TYPE STREQUAL "sapdb")
set(HAVE_SAPDB 1)
elseif(PHP_ODBC_TYPE STREQUAL "solid")
# Set based on the Solid version:
if(ODBC_LIBRARY MATCHES "23\.(a|so)$")
if(ODBC_LIBRARY MATCHES [[23\.(a|so)$]])
set(HAVE_SOLID 1)
elseif(ODBC_LIBRARY MATCHES "30\.(a|so)$")
elseif(ODBC_LIBRARY MATCHES [[30\.(a|so)$]])
set(HAVE_SOLID_30 1)
else()
set(HAVE_SOLID_35 1)
Expand Down
2 changes: 1 addition & 1 deletion cmake/sapi/fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ endif()
add_executable(php_fuzzer)
add_executable(PHP::fuzzer ALIAS php_fuzzer)

if(LIB_FUZZING_ENGINE OR "$ENV{LIB_FUZZING_ENGINE}")
if(LIB_FUZZING_ENGINE OR DEFINED ENV{LIB_FUZZING_ENGINE})
if(LIB_FUZZING_ENGINE)
set(libFuzzingEngine "${LIB_FUZZING_ENGINE}")
else()
Expand Down
Loading