From cf975f5988729f2de341de05eefbeb49f50bc723 Mon Sep 17 00:00:00 2001 From: "Barry K. Nathan" Date: Wed, 23 Apr 2014 17:40:25 -0700 Subject: [PATCH] Fix build with cc from Apple LLVM On Xcode 4.x and above (I tested Xcode 4.6.3 on 10.7.5 and Xcode 5.5.1 on 10.9.2), cmake (2.8.12.2, whether from MacPorts or from clang.org, FWIW) is detecting /usr/bin/cc as Clang, but CMAKE_COMPILER_IS_CLANG is not getting set, so the tests aren't being built. (There may have been other build problems as well, but the fact that the tests weren't being built was by far the most obvious problem.) Checking the compiler ID detected by cmake, rather than the name of the command used to invoke the compiler, fixes this. --- CMakeLists.txt | 2 +- ChangeLog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35faaf819..af268e707 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(POLARSSL C) -string(REGEX MATCH "clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER}") +string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement") diff --git a/ChangeLog b/ChangeLog index a2382cfd4..25a9fb40e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,8 @@ Bugfix * Fix dependencies issues in X.509 test suite. * Some parts of ssl_tls.c were compiled even when the module was disabled. * Fix detection of DragonflyBSD in net.c (found by Markus Pfeiffer) + * Fix detection of Clang on some Apple platforms with CMake + (found by Barry K. Nathan) = PolarSSL 1.3.6 released on 2014-04-11