diff --git a/CMakeLists.txt b/CMakeLists.txt index fff85b14..1c57db9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,7 +193,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() @@ -218,7 +218,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/cmake/HandleGTest.cmake b/cmake/HandleGTest.cmake index 7ce1a633..8c03b751 100644 --- a/cmake/HandleGTest.cmake +++ b/cmake/HandleGTest.cmake @@ -5,7 +5,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++")