From 737109e7aac8ba218838e86599a6394f1a223137 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Tue, 17 Dec 2013 18:35:03 -0800 Subject: [PATCH] Check for libc++ before using it. Fixes #731. --- cpp/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5b6d1941..3d9751a5 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -67,8 +67,11 @@ endif() if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) set( COMPILER_IS_CLANG true ) - # The Travis CI build machines don't have libc++ installed - if ( NOT DEFINED ENV{TRAVIS} ) + # Linux machines don't necessarily have libc++ installed alongside clang, + # but HAS_LIBCXX11 doesn't always trigger for machines that DO have libc++. We + # know that at least all the Mac OS versions we support that use Clang have + # libc++, so we're safe there. + if ( HAS_LIBCXX11 OR APPLE ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) endif()