0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

SERVER-8676 Add libc++ support when building with clang

This commit is contained in:
Andrew Morrow 2013-03-01 15:50:58 -05:00
parent e08eb0176c
commit 1426de920e

View File

@ -186,6 +186,7 @@ add_option( "ssl" , "Enable SSL" , 0 , True )
# library choices
add_option( "usesm" , "use spider monkey for javascript" , 0 , True )
add_option( "usev8" , "use v8 for javascript" , 0 , True )
add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True )
# mongo feature options
add_option( "noshell", "don't build shell" , 0 , True )
@ -926,6 +927,16 @@ def doConfigure(myenv):
print( 'TCMalloc is not currently compatible with C++11' )
Exit(1)
if has_option('libc++'):
if not using_clang:
print( 'libc++ is currently only supported for clang')
Exit(1)
if AddToCXXFLAGSIfSupported(myenv, '-stdlib=libc++'):
myenv.Append(LINKFLAGS=['-stdlib=libc++'])
else:
print( 'libc++ requested, but compiler does not support -stdlib=libc++' )
Exit(1)
# glibc's memcmp is faster than gcc's
if nix and linux:
AddToCCFLAGSIfSupported(myenv, "-fno-builtin-memcmp")