From 1bf4d7b0fc2bc4c700e7cecc1e6e3c7faf4f03a5 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Tue, 12 Jun 2018 22:42:48 +0200 Subject: [PATCH] Extend Clang compiler detection to cover Apple CLang CMake 3.0 and above recognize that Apple Clang is a different compiler than upstream Clang and so it gets a different CMAKE_CXX_COMPILER_ID. --- CMakeLists.txt | 2 +- development/cmake/modules/FindCXX11Compiler.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1b448ca3a..63b4ea20d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,7 +260,7 @@ if(NOT CXX11COMPILER_FOUND) endif() set(LYX_GCC11_MODE) if(UNIX OR MINGW) - if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$") + if (CMAKE_CXX_COMPILER_ID MATCHES "^([cC]lang|AppleClang)$") # ignore the GCC_VERSION for clang # and use the resulting CXX11_STD_REGEX found in FindCXX11Compiler.cmake message(STATUS "Using clang") diff --git a/development/cmake/modules/FindCXX11Compiler.cmake b/development/cmake/modules/FindCXX11Compiler.cmake index 5c7b69866e..739d267bf0 100644 --- a/development/cmake/modules/FindCXX11Compiler.cmake +++ b/development/cmake/modules/FindCXX11Compiler.cmake @@ -34,7 +34,7 @@ INCLUDE(CheckCXXSourceCompiles) INCLUDE(FindPackageHandleStandardArgs) -if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$") +if (CMAKE_CXX_COMPILER_ID MATCHES "^([cC]lang|AppleClang)$") set(CXX11_FLAG_CANDIDATES "--std=c++11 -Wno-deprecated-register") else() if (CYGWIN)