From 6e86116d364a8918a92665db97077bb9993f5e76 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 25 Oct 2016 15:50:53 -0700 Subject: [PATCH] When using clang on linux, don't use libc++, but libstdc++. Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808086 --- utils.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils.cmake b/utils.cmake index 1d1e4092..de03cdba 100644 --- a/utils.cmake +++ b/utils.cmake @@ -22,9 +22,13 @@ function(target_activate_cpp14 TARGET) endif() endif(COMPILER_HAS_CPP14_SUPPORT) endif("${CMAKE_VERSION}" VERSION_GREATER "3.1") - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # Ideally, we'd like to use libc++ on linux as well, but: + # - http://stackoverflow.com/questions/37096062/get-a-basic-c-program-to-compile-using-clang-on-ubuntu-16 + # - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808086 + # so only use it on Apple systems... + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE) target_compile_options(${TARGET} PUBLIC -stdlib=libc++) - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE) endfunction(target_activate_cpp14) #################################################