Skip to content

Commit d98c6a2

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 9ea0a6f + 83e885b commit d98c6a2

File tree

24 files changed

+125
-87
lines changed

24 files changed

+125
-87
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ block()
396396
set(headers pthread.h)
397397

398398
# BSD-based systems have pthread_attr_get_np in pthread_np.h.
399-
check_include_files(pthread_np.h _PHP_HAVE_PTHREAD_NP_H)
400-
if(_PHP_HAVE_PTHREAD_NP_H)
399+
check_include_files(pthread_np.h PHP_HAS_PTHREAD_NP_H)
400+
if(PHP_HAS_PTHREAD_NP_H)
401401
list(APPEND headers "pthread_np.h")
402402
endif()
403403

cmake/cmake/Flags.cmake

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ endif()
2626
# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914
2727
if(
2828
CMAKE_C_COMPILER_ID STREQUAL "GNU"
29-
AND DEFINED CMAKE_C_COMPILER_VERSION
3029
AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8
3130
AND CMAKE_C_COMPILER_VERSION VERSION_LESS 8.3
3231
)
@@ -64,21 +63,25 @@ target_compile_options(
6463
$<$<AND:$<BOOL:${PHP_HAS_WNO_UNUSED_PARAMETER_CXX}>,$<COMPILE_LANGUAGE:CXX>>:-Wno-unused-parameter>
6564
)
6665

67-
if(MSVC)
68-
target_compile_options(
69-
php_config
70-
BEFORE
71-
INTERFACE
72-
$<$<COMPILE_LANGUAGE:ASM,C,CXX>:/W4>
73-
)
74-
else()
75-
target_compile_options(
76-
php_config
77-
BEFORE
78-
INTERFACE
79-
$<$<COMPILE_LANGUAGE:ASM,C,CXX>:-Wall;-Wextra>
80-
)
81-
endif()
66+
php_check_compiler_flag(C -Wextra PHP_HAS_WEXTRA_C)
67+
php_check_compiler_flag(CXX -Wextra PHP_HAS_WEXTRA_CXX)
68+
target_compile_options(
69+
php_config
70+
BEFORE
71+
INTERFACE
72+
$<$<AND:$<BOOL:${PHP_HAS_WEXTRA_C}>,$<COMPILE_LANGUAGE:ASM,C>>:-Wextra>
73+
$<$<AND:$<BOOL:${PHP_HAS_WEXTRA_CXX}>,$<COMPILE_LANGUAGE:CXX>>:-Wextra>
74+
)
75+
76+
php_check_compiler_flag(C -Wall PHP_HAS_WALL_C)
77+
php_check_compiler_flag(CXX -Wall PHP_HAS_WALL_CXX)
78+
target_compile_options(
79+
php_config
80+
BEFORE
81+
INTERFACE
82+
$<$<AND:$<BOOL:${PHP_HAS_WALL_C}>,$<COMPILE_LANGUAGE:ASM,C>>:-Wall>
83+
$<$<AND:$<BOOL:${PHP_HAS_WALL_CXX}>,$<COMPILE_LANGUAGE:CXX>>:-Wall>
84+
)
8285

8386
# Check if compiler supports -Wno-clobbered (only GCC).
8487
php_check_compiler_flag(C -Wno-clobbered PHP_HAS_WNO_CLOBBERED_C)

