Skip to content

Commit bf7ac45

Browse files
committed
Add various improvements
- Updated module docs - get_cmake_property usages replaced with more common get_property() as the former is more for CMake core properties than custom global ones.
1 parent adaefe5 commit bf7ac45

27 files changed

+173
-80
lines changed

cmake/cmake/Flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(CheckSourceRuns)
88
include(CMakePushCheckState)
99
include(PHP/CheckCompilerFlag)
1010

11-
get_cmake_property(enabledLanguages ENABLED_LANGUAGES)
11+
get_property(enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES)
1212

1313
# Check for broken GCC optimize-strlen.
1414
include(PHP/CheckBrokenGccStrlenOpt)

cmake/cmake/Testing.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ block()
1616
set(parallel -j${processors})
1717
endif()
1818

19-
get_cmake_property(extensions PHP_EXTENSIONS)
19+
get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS)
2020
foreach(extension ${extensions})
2121
get_target_property(type php_${extension} TYPE)
2222
if(type MATCHES "^(MODULE|SHARED)_LIBRARY$")

cmake/cmake/modules/PHP/AddCustomCommand.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ php_add_custom_command(
3232
)
3333
```
3434
35+
## Basic usage
36+
3537
It acts similar to `add_custom_command()` and `add_custom_target()`, except that
3638
when PHP is not found on the system, the DEPENDS argument doesn't add
3739
dependencies among targets but instead checks their timestamps manually and
3840
executes the PHP_COMMAND only when needed.
3941
4042
```cmake
43+
# CMakeLists.txt
44+
include(PHP/AddCustomCommand)
4145
php_add_custom_command(
4246
php_generate_something
4347
OUTPUT

cmake/cmake/modules/PHP/CheckAVX512.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ TODO: Adjust checks for MSVC.
1010
## Cache variables
1111
1212
* `PHP_HAVE_AVX512_SUPPORTS`
13+
1314
Whether compiler supports AVX-512.
15+
1416
* `PHP_HAVE_AVX512_VBMI_SUPPORTS`
17+
1518
Whether compiler supports AVX-512 VBMI.
1619
#]=============================================================================]
1720

cmake/cmake/modules/PHP/CheckBrokenGccStrlenOpt.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914
99
## Cache variables
1010
1111
* `PHP_HAVE_BROKEN_OPTIMIZE_STRLEN`
12+
1213
Whether GCC has broken strlen() optimization.
1314
#]=============================================================================]
1415

cmake/cmake/modules/PHP/CheckBuiltin.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ php_check_builtin(<builtin> <result_var>)
1212
If builtin `<builtin>` is supported by the C compiler, store the check result in
1313
the cache variable `<result_var>`.
1414
15-
For example:
15+
## Basic usage
1616
1717
```cmake
18+
# CMakeLists.txt
1819
include(PHP/CheckBuiltin)
19-
2020
php_check_builtin(__builtin_clz PHP_HAVE_BUILTIN_CLZ)
2121
```
2222
#]=============================================================================]

cmake/cmake/modules/PHP/CheckCopyFileRange.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ only on Linux.
88
## Cache variables
99
1010
* `HAVE_COPY_FILE_RANGE`
11+
1112
Whether `copy_file_range()` is supported.
1213
#]=============================================================================]
1314

cmake/cmake/modules/PHP/CheckFlushIo.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Check if flush should be called explicitly after buffered io.
66
## Cache variables
77
88
* `HAVE_FLUSHIO`
9+
910
Whether flush should be called explicitly after a buffered io.
1011
#]=============================================================================]
1112

cmake/cmake/modules/PHP/CheckFopencookie.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ to use `off_t` only, check is left here when using glibc.
1313
## Cache variables
1414
1515
* `HAVE_FOPENCOOKIE`
16+
1617
Whether `fopencookie()` and `cookie_io_functions_t` are available.
18+
1719
* `COOKIE_SEEKER_USES_OFF64_T`
20+
1821
Whether `fopencookie` seeker uses the `off64_t` type.
1922
#]=============================================================================]
2023

cmake/cmake/modules/PHP/CheckGetaddrinfo.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ Check for working `getaddrinfo()`.
66
## Cache variables
77
88
* `HAVE_GETADDRINFO`
9+
910
Whether `getaddrinfo()` function is working as expected.
1011
1112
IMPORTED target:
1213
1314
* `PHP::CheckGetaddrinfoLibrary`
15+
1416
If there is additional library to be linked for using `getaddrinfo()`.
1517
#]=============================================================================]
1618

@@ -45,8 +47,8 @@ if(libraryForGetaddrinfo)
4547
)
4648
endif()
4749

48-
# If the variable HAVE_GETADDRINFO has been overridden (for example, on Windows)
49-
# or cached in consecutive runs, the module stops here.
50+
# If the variable HAVE_GETADDRINFO has been overridden the module stops here.
51+
# For example, on Windows.
5052
if(HAVE_GETADDRINFO)
5153
message(CHECK_PASS "yes (cached)")
5254
return()

0 commit comments

Comments
 (0)