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

SERVER-8464 For C++11 builds, specify C99 mode for any C compiles

This commit is contained in:
Andrew Morrow 2013-03-13 17:00:06 -04:00
parent e01d425eef
commit a7e6e1fa8b

View File

@ -885,9 +885,9 @@ def doConfigure(myenv):
env.Append(**mutation)
return available
# TOOD(acm): For clang, for instance, we need -Werror or invalid
# flags are only warnings. This should be handled more flexibly, but I'm
# leaving it here just to demonstrate.
def AddToCFLAGSIfSupported(env, flag):
return AddFlagIfSupported(env, 'C', '.c', flag, CFLAGS=[flag])
def AddToCCFLAGSIfSupported(env, flag):
return AddFlagIfSupported(env, 'C', '.c', flag, CCFLAGS=[flag])
@ -933,6 +933,9 @@ def doConfigure(myenv):
print( 'TCMalloc is not currently compatible with C++11' )
Exit(1)
if not AddToCFLAGSIfSupported(myenv, '-std=c99'):
print( 'C++11 mode selected for C++ files, but failed to enable C99 for C files' )
# This needs to happen before we check for libc++, since it affects whether libc++ is available.
if darwin and has_option('osx-version-min'):
min_version = get_option('osx-version-min')