Skip to content

Commit 0088d3d

Browse files
committed
Sync CS
1 parent 04e948a commit 0088d3d

File tree

5 files changed

+51
-57
lines changed

5 files changed

+51
-57
lines changed

cmake/cmake/ConfigureChecks.cmake

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,7 @@ endif()
399399
# Check getaddrinfo().
400400
include(PHP/CheckGetaddrinfo)
401401
if(TARGET PHP::CheckGetaddrinfoLibrary)
402-
target_link_libraries(
403-
php_config
404-
INTERFACE
405-
PHP::CheckGetaddrinfoLibrary
406-
)
402+
target_link_libraries(php_config INTERFACE PHP::CheckGetaddrinfoLibrary)
407403
endif()
408404

409405
# Check copy_file_range().
@@ -766,17 +762,17 @@ block()
766762
if(PHP_LIBGCC)
767763
execute_process(
768764
COMMAND gcc --print-libgcc-file-name
769-
OUTPUT_VARIABLE libgcc_path
765+
OUTPUT_VARIABLE path
770766
OUTPUT_STRIP_TRAILING_WHITESPACE
771767
)
772768

773-
if(NOT EXISTS "${libgcc_path}")
774-
message(FATAL_ERROR "Cannot locate libgcc.")
769+
if(NOT EXISTS "${path}")
770+
message(FATAL_ERROR "The libgcc path not found ${path}")
775771
endif()
776772

777-
message(STATUS "Explicitly linking against libgcc (${libgcc_path})")
773+
message(STATUS "Explicitly linking against libgcc (${path})")
778774

779-
target_link_libraries(php_config INTERFACE ${libgcc_path})
775+
target_link_libraries(php_config INTERFACE ${path})
780776
endif()
781777
endblock()
782778

@@ -828,11 +824,9 @@ if(PHP_VALGRIND)
828824
PURPOSE "Necessary to enable Valgrind support."
829825
)
830826

