From dfcc8bc211ce9251b500d69744dca95fc70e6541 Mon Sep 17 00:00:00 2001 From: Michael Dickens Date: Thu, 6 Dec 2018 13:33:00 -0500 Subject: cmake: use "MATCHES" instead of "STREQUAL" for "Clang" + allows proper building with both AppleClang and native Clang. --- host/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/CMakeLists.txt') diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index cfbc81d34..8515a5b53 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -47,7 +47,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") message(WARNING "\nCannot determine the version of the compiler selected to build UHD (GCC : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using GCC version ${GCC_MIN_VERSION} or more recent.") endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og") -elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") +elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") execute_process(COMMAND ${CMAKE_CXX_COMPILER} -v RESULT_VARIABLE res ERROR_VARIABLE err @@ -83,7 +83,7 @@ endif() if(CMAKE_VERSION VERSION_LESS "3.1") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") set(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}") - elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") if("${IS_APPLE}" STREQUAL "") set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") else() @@ -229,7 +229,7 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "") set(UHD_RELEASE_MODE "${UHD_RELEASE_MODE}" CACHE STRING "UHD Release Mode") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR - ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") if(STRIP_BINARIES) if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") -- cgit v1.2.3