Skip to content

Commit 57b858f

Browse files
committed
Fix PHP system requirements and fix CS
Only checking for executable is not enough. The <PackageName>_FOUND variable is the way to go if insuficcient version executable is set but package considered not found.
1 parent d75890e commit 57b858f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ block()
164164
endblock()
165165

166166
# Rebuild all targets as needed.
167-
if(NOT PHPSystem_EXECUTABLE)
167+
if(NOT PHPSystem_FOUND)
168168
include(cmake/Rebuild.cmake)
169169
endif()
170170

cmake/Zend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ include(cmake/Signals.cmake)
496496
# See: https://github.com/php/php-src/issues/15899
497497
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 4)
498498
php_add_custom_command(
499-
zend_generate_vm
499+
php_zend_generate_vm
500500
OUTPUT
501501
${CMAKE_CURRENT_SOURCE_DIR}/zend_vm_execute.h
502502
${CMAKE_CURRENT_SOURCE_DIR}/zend_vm_handlers.h

cmake/cmake/modules/PHP/AddCustomCommand.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function(php_add_custom_command)
8282
set(verbatim "")
8383
endif()
8484

85-
if(PHPSystem_EXECUTABLE)
85+
if(PHPSystem_FOUND)
8686
add_custom_command(
8787
OUTPUT ${parsed_OUTPUT}
8888
COMMAND ${PHPSystem_EXECUTABLE} ${parsed_PHP_COMMAND}

cmake/cmake/modules/PHP/Stubs.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function(_php_stubs_get_php_command result)
2222
# If PHP is not found on the system, the PHP cli SAPI will be used with the
2323
# tokenizer extension.
2424
if(
25-
NOT PHPSystem_EXECUTABLE
25+
NOT PHPSystem_FOUND
2626
AND (
2727
NOT TARGET PHP::sapi::cli
2828
OR (TARGET PHP::sapi::cli AND NOT TARGET PHP::ext::tokenizer)
@@ -32,7 +32,7 @@ function(_php_stubs_get_php_command result)
3232
endif()
3333

3434
# If external PHP is available, check for the required tokenizer extension.
35-
if(PHPSystem_EXECUTABLE)
35+
if(PHPSystem_FOUND)
3636
execute_process(
3737
COMMAND ${PHPSystem_EXECUTABLE} --ri tokenizer
3838
RESULT_VARIABLE code
@@ -120,7 +120,7 @@ block()
120120
$<PATH:ABSOLUTE_PATH,NORMALIZE,$<LIST:FILTER,$<TARGET_PROPERTY:${target},SOURCES>,INCLUDE,\.stub\.php$>,$<TARGET_PROPERTY:${target},SOURCE_DIR>>
121121
)
122122

123-
if(PHPSystem_EXECUTABLE)
123+
if(PHPSystem_FOUND)
124124
add_dependencies(${target} php_stubs)
125125
endif()
126126
endforeach()
@@ -135,7 +135,7 @@ block()
135135
)
136136

137137
set(target_options "")
138-
if(NOT PHPSystem_EXECUTABLE)
138+
if(NOT PHPSystem_FOUND)
139139
set(target_options ALL DEPENDS ${targets})
140140
endif()
141141

0 commit comments

Comments
 (0)