[libc] Use proper flags for compiler version detection

The `-v` flag means verbose and not version.
With `clang` this flag prints the version and exits successfully.
Under `GCC` this is not a valid command line so the binary exits with
an error.
This commit is contained in:
Guillaume Chatelet
2023-05-04 07:03:59 +00:00
parent 9fb5af5909
commit c267501c15

View File

@@ -76,7 +76,7 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
set(${sys_var} ${target_sys} PARENT_SCOPE)
endfunction(get_arch_and_system_from_triple)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -v
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version -v
RESULT_VARIABLE libc_compiler_info_result
OUTPUT_VARIABLE libc_compiler_info
ERROR_VARIABLE libc_compiler_info)