Skip to content

Commit 82acf08

Browse files
authored
Sync booleans and fix CS (#19)
- CMake variables (TRUE/FALSE/ON/OFF) - Preprocessor macros simplified where possible - option() default value is OFF - Missing ZEND_ENABLE_STATIC_TSRMLS_CACHE added to phpdbg shared module - FindSendmail refactored also for Windows usage - Some cache variables converted to regular/local/directory variables - Fixed nits - 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 d12b4d8 commit 82acf08

File tree

139 files changed

+601
-458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+601
-458
lines changed

bin/php.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ function(php_check_url url result)
184184
)
185185

186186
if(status EQUAL 0)
187-
set(${result} 1)
187+
set(${result} TRUE)
188188
else()
189-
set(${result} 0)
189+
set(${result} FALSE)
190190
endif()
191191

192192
return(PROPAGATE ${result})

cmake/Zend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ target_include_directories(
310310
target_compile_definitions(
311311
zend
312312
PRIVATE
313-
ZEND_ENABLE_STATIC_TSRMLS_CACHE=1
313+
ZEND_ENABLE_STATIC_TSRMLS_CACHE
314314
PUBLIC
315315
$<$<PLATFORM_ID:Windows>:LIBZEND_EXPORTS>
316316
)

cmake/Zend/cmake/CheckDlsym.cmake

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#[=============================================================================[
2+
# CheckDlsym
3+
24
Check if `dlsym()` requires a leading underscore in symbol name.
35
46
Some non-ELF platforms, such as OpenBSD, FreeBSD, NetBSD, Mac OSX (~10.3),
57
needed underscore character (`_`) prefix for symbols, when using `dlsym()`. This
68
module is obsolete on current platforms.
79
8-
## Cache variables
10+
## Result variables
911
1012
* `DLSYM_NEEDS_UNDERSCORE`
13+
1114
Whether `dlsym()` requires a leading underscore in symbol names.
1215
#]=============================================================================]
1316

@@ -30,7 +33,7 @@ check_include_file(dlfcn.h HAVE_DLFCN_H)
3033

3134
block()
3235
if(HAVE_DLFCN_H)
33-
set(definitions "-DHAVE_DLFCN_H=1")
36+
set(definitions "-DHAVE_DLFCN_H")
3437
endif()
3538

3639
try_run(
@@ -110,14 +113,7 @@ block()
110113
endblock()
111114

112115
if(DLSYM_NEEDS_UNDERSCORE_COMPILED AND DLSYM_NEEDS_UNDERSCORE_EXITCODE EQUAL 2)
113-
set(
114-
DLSYM_NEEDS_UNDERSCORE 1
115-
CACHE INTERNAL
116-
"Whether dlsym() requires a leading underscore in symbol names."
117-
)
118-
endif()
119-
120-
if(DLSYM_NEEDS_UNDERSCORE)
116+
set(DLSYM_NEEDS_UNDERSCORE TRUE)
121117
message(CHECK_PASS "yes")
122118
else()
123119
message(CHECK_FAIL "no")

cmake/Zend/cmake/CheckFloatPrecision.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
#[=============================================================================[
2+
# CheckFloatPrecision
3+
24
Check for x87 floating point internal precision control.
35
46
See: https://wiki.php.net/rfc/rounding
57
68
## Cache variables
79
810
* `HAVE__FPU_SETCW`
11+
912
Whether `_FPU_SETCW` is usable.
13+
1014
* `HAVE_FPSETPREC`
15+
1116
Whether `fpsetprec` is present and usable.
17+
1218
* `HAVE__CONTROLFP`
19+
1320
Whether `_controlfp` is present and usable.
21+
1422
* `HAVE__CONTROLFP_S`
23+
1524
Whether `_controlfp_s` is present and usable.
25+
1626
* `HAVE_FPU_INLINE_ASM_X86`
27+
1728
Whether FPU control word can be manipulated by inline assembler.
1829
#]=============================================================================]
1930

cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#[=============================================================================[
2+
# CheckGlobalRegisterVariables
3+
24
Check whether the compiler and target system support global register variables.
35
46
Global register variables are relevant for the GNU C compatible compilers.

cmake/Zend/cmake/CheckMMAlignment.cmake

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#[=============================================================================[
2+
# CheckMMAlignment
3+
24
Test and set the alignment defines for the Zend memory manager (`ZEND_MM`). This
35
also does the logarithmic test.
46
5-
## Cache variables
7+
## Result variables
68
79
* `ZEND_MM_ALIGNMENT`
810
* `ZEND_MM_ALIGNMENT_LOG2`
@@ -23,7 +25,12 @@ if(
2325
set(ZEND_MM_EXITCODE__TRYRUN_OUTPUT "(size_t)8 (size_t)3 0")
2426
endif()
2527

26-
block()
28+
block(
29+
PROPAGATE
30+
ZEND_MM_ALIGNMENT
31+
ZEND_MM_ALIGNMENT_LOG2
32+
ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT
33+
)
2734
try_run(
2835
ZEND_MM_EXITCODE
2936
ZEND_MM_COMPILED
@@ -82,21 +89,13 @@ block()
8289
"ZEND_MM alignment defines failed. Please, check CMake logs.")
8390
endif()
8491

85-
set(
86-
ZEND_MM_ALIGNMENT ${zend_mm_alignment}
87-
CACHE INTERNAL "Alignment for Zend memory allocator"
88-
)
89-
set(
90-
ZEND_MM_ALIGNMENT_LOG2 ${zend_mm_alignment_log2}
91-
CACHE INTERNAL "Alignment for Zend memory allocator log2"
92-
)
93-
set(
94-
ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT ${zend_mm_need_eight_byte_realignment}
95-
CACHE INTERNAL "Whether 8-byte realignment is needed"
96-
)
92+
set(ZEND_MM_ALIGNMENT ${zend_mm_alignment})
93+
set(ZEND_MM_ALIGNMENT_LOG2 ${zend_mm_alignment_log2})
94+
set(ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT ${zend_mm_need_eight_byte_realignment})
9795
endblock()
9896

99-
message(VERBOSE
97+
message(
98+
VERBOSE
10099
"MM alignment values:\n"
101100
" ZEND_MM_ALIGNMENT=${ZEND_MM_ALIGNMENT}\n"
102101
" ZEND_MM_ALIGNMENT_LOG2=${ZEND_MM_ALIGNMENT_LOG2}\n"

cmake/Zend/cmake/CheckStackLimit.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#[=============================================================================[
2+
# CheckStackLimit
3+
24
Check whether the stack grows downwards. Assumes contiguous stack.
35
46
## Cache variables
57
6-
* `ZEND_CHECK_STACK_LIMIT`
8+
* `ZEND_CHECK_STACK_LIMIT
9+
710
Whether checking the stack limit is supported.
811
#]=============================================================================]
912

cmake/Zend/cmake/CheckStrerrorR.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#[=============================================================================[
2+
# CheckStrerrorR
3+
24
Check for `strerror_r()`, and if its a POSIX-compatible or a GNU-specific
35
version.
46
57
## Cache variables
68
79
* `HAVE_STRERROR_R`
10+
811
Whether `strerror_r()` is available.
12+
913
* `STRERROR_R_CHAR_P`
14+
1015
Whether `strerror_r()` returns a `char *` message, otherwise it returns an
1116
`int` error number.
1217
#]=============================================================================]

cmake/Zend/cmake/Fibers.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#[=============================================================================[
2+
# Fibers
3+
24
Check if Fibers can be used.
35
46
This module adds Boost fiber assembly files support if available for the

cmake/Zend/cmake/MaxExecutionTimers.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#[=============================================================================[
2+
# MaxExecutionTimers
3+
24
Check whether to enable Zend max execution timers.
35
46
## Cache variables

0 commit comments

Comments
 (0)