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.
parent 12c978c5
...@@ -191,7 +191,7 @@ else() ...@@ -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() ...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment