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) #################################################