diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -30,6 +30,21 @@ "${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there." ) + +# Show detailed compiler version information when available. This is mainly +# useful in the CI to determine the exact version of the Clang nightly build +# used. This information is not available in CMAKE_CXX_COMPILER_VERSION. It may +# be useful for users using non-release versions of other compilers so don't +# restrict this to Clang but test whether the compiler supports the version +# flag. +execute_process(COMMAND + "${CMAKE_CXX_COMPILER}" "--version" + OUTPUT_VARIABLE out + ERROR_VARIABLE err) +if(NOT "${out}" STREQUAL "" AND "${err}" STREQUAL "") + message(STATUS "Compiler used:\n${out}") +endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") message(STATUS "Configuring for clang-cl") set(LIBCXX_TARGETING_CLANG_CL ON)