From 33988c2c900b2d82ddf52273f41186d1db898220 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 30 Dec 2015 22:17:31 -0400 Subject: [PATCH] CMakeLists: don't hardcode libc++ on Darwin Some Darwin users (for example, users on pre-OS X 10.7 systems) use FSF GCC releases instead of Clang; hardcoding the -stdlib=libc++ flag causes the build to fail for them. Instead, pass this whenever Clang is used. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7341d3a9d..733b0c184 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,11 +43,14 @@ else (_HAS_CXX11) message (FATAL_ERROR "C++11 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@taskwarrior.org.") endif (_HAS_CXX11) +if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + set (_CXX11_FLAGS "${_CXX11_FLAGS} -stdlib=libc++") +endif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set (LINUX true) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (DARWIN true) - set (_CXX11_FLAGS "${_CXX11_FLAGS} -stdlib=libc++") elseif (${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD") set (KFREEBSD true) elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")