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.
This commit is contained in:
Stephan Witt 2018-06-12 22:42:48 +02:00
parent cb08d4a879
commit 1bf4d7b0fc
2 changed files with 2 additions and 2 deletions

View File

@ -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")

View File

@ -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)