831-
if(Valgrind_FOUND)
832-
set(HAVE_VALGRIND TRUE)
833-
endif()
834-
835827
target_link_libraries(php_config INTERFACE Valgrind::Valgrind)
828+
829+
set(HAVE_VALGRIND TRUE)
836830
endif()
837831
add_feature_info(
838832
"Valgrind"
@@ -842,8 +836,6 @@ add_feature_info(
842836

843837
# DTrace.
844838
if(PHP_DTRACE)
845-
message(CHECK_START "Checking for DTrace support")
846-
847839
find_package(DTrace)
848840
set_package_properties(
849841
DTrace
@@ -867,14 +859,11 @@ if(PHP_DTRACE)
867859
INCLUDES
868860
$<TARGET_PROPERTY:PHP::config,INTERFACE_INCLUDE_DIRECTORIES>
869861
)
862+
870863
target_link_libraries(php_config INTERFACE DTrace::DTrace)
871864
target_link_libraries(php_sapi INTERFACE php_dtrace)
872865

873866
set(HAVE_DTRACE TRUE)
874-
875-
message(CHECK_PASS "yes")
876-
else()
877-
message(CHECK_FAIL "no")
878867
endif()
879868
endif()
880869
add_feature_info(
@@ -885,8 +874,6 @@ add_feature_info(
885874

886875
# Dmalloc.
887876
if(PHP_DMALLOC)
888-
message(CHECK_START "Checking for Dmalloc support")
889-
890877
find_package(Dmalloc)
891878
set_package_properties(
892879
Dmalloc
@@ -903,12 +890,7 @@ if(PHP_DMALLOC)
903890

904891
target_link_libraries(php_config INTERFACE Dmalloc::Dmalloc)
905892

906-
if(Dmalloc_FOUND)
907-
message(CHECK_PASS "yes")
908-
set(HAVE_DMALLOC TRUE)
909-
else()
910-
message(CHECK_FAIL "no")
911-
endif()
893+
set(HAVE_DMALLOC TRUE)
912894
endif()
913895
add_feature_info(
914896
"Dmalloc"

cmake/cmake/modules/PHP/CheckGethostbynameR.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ https://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
2929
3030
Whether `gethostbyname_r()` has 3 arguments.
3131
32+
## Result variables
33+
3234
* `HAVE_GETHOSTBYNAME_R`
3335
3436
Whether `gethostbyname_r()` is available.
@@ -125,8 +127,5 @@ if(
125127
OR HAVE_FUNC_GETHOSTBYNAME_R_5
126128
OR HAVE_FUNC_GETHOSTBYNAME_R_3
127129
)
128-
set(
129-
HAVE_GETHOSTBYNAME_R TRUE
130-
CACHE INTERNAL "Whether gethostbyname_r() is available."
131-
)
130+
set(HAVE_GETHOSTBYNAME_R TRUE)
132131
endif()

cmake/cmake/modules/PHP/CheckReentrantFunctions.cmake

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,43 @@ functions on current systems and this module might be obsolete in the future.
1010
1111
## Cache variables
1212
13-
* `HAVE_LOCALTIME_R`
13+
* `HAVE_ASCTIME_R`
1414
15-
Whether `localtime_r()` is available.
15+
Whether `asctime_r()` is available.
1616
17-
* `MISSING_LOCALTIME_R_DECL`
17+
* `HAVE_CTIME_R`
1818
19-
Whether `localtime_r()` is not declared.
19+
Whether `ctime_r()` is available.
2020
2121
* `HAVE_GMTIME_R`
2222
2323
Whether `gmtime_r()` is available.
2424
25-
* `MISSING_GMTIME_R_DECL`
25+
* `HAVE_LOCALTIME_R`
2626
27-
Whether `gmtime_r()` is not declared.
27+
Whether `localtime_r()` is available.
2828
29-
* `HAVE_ASCTIME_R`
29+
* `HAVE_STRTOK_R`
3030
31-
Whether `asctime_r()` is available.
31+
Whether `strtok_r()` is available.
32+
33+
## Result variables
3234
3335
* `MISSING_ASCTIME_R_DECL`
3436
3537
Whether `asctime_r()` is not declared.
3638
37-
* `HAVE_CTIME_R`
38-
39-
Whether `ctime_r()` is available.
40-
4139
* `MISSING_CTIME_R_DECL`
4240
4341
Whether `ctime_r()` is not declared.
4442
45-
* `HAVE_STRTOK_R`
43+
* `MISSING_GMTIME_R_DECL`
4644
47-
Whether `strtok_r()` is available.
45+
Whether `gmtime_r()` is not declared.
46+
47+
* `MISSING_LOCALTIME_R_DECL`
48+
49+
Whether `localtime_r()` is not declared.
4850
4951
* `MISSING_STRTOK_R_DECL`
5052
@@ -69,23 +71,20 @@ function(_php_check_reentrant_function symbol header)
6971

7072
cmake_push_check_state(RESET)
7173
set(CMAKE_REQUIRED_QUIET TRUE)
72-
check_symbol_exists(${symbol} ${header} _have_${symbol})
74+
check_symbol_exists(${symbol} ${header} PHP_HAVE_DECL_${const})
7375
cmake_pop_check_state()
7476

75-
if(NOT _have_${symbol})
77+
if(NOT PHP_HAVE_DECL_${const})
7678
message(CHECK_FAIL "missing")
7779

78-
set(
79-
MISSING_${const}_DECL TRUE
80-
CACHE INTERNAL "Define if ${symbol} is not declared."
81-
)
80+
set(MISSING_${const}_DECL TRUE)
8281
else()
8382
message(CHECK_PASS "found")
8483
endif()
8584
endfunction()
8685

87-
_php_check_reentrant_function(localtime_r time.h)
88-
_php_check_reentrant_function(gmtime_r time.h)
8986
_php_check_reentrant_function(asctime_r time.h)
9087
_php_check_reentrant_function(ctime_r time.h)
88+
_php_check_reentrant_function(gmtime_r time.h)
89+
_php_check_reentrant_function(localtime_r time.h)
9190
_php_check_reentrant_function(strtok_r string.h)

cmake/cmake/modules/PHP/Set.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ php_set(
115115
VAR=auto
116116
```
117117

118+
The following example sets variable `VAR` to value `OFF` and hides it in the
119+
GUI on Windows. On other systems it sets it to `auto` by default.
120+
121+
```cmake
122+
include(PHP/Set)
123+
php_set(
124+
VAR
125+
IF [[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
126+
CHOICES auto ON OFF
127+
ELSE_VALUE OFF
128+
DOC "Conditional choices"
129+
)
130+
```
131+
118132
* When `CHOICES_OPTIONAL` is given, the variable value will not be required to
119133
match one of the list items. By default, when using `CHOICES`, the variable
120134
value must match one of the list items; otherwise, a fatal error is thrown.

cmake/sapi/phpdbg/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ endif()
100100
# Executable and library.
101101
################################################################################
102102

103-
set(php_phpdbg_sources
103+
set(phpdbgSources
104104
phpdbg_bp.c
105105
phpdbg_break.c
106106
phpdbg_btree.c
@@ -124,7 +124,7 @@ set(php_phpdbg_sources
124124
phpdbg.c
125125
)
126126

127-
add_executable(php_sapi_phpdbg ${php_phpdbg_sources})
127+
add_executable(php_sapi_phpdbg ${phpdbgSources})
128128
add_executable(PHP::sapi::phpdbg ALIAS php_sapi_phpdbg)
129129

130130
target_compile_definitions(
@@ -222,7 +222,7 @@ if(PHP_SAPI_PHPDBG_SHARED)
222222

223223
set_target_properties(php_sapi_phpdbg_shared PROPERTIES OUTPUT_NAME phpdbg)
224224

225-
target_sources(php_sapi_phpdbg_shared PRIVATE ${php_phpdbg_sources})
225+
target_sources(php_sapi_phpdbg_shared PRIVATE ${phpdbgSources})
226226

227227
target_compile_definitions(
228228
php_sapi_phpdbg_shared

0 commit comments

Comments
 (0)