From 2e7203aa94bf49cdfb60e58a7694784260bc6cc5 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Sat, 11 May 2019 18:56:57 +0300 Subject: [PATCH] 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. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41b3b668..9db13612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()