Skip to content

Commit a730596

Browse files
committed
Move general configuration info to feature/build configuration summary
1 parent d4a669a commit a730596

File tree

3 files changed

+55
-42
lines changed

3 files changed

+55
-42
lines changed

cmake/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ include(cmake/CMakeDefaults.cmake)
55

66
message(STATUS "Initializing PHP build system")
77
message(STATUS "=============================")
8-
message(STATUS "CMake version: ${CMAKE_VERSION}")
9-
message(STATUS "CMake generator: ${CMAKE_GENERATOR}")
108

119
# Set the PHP_VERSION_* variables from configure.ac.
1210
include(cmake/Version.cmake)

cmake/cmake/Bootstrap.cmake

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ if(CMAKE_CXX_COMPILER)
1717
enable_language(CXX)
1818
endif()
1919

20-
# Output linker information.
21-
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
22-
if(CMAKE_C_COMPILER_LINKER)
23-
message(STATUS "C linker: ${CMAKE_C_COMPILER_LINKER}")
24-
endif()
25-
if(CMAKE_CXX_COMPILER_LINKER)
26-
message(STATUS "CXX linker: ${CMAKE_CXX_COMPILER_LINKER}")
27-
endif()
28-
endif()
29-
3020
# Check whether IPO/LTO can be enabled.
3121
include(PHP/Optimization)
3222

cmake/cmake/modules/PHP/FeatureSummary.cmake

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -73,39 +73,64 @@ function(php_feature_summary_preamble result)
7373
php_feature_summary_preamble_add_item("Zend module API number" "${zendModuleApi}" preamble)
7474
endif()
7575

76-
if(CMAKE_C_COMPILER_LOADED)
77-
set(compiler "")
78-
if(CMAKE_C_COMPILER_ID)
79-
string(APPEND compiler "${CMAKE_C_COMPILER_ID}")
80-
endif()
81-
if(CMAKE_C_COMPILER_VERSION)
82-
string(APPEND compiler " ${CMAKE_C_COMPILER_VERSION}")
83-
endif()
84-
string(STRIP "${compiler}" compiler)
85-
if(compiler)
86-
string(APPEND compiler " (${CMAKE_C_COMPILER})")
87-
else()
88-
string(APPEND compiler "${CMAKE_C_COMPILER}")
76+
get_property(enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES)
77+
foreach(language IN ITEMS ${enabledLanguages})
78+
# Add compiler info.
79+
if(CMAKE_${language}_COMPILER_LOADED)
80+
set(compiler "")
81+
if(CMAKE_${language}_COMPILER_ID)
82+
string(APPEND compiler "${CMAKE_${language}_COMPILER_ID}")
83+
endif()
84+
if(CMAKE_${language}_COMPILER_VERSION)
85+
string(APPEND compiler " ${CMAKE_${language}_COMPILER_VERSION}")
86+
endif()
87+
string(STRIP "${compiler}" compiler)
88+
if(compiler)
89+
string(APPEND compiler " (${CMAKE_${language}_COMPILER})")
90+
else()
91+
string(APPEND compiler "${CMAKE_${language}_COMPILER}")
92+
endif()
93+
php_feature_summary_preamble_add_item(
94+
"${language} compiler"
95+
"${compiler}"
96+
preamble
97+
)
8998
endif()
90-
php_feature_summary_preamble_add_item("C compiler" "${compiler}" preamble)
91-
endif()
9299

93-
if(CMAKE_CXX_COMPILER_LOADED)
94-
set(compiler "")
95-
if(CMAKE_CXX_COMPILER_ID)
96-
string(APPEND compiler "${CMAKE_CXX_COMPILER_ID}")
97-
endif()
98-
if(CMAKE_CXX_COMPILER_VERSION)
99-
string(APPEND compiler " ${CMAKE_CXX_COMPILER_VERSION}")
100-
endif()
101-
string(STRIP "${compiler}" compiler)
102-
if(compiler)
103-
string(APPEND compiler " (${CMAKE_CXX_COMPILER})")
104-
else()
105-
string(APPEND compiler "${CMAKE_CXX_COMPILER}")
100+
# Add linker info.
101+
if(CMAKE_${language}_COMPILER_LINKER)
102+
set(linker "")
103+
if(CMAKE_${language}_COMPILER_LINKER_ID)
104+
string(APPEND linker "${CMAKE_${language}_COMPILER_LINKER_ID}")
105+
endif()
106+
if(CMAKE_${language}_COMPILER_LINKER_VERSION)
107+
string(APPEND linker " ${CMAKE_${language}_COMPILER_LINKER_VERSION}")
108+
endif()
109+
string(STRIP "${linker}" linker)
110+
if(linker)
111+
string(APPEND linker " (${CMAKE_${language}_COMPILER_LINKER})")
112+
else()
113+
string(APPEND linker "${CMAKE_${language}_COMPILER_LINKER}")
114+
endif()
115+
php_feature_summary_preamble_add_item(
116+
"${language} linker"
117+
"${linker}"
118+
preamble
119+
)
106120
endif()
107-
php_feature_summary_preamble_add_item("CXX compiler" "${compiler}" preamble)
108-
endif()
121+
endforeach()
122+
123+
php_feature_summary_preamble_add_item(
124+
"CMake version"
125+
"${CMAKE_VERSION}"
126+
preamble
127+
)
128+
129+
php_feature_summary_preamble_add_item(
130+
"CMake generator"
131+
"${CMAKE_GENERATOR}"
132+
preamble
133+
)
109134

110135
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
111136
if(isMultiConfig)

0 commit comments

Comments
 (0)