When using clang on linux, don't use libc++, but libstdc++.

Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808086
This commit is contained in:
Sebastian Messmer 2016-10-25 15:50:53 -07:00
parent b12c68e2af
commit 6e86116d36

View File

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