From d7f2488099e9045cee3ee958fe29e04ff1cabb34 Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Mon, 30 Nov 2015 19:41:54 -0500 Subject: [PATCH] Link clang builds against libc++abi on Linux Simply running clang with -stdlib=libc++ requires a manual link against libc++abi on Linux. This is documented in the libc++ documentation: http://libcxx.llvm.org/ Tested on Arch Linux, using clang 3.7.0 RELEASE. Signed-off-by: Perry Hung --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47a428230..6dc73e7a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,9 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow") elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++ -Wall -pedantic -Werror -Wextra") + "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++ -Wall -pedantic -Werror -Wextra") + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -lc++abi") endif() if(FLATBUFFERS_CODE_COVERAGE)