cmake/cmake/modules/FindMC.cmake

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#[=============================================================================[
22
# FindMC
33
4-
Find Windows compatible message compiler (mc.exe or windmc) command-line tool.
4+
Finds Windows compatible message compiler (mc.exe or windmc) command-line tool:
5+
6+
```cmake
7+
find_package(MC [...])
8+
```
59
610
Message compiler is installed on Windows as part of the Visual Studio or Windows
711
SDK. When cross-compiling for Windows, there is also a compatible alternative by
@@ -16,9 +20,9 @@ https://sourceware.org/binutils/docs/binutils.html#windmc.
1620
1721
* `MC_EXECUTABLE` - Path to the message compiler if found.
1822
19-
## Functions provided by this module
23+
## Commands
2024
21-
Module exposes the following function:
25+
This module provides the following command:
2226
2327
```cmake
2428
mc_target(
@@ -33,20 +37,23 @@ mc_target(
3337
```
3438
3539
* `NAME` - Target name.
36-
* `INPUT` - Input message file to compile.
40+
* `INPUT` - Input message file to compile. Relative path is interpreted as being
41+
relative to the current source directory.
3742
* `HEADER_DIR` - Set the export directory for headers, otherwise current binary
3843
directory will be used.
39-
* `RC_DIR` - Set the export directory for rc files.
44+
* `RC_DIR` - Set the export directory for rc files, otherwise current binary
45+
directory will be used.
4046
* `XDBG_DIR` - Where to create the .dbg C include file that maps message IDs to
4147
their symbolic name.
4248
* `OPTIONS` - A list of additional options to pass to message compiler tool.
4349
* `DEPENDS` - Optional list of dependent files to recompile message file.
4450
45-
## Usage
51+
## Examples
4652
4753
```cmake
4854
# CMakeLists.txt
4955
find_package(MC)
56+
mc_target(...)
5057
```
5158
#]=============================================================================]
5259

@@ -137,11 +144,12 @@ endblock()
137144

138145
set(_reason "")
139146

140-
if(NOT MC_EXECUTABLE OR NOT EXISTS ${MC_EXECUTABLE})
141-
string(APPEND _reason "Message compiler command-line tool (mc) not found. ")
142-
else()
143-
# If MC_EXECUTABLE was found or was set by the user and path exists.
147+
# Check whether MC_EXECUTABLE exists.
148+
if(EXISTS "${MC_EXECUTABLE}")
144149
set(_mc_exists TRUE)
150+
else()
151+
set(_mc_exists FALSE)
152+
string(APPEND _reason "Message compiler command-line tool (mc) not found. ")
145153
endif()
146154

147155
mark_as_advanced(MC_EXECUTABLE)
@@ -190,6 +198,13 @@ function(mc_target)
190198
return()
191199
endif()
192200

201+
cmake_path(
202+
ABSOLUTE_PATH
203+
parsed_INPUT
204+
BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
205+
NORMALIZE
206+
)
207+
193208
# Set default header export directory if empty.
194209
if(NOT parsed_HEADER_DIR)
195210
set(parsed_HEADER_DIR ${CMAKE_CURRENT_BINARY_DIR})

cmake/cmake/modules/PHP/CheckFopencookie.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ include(CMakePushCheckState)
3737

3838
cmake_push_check_state(RESET)
3939
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
40-
check_symbol_exists(fopencookie stdio.h _PHP_HAVE_FOPENCOOKIE)
40+
check_symbol_exists(fopencookie stdio.h PHP_HAS_FOPENCOOKIE)
4141
cmake_pop_check_state()
4242

43-
if(NOT _PHP_HAVE_FOPENCOOKIE)
43+
if(NOT PHP_HAS_FOPENCOOKIE)
4444
return()
4545
endif()
4646

cmake/cmake/modules/PHP/CheckGethostbynameR.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ function(_php_check_gethostbyname_r)
6565
HEADERS netdb.h
6666
LIBRARIES
6767
nsl # Solaris <= 11.3, illumos
68-
VARIABLE _PHP_HAVE_GETHOSTBYNAME_R
68+
VARIABLE PHP_HAS_GETHOSTBYNAME_R
6969
LIBRARY_VARIABLE library
7070
)
71-
if(NOT _PHP_HAVE_GETHOSTBYNAME_R)
71+
if(NOT PHP_HAS_GETHOSTBYNAME_R)
7272
message(CHECK_FAIL "not found")
7373
return()
7474
endif()

cmake/cmake/modules/PHP/CheckIPv6.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ cmake_push_check_state(RESET)
4848

4949
return 0;
5050
}
51-
]] _PHP_HAVE_IPV6)
51+
]] PHP_HAS_IPV6)
5252
cmake_pop_check_state()
5353

