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
1 changed files with 2 additions and 2 deletions

View File

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