Commit e8427061 authored by Gregorio Litenstein's avatar Gregorio Litenstein

Thirdparty benchmark: Fix Clang detection.

CMake 3.0+ refers to macOS’ Clang as AppleClang, which would fail a STREQUAL check. Fixed by changing it to MATCHES.
parent b9116548
...@@ -140,7 +140,7 @@ else() ...@@ -140,7 +140,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}" STREQUAL "Clang") elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
include(llvm-toolchain) include(llvm-toolchain)
endif() endif()
endif() endif()
...@@ -165,7 +165,7 @@ else() ...@@ -165,7 +165,7 @@ else()
endif() endif()
if (BENCHMARK_USE_LIBCXX) if (BENCHMARK_USE_LIBCXX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_cxx_compiler_flag(-stdlib=libc++) add_cxx_compiler_flag(-stdlib=libc++)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
......
...@@ -7,7 +7,7 @@ macro(build_external_gtest) ...@@ -7,7 +7,7 @@ macro(build_external_gtest)
include(ExternalProject) include(ExternalProject)
set(GTEST_FLAGS "") set(GTEST_FLAGS "")
if (BENCHMARK_USE_LIBCXX) if (BENCHMARK_USE_LIBCXX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
list(APPEND GTEST_FLAGS -stdlib=libc++) list(APPEND GTEST_FLAGS -stdlib=libc++)
else() else()
message(WARNING "Unsupported compiler (${CMAKE_CXX_COMPILER}) when using libc++") message(WARNING "Unsupported compiler (${CMAKE_CXX_COMPILER}) when using libc++")
......
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