Skip to content

Commit 0c5de3f

Browse files
committed
Update docs
1 parent 0acfe88 commit 0c5de3f

File tree

11 files changed

+108
-26
lines changed

11 files changed

+108
-26
lines changed

docs/cmake/modules/PHP/Set.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# PHP/Set
2+
3+
See: [Set.cmake](https://github.com/petk/php-build-system/tree/master/cmake/cmake/modules/PHP/Set.cmake)
4+
5+
Set a CACHE variable that depends on a set of conditions.
6+
7+
In CMake there are 3 main ways to create non-internal cache variables that can
8+
be also customized using the `-D` command-line option, through CMake presets, or
9+
similar:
10+
* `option()`
11+
* `set(<variable> <value> CACHE <type> <docstring>)`
12+
* `cmake_dependent_option()`
13+
14+
Ideally, these are the recommended ways to set configuration variables. However,
15+
there are many cases where a `CACHE` variable of a type other than `BOOL`
16+
depends on certain conditions. Additionally, an edge-case issue with
17+
`cmake_dependent_option()` is that it sets a local variable if the conditions
18+
are not met. Local variables in such edge cases can be difficult to work with
19+
when using `add_subdirectory()`. In the parent scope, instead of the local
20+
variable with a forced value, the cached variable is still defined as
21+
`INTERNAL`, which can lead to bugs in the build process.
22+
23+
This module exposes the following function:
24+
25+
```cmake
26+
php_set(
27+
<variable>
28+
<default>
29+
CACHE <type>
30+
[STRINGS <string>...]
31+
[DOC <docstring>...]
32+
IF <condition>
33+
FORCED <forced>
34+
)
35+
```
36+
37+
It sets the given CACHE `<variable>` of `<type>` to a `<value>` if `<condition>`
38+
is met. Otherwise it sets the `<variable>` to `<default>` value and hides it in
39+
the GUI.
40+
41+
* The `CACHE` `<type>` can be `BOOL`, `FILEPATH`, `PATH`, or `STRING`.
42+
43+
* `STRINGS` is an optional list of items when `CACHE` `STRING` is used to create
44+
a list of supported options to pick in the GUI.
45+
46+
* `DOC` is a short variable help text visible in the GUIs. Multiple strings are
47+
joined together.
48+
49+
* `IF` behaves the same as the `<depends>` argument in
50+
`cmake_dependent_option()`. If conditions `<condition>` are met, the variable
51+
is set to `<default>` value. Otherwise, it is set to `<forced>` value and
52+
hidden in the GUIs. This supports both full condition sytanx and
53+
semicolon-separated list of conditions.
54+
55+
* `FORCED` is a value that is set when `IF <conditions>` are not met.

docs/cmake/variables/PHP_CONFIG_FILE_PATH.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ The path in which to look for `php.ini`. By default, it is set to the
77
`CMAKE_INSTALL_PREFIX` automatically prepended. If given as an absolute path,
88
install prefix is not appended.
99

10-
When target system is Windows, this option is not available and it defaults to
11-
empty string. On Windows it isn't utilized in the C code.
10+
> [!NOTE]
11+
> This option is not available when the target system is Windows. On Windows the
12+
> C preprocessor macro isn't utilized in the C code.

docs/cmake/variables/PHP_SIGCHILD.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ Default: `OFF`
44

55
Values: `ON|OFF`
66

7-
Enable PHP's own `SIGCHLD` handler. This option is not available when the target
8-
system is Windows.
7+
Enable PHP's own `SIGCHLD` handler.
8+
9+
> [!NOTE]
10+
> This option is not available when the target system is Windows.

docs/cmake/variables/PHP_THREAD_SAFETY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# `PHP_THREAD_SAFETY`
22

3-
Values: `ON|OFF`
4-
53
Default: `OFF`
64

5+
Values: `ON|OFF`
6+
77
Better known as Zend Thread Safety (ZTS), this feature allows PHP to handle
88
multiple threads safely in web server environments that require thread-safe
99
execution.

docs/cmake/variables/PHP_USE_RTLD_NOW.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ Default: `OFF`
44

55
Values: `ON|OFF`
66

7-
Use dlopen with the RTLD_NOW mode flag instead of RTLD_LAZY when loading shared
8-
extensions. This option is not available when the target system is Windows.
7+
Use `dlopen` with the `RTLD_NOW` mode flag instead of `RTLD_LAZY` when loading
8+
shared PHP extensions.
9+
10+
> [!NOTE]
11+
> This option is not available when the target system is Windows.

docs/cmake/variables/SAPI_CLI.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ Default: `OFF`
1414

1515
Values: `ON|OFF`
1616

17-
Build console-less CLI SAPI. This option is only available when the target
18-
system is Windows.
17+
Build console-less CLI SAPI.
18+
19+
> [!NOTE]
20+
> This option is only available when the target system is Windows.

docs/cmake/variables/SAPI_FPM.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ Default: `OFF`
44

55
Values: `ON|OFF`
66

7-
Enable the FastCGI Process Manager (FPM) SAPI module. This option is not
8-
available when the target system is Windows.
7+
Enable the FastCGI Process Manager (FPM) SAPI module.
8+
9+
> [!NOTE]
10+
> PHP FPM is not available when the target system is Windows.
911
1012
**Additional variables:**
1113

@@ -33,6 +35,9 @@ Enable the systemd integration.
3335
Where to find systemd installation on the system, can be customized with the
3436
`Systemd_ROOT` variable.
3537

38+
> [!NOTE]
39+
> This option is not available when the target system is Darwin (macOS).
40+
3641
## `SAPI_FPM_ACL`
3742

3843
Default: `OFF`
@@ -44,6 +49,9 @@ Use POSIX Access Control Lists.
4449
Where to find ACL installation on the system, can be customized with the
4550
`ACL_ROOT` variable.
4651

52+
> [!NOTE]
53+
> This option is not available when the target system is Darwin (macOS).
54+
4755
## `SAPI_FPM_APPARMOR`
4856

4957
Default: `OFF`
@@ -55,6 +63,9 @@ Enable the AppArmor confinement through libapparmor.
5563
Where to find AppArmor installation on the system, can be customized with the
5664
`AppArmor_ROOT` variable.
5765

66+
> [!NOTE]
67+
> This option is not available when the target system is Darwin (macOS).
68+
5869
## `SAPI_FPM_SELINUX`
5970

6071
Default: `OFF`
@@ -65,3 +76,6 @@ Enable the SELinux policy library support.
6576

6677
Where to find SELinux installation on the system, can be customized with the
6778
`SELinux_ROOT` variable.
79+
80+
> [!NOTE]
81+
> This option is not available when the target system is Darwin (macOS).
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# `ZEND_FIBER_ASM`
22

3-
Values: `ON|OFF`
4-
53
Default: `ON`
64

5+
Values: `ON|OFF`
6+
77
Enable the use of Boost fiber assembly files using the
88
[Zend/Fibers](/docs/cmake/modules/Zend/Fibers.md) module. If disabled or system
9-
isn't supported, fiber support will be run through ucontext. When target system
10-
is Windows, this option is always set to `ON` and option is hidden in the GUI as
11-
there is no alternative implementation available.
9+
isn't supported, fiber support will be run through ucontext.
10+
11+
> [!NOTE]
12+
> When target system is Windows, this option is always set to `ON` and option is
13+
> hidden in the CMake GUIs as there is no alternative implementation available.

docs/cmake/variables/ZEND_GLOBAL_REGISTER_VARIABLES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# `ZEND_GLOBAL_REGISTER_VARIABLES`
22

3-
Values: `ON|OFF`
4-
53
Default: `ON`
64

5+
Values: `ON|OFF`
6+
77
When enabled, the
88
[Zend/CheckGlobalRegisterVariables](/docs/cmake/modules/Zend/CheckGlobalRegisterVariables.md)
99
module checks whether the compiler and target system support the so-called
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# `ZEND_MAX_EXECUTION_TIMERS`
22

3-
Values: `auto|ON|OFF`
4-
53
Default: `auto`
64

5+
Values: `auto|ON|OFF`
6+
77
Zend max execution timers help with timeout and signal handling issues,
88
especially when thread safety is enabled.
99

@@ -13,4 +13,5 @@ them. When set to `ON` they get enabled whether the target system supports them
1313
regardless of the `PHP_THREAD_SAFETY` option. When set to `OFF`, they are always
1414
disabled.
1515

16-
This configuration is not available on Windows.
16+
> [!NOTE]
17+
> This option is not available when the target system is Windows.

0 commit comments

Comments
 (0)