File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -114,18 +114,21 @@ function(_print_compilers_info _variableNames _importantVariableNames)
114
114
115
115
if (_isCompiler)
116
116
set (_compilerVersion "" )
117
- get_filename_component (_executable_name "${${_variableName} }" NAME_WE )
118
- execute_process (
119
- COMMAND ${${_variableName} } --version
120
- COMMAND grep -i ${_executable_name}
121
- OUTPUT_VARIABLE _compilerVersion
122
- OUTPUT_STRIP_TRAILING_WHITESPACE
123
- )
124
- execute_process (
117
+ get_filename_component (_executable_name "${${_variableName} }" NAME_WE )
118
+ execute_process (
125
119
COMMAND which ${${_variableName} }
126
120
OUTPUT_VARIABLE _compilerPath
127
121
OUTPUT_STRIP_TRAILING_WHITESPACE
128
122
)
123
+ execute_process (
124
+ COMMAND "${_compilerPath} " --version
125
+ # version info does not always contain the exact executable name (clang++ -> clang)
126
+ # using now the hardcoded first line content instead :S
127
+ #COMMAND grep -i ${_executable_name}
128
+ COMMAND head -n 1
129
+ OUTPUT_VARIABLE _compilerVersion
130
+ OUTPUT_STRIP_TRAILING_WHITESPACE
131
+ )
129
132
_space_tabbed_string("${_variableName} " 32 _spaceTabbedVariableName)
130
133
_space_tabbed_string ("${_executable_name} " 10 _spaceTabbedExecutable_name)
131
134
_print_summary_line("${_spaceTabbedVariableName} " "${_spaceTabbedExecutable_name}${Green} [${Yellow}${_compilerVersion}${Green} ]${ResetFG} - ${_compilerPath} " 32)
You can’t perform that action at this time.
0 commit comments