Improve compatibility with CMake 3.0 and later

CMake 3.0 changed the identifier for Apple-supplied Clang to
AppleClang.

CMake 3.1 changed the behavior of variable expansion in quoted
strings and complains with warning CMP0054 twice without these
changes.

BUG=crbug.com/451610

Change-Id: I0f1514ec302cf5f1b5cfc2c5a1c71c9e20d5e855
Reviewed-on: https://boringssl-review.googlesource.com/3011
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Brian Smith 2015-01-23 17:25:44 -08:00 committed by Adam Langley
parent ed30c0d6cf
commit 1d75c8be73

View File

@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8.10)
project (BoringSSL)
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -ggdb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -ggdb -std=c++0x")
elseif(MSVC)
@ -11,8 +11,8 @@ elseif(MSVC)
set(CMAKE_CXX_FLAGS "/wd4267")
endif()
if((CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER "4.5.99") OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "4.5.99") OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
endif()