From e8427061a0fe8faadd8c4cf8fd873fc32846de07 Mon Sep 17 00:00:00 2001
From: Gregorio Litenstein <g.litenstein@gmail.com>
Date: Fri, 5 Oct 2018 02:01:43 -0300
Subject: [PATCH] Thirdparty benchmark: Fix Clang detection.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

CMake 3.0+ refers to macOS’ Clang as AppleClang, which would fail a STREQUAL check. Fixed by changing it to MATCHES.
---
 benchmarks/thirdparty/benchmark/CMakeLists.txt          | 4 ++--
 benchmarks/thirdparty/benchmark/cmake/HandleGTest.cmake | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/benchmarks/thirdparty/benchmark/CMakeLists.txt b/benchmarks/thirdparty/benchmark/CMakeLists.txt
index aa082676..f8dd0497 100644
--- a/benchmarks/thirdparty/benchmark/CMakeLists.txt
+++ b/benchmarks/thirdparty/benchmark/CMakeLists.txt
@@ -140,7 +140,7 @@ else()
       if (GCC_RANLIB)
         set(CMAKE_RANLIB ${GCC_RANLIB})
       endif()
-    elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+    elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
       include(llvm-toolchain)
     endif()
   endif()
@@ -165,7 +165,7 @@ else()
 endif()
 
 if (BENCHMARK_USE_LIBCXX)
-  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
     add_cxx_compiler_flag(-stdlib=libc++)
   elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
           "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
diff --git a/benchmarks/thirdparty/benchmark/cmake/HandleGTest.cmake b/benchmarks/thirdparty/benchmark/cmake/HandleGTest.cmake
index 77ffc4c5..d38e7eb9 100644
--- a/benchmarks/thirdparty/benchmark/cmake/HandleGTest.cmake
+++ b/benchmarks/thirdparty/benchmark/cmake/HandleGTest.cmake
@@ -7,7 +7,7 @@ macro(build_external_gtest)
   include(ExternalProject)
   set(GTEST_FLAGS "")
   if (BENCHMARK_USE_LIBCXX)
-    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
       list(APPEND GTEST_FLAGS -stdlib=libc++)
     else()
       message(WARNING "Unsupported compiler (${CMAKE_CXX_COMPILER}) when using libc++")