Skip to content

Commit d7a79ef

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 52b5524 commit d7a79ef

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
@@ -149,3 +149,19 @@ jobs:
149149
run: |
150150
cd php-${{ matrix.php }}
151151
ctest --preset all-enabled
152+
153+
- name: Install PHP
154+
run: |
155+
cd php-${{ matrix.php }}
156+
cmake --install php-build/all-enabled
157+
158+
- name: Setup shared standalone extension
159+
run: |
160+
cd php-${{ matrix.php }}
161+
php ext/ext_skel.php --ext phantom
162+
mkdir ext/phantom/cmake/modules
163+
cp cmake/modules/FindPHP.cmake ext/phantom/cmake/modules
164+
cmake -S ext/phantom -B ext/phantom/cmake-build
165+
cmake --build ext/phantom/cmake-build -j
166+
cmake --install ext/phantom/cmake-build
167+
#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)