Skip to content

Commit 5673f93

Browse files
committed
Extend FindPHP.cmake module
This enables using the same find module in various scenarios: - building PHP extension with CMake - building application with embedded PHP - finding only PHP executable
1 parent 2ff0fca commit 5673f93

File tree

6 files changed

+860
-351
lines changed

6 files changed

+860
-351
lines changed

.github/workflows/ci.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,19 @@ jobs:
138138
- name: Run tests
139139
run: |
140140
ctest --preset all-enabled
141+
142+
- name: Install PHP
143+
run: |
144+
cd php-${{ matrix.php }}
145+
cmake --install php-build/all-enabled
146+
147+
- name: Setup shared standalone extension
148+
run: |
149+
cd php-${{ matrix.php }}
150+
php ext/ext_skel.php --ext phantom
151+
mkdir ext/phantom/cmake/modules
152+
cp cmake/modules/FindPHP.cmake ext/phantom/cmake/modules
153+
cmake -S ext/phantom -B ext/phantom/cmake-build
154+
cmake --build ext/phantom/cmake-build -j
155+
cmake --install ext/phantom/cmake-build
156+
#php -d extension=phantom -m | grep phantom

cmake/cmake/Requirements.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,4 @@ find_package(Sendmail)
5656
# used at the build phase, where possible. The minimum version should match the
5757
# version required to run these PHP scripts.
5858
################################################################################
59-
block(PROPAGATE PHP_FOUND)
60-
find_package(PHP 7.4)
61-
endblock()
59+
find_package(PHP 7.4 COMPONENTS Interpreter)

0 commit comments

Comments
 (0)