Add libc++ support for non-MacOS

This commit is contained in:
mpilman 2019-06-10 15:28:27 -07:00 committed by Alex Miller
parent a6ab86fc4b
commit 8590cd4286
1 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,7 @@ set(WITH_UNDODB OFF CACHE BOOL "Use rr or undodb")
set(USE_ASAN OFF CACHE BOOL "Compile with address sanitizer")
set(FDB_RELEASE OFF CACHE BOOL "This is a building of a final release")
set(USE_LD "LD" CACHE STRING "The linker to use for building: can be LD (system default, default choice), GOLD, or LLD")
set(USE_LIBCXX OFF CACHE BOOL "Use libc++")
set(USE_CCACHE OFF CACHE BOOL "Use ccache for compilation if available")
if(USE_GPERFTOOLS)
@ -132,8 +133,12 @@ else()
add_compile_options(-DVALGRIND -DUSE_VALGRIND)
endif()
if (CLANG)
if (APPLE)
add_compile_options(-stdlib=libc++)
if (APPLE OR USE_LIBCXX)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++>)
add_compile_definitions(WITH_LIBCXX)
if (NOT APPLE)
add_link_options(-stdlib=libc++ -lc++abi -Wl,-build-id=sha1)
endif()
endif()
add_compile_options(
-Wno-unknown-warning-option