File tree Expand file tree Collapse file tree 4 files changed +27
-34
lines changed Expand file tree Collapse file tree 4 files changed +27
-34
lines changed Original file line number Diff line number Diff line change @@ -787,8 +787,11 @@ endif()
787787
788788# Check GCOV.
789789if (PHP_GCOV)
790- if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" )
791- message (FATAL_ERROR "GCC is required for using PHP_GCOV='ON'." )
790+ if (NOT CMAKE_C_COMPILER_ID MATCHES "^(.*Clang|GNU)$" )
791+ message (
792+ FATAL_ERROR
793+ "GNU-compatible compiler is required for using PHP_GCOV='ON'."
794+ )
792795 endif ()
793796
794797 if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache" )
Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ include(PHP/CheckCompilerFlag)
1010
1111get_property (enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES )
1212
13+ # See https://bugs.php.net/28605.
14+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha" )
15+ if (CMAKE_C_COMPILER_ID MATCHES "^(.*Clang|GNU)$" )
16+ target_compile_options (php_config INTERFACE $<$<COMPILE_LANGUAGE:C>:-mieee>)
17+ else ()
18+ target_compile_options (php_config INTERFACE $<$<COMPILE_LANGUAGE:C>:-ieee>)
19+ endif ()
20+ endif ()
21+
1322# Check for broken GCC optimize-strlen.
1423include (PHP/CheckBrokenGccStrlenOpt)
1524if (PHP_HAVE_BROKEN_OPTIMIZE_STRLEN)
Original file line number Diff line number Diff line change @@ -24,31 +24,6 @@ include(GNUInstallDirs)
2424# Detect C standard library implementation.
2525include (PHP/StandardLibrary)
2626
27- # See https://bugs.php.net/28605.
28- if (CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha" )
29- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" )
30- target_compile_options (
31- php_config
32- INTERFACE
33- $<$<COMPILE_LANGUAGE:ASM,C>:-mieee>
34- )
35- else ()
36- target_compile_options (
37- php_config
38- INTERFACE
39- $<$<COMPILE_LANGUAGE:ASM,C>:-ieee>
40- )
41- endif ()
42- elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc" )
43- if (CMAKE_C_COMPILER_ID STREQUAL "SunPro" )
44- target_compile_options (
45- php_config
46- INTERFACE
47- $<$<COMPILE_LANGUAGE:ASM,C>:-xmemalign=8s>
48- )
49- endif ()
50- endif ()
51-
5227# Platform-specific configuration. When cross-compiling, the host and target can
5328# be different values with different configurations.
5429if (NOT CMAKE_HOST_SYSTEM_NAME EQUAL CMAKE_SYSTEM_NAME )
Original file line number Diff line number Diff line change @@ -5,11 +5,17 @@ Specific configuration for HP-UX platform.
55include_guard (GLOBAL )
66
77if (CMAKE_SYSTEM_NAME STREQUAL "HP-UX" )
8- target_compile_definitions (
9- php_config
10- INTERFACE
11- $<$<COMPILE_LANG_AND_ID:ASM,GNU>:_XOPEN_SOURCE_EXTENDED>
12- $<$<COMPILE_LANG_AND_ID:C,GNU>:_XOPEN_SOURCE_EXTENDED>
13- $<$<COMPILE_LANG_AND_ID:CXX,GNU>:_XOPEN_SOURCE_EXTENDED>
14- )
8+ if (CMAKE_C_COMPILER_ID MATCHES "^(.*Clang|GNU)$" )
9+ target_compile_definitions (
10+ php_config
11+ INTERFACE $<$<COMPILE_LANGUAGE:C>:_XOPEN_SOURCE_EXTENDED>
12+ )
13+ endif ()
14+
15+ if (CMAKE_CXX_COMPILER_ID MATCHES "^(.*Clang|GNU)$" )
16+ target_compile_definitions (
17+ php_config
18+ INTERFACE $<$<COMPILE_LANGUAGE:CXX>:_XOPEN_SOURCE_EXTENDED>
19+ )
20+ endif ()
1521endif ()
You can’t perform that action at this time.
0 commit comments