CMake: check CMAKE_CXX_COMPILER_ID, not CMAKE_C_COMPILER_ID

This may or may not have gotten broken now that benchmark was marked as CXX-only.
This commit is contained in:
Roman Lebedev 2019-05-11 18:56:57 +03:00
parent 12c978c513
commit 2e7203aa94
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0

View File

@ -191,7 +191,7 @@ else()
# Link time optimisation
if (BENCHMARK_ENABLE_LTO)
add_cxx_compiler_flag(-flto)
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
find_program(GCC_AR gcc-ar)
if (GCC_AR)
set(CMAKE_AR ${GCC_AR})
@ -200,7 +200,7 @@ else()
if (GCC_RANLIB)
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
include(llvm-toolchain)
endif()
endif()