54-
if(_PHP_HAVE_IPV6)
54+
if(PHP_HAS_IPV6)
5555
set(HAVE_IPV6 TRUE)
5656
message(CHECK_PASS "yes")
5757
else()

cmake/cmake/modules/PHP/CheckSysMacros.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ include(PHP/CheckSysMacros)
7272
include_guard(GLOBAL)
7373

7474
# Skip in consecutive configuration phases.
75-
if(DEFINED _PHP_HAVE_SYS_MACROS_CHECKED)
75+
if(PHP_HAS_SYS_MACROS_CHECKED)
7676
return()
7777
endif()
7878

@@ -110,7 +110,7 @@ else()
110110
endif()
111111

112112
set(
113-
_PHP_HAVE_SYS_MACROS_CHECKED
113+
PHP_HAS_SYS_MACROS_CHECKED
114114
TRUE
115115
CACHE INTERNAL
116116
"Internal marker whether 'major', 'minor' and 'makedev' have been checked."

cmake/cmake/platforms/Darwin.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
3030
check_linker_flag(
3131
C
3232
"LINKER:-undefined,dynamic_lookup"
33-
HAVE_UNDEFINED_DYNAMIC_LOOKUP_FLAG_C
33+
PHP_HAS_UNDEFINED_DYNAMIC_LOOKUP_FLAG_C
3434
)
35-
if(HAVE_UNDEFINED_DYNAMIC_LOOKUP_FLAG_C)
35+
if(PHP_HAS_UNDEFINED_DYNAMIC_LOOKUP_FLAG_C)
3636
target_link_options(
3737
php_config
3838
INTERFACE

cmake/ext/intl/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ target_sources(
168168
uchar/uchar.stub.php
169169
)
170170

171-
php_check_compiler_flag(C -Wno-write-strings _PHP_HAVE_WNO_WRITE_STRINGS_C)
172-
if(_PHP_HAVE_WNO_WRITE_STRINGS_C)
171+
php_check_compiler_flag(C -Wno-write-strings PHP_HAS_WNO_WRITE_STRINGS_C)
172+
if(PHP_HAS_WNO_WRITE_STRINGS_C)
173173
target_compile_options(
174174
php_ext_intl
175175
PRIVATE
176176
$<$<COMPILE_LANGUAGE:C>:-Wno-write-strings>
177177
)
178178
endif()
179179

180-
php_check_compiler_flag(CXX -Wno-write-strings _PHP_HAVE_WNO_WRITE_STRINGS_CXX)
181-
if(_PHP_HAVE_WNO_WRITE_STRINGS_CXX)
180+
php_check_compiler_flag(CXX -Wno-write-strings PHP_HAS_WNO_WRITE_STRINGS_CXX)
181+
if(PHP_HAS_WNO_WRITE_STRINGS_CXX)
182182
target_compile_options(
183183
php_ext_intl
184184
PRIVATE

cmake/ext/odbc/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,15 @@ if(PHP_EXT_ODBC_TYPE STREQUAL "ibm-db2" AND TARGET ODBC::ODBC)
311311
cmake_push_check_state(RESET)
312312
set(CMAKE_REQUIRED_LIBRARIES ODBC::ODBC)
313313
check_include_files(sqlcli1.h HAVE_SQLCLI1_H)
314-
check_library_exists(ODBC::ODBC "" SQLExecute HAVE_SQLEXECUTE)
315314
cmake_pop_check_state()
315+
316316
if(NOT HAVE_SQLCLI1_H)
317317
message(FATAL_ERROR "Required <sqlcli1.h> header file not found.")
318318
endif()
319-
if(NOT HAVE_SQLEXECUTE)
319+
320+
check_library_exists(ODBC::ODBC "" SQLExecute PHP_EXT_ODBC_HAS_SQLEXECUTE)
321+
322+
if(NOT PHP_EXT_ODBC_HAS_SQLEXECUTE)
320323
message(
321324
FATAL_ERROR
322325
"ODBC build test failed. SQLExecute not found. The DB2 environment "

0 commit comments

Comments
 (0)