[waf] Add -std=c++11 when CXXFLAGS is specified without -std= setting

This commit is contained in:
Fangrui Song 2017-12-28 22:23:59 -08:00
parent 5029173c8a
commit fd264310c2

View File

@ -137,6 +137,8 @@ def configure(ctx):
# If environment variable CXXFLAGS is unset, provide a sane default.
if not ctx.env.CXXFLAGS:
ctx.env.CXXFLAGS = cxxflags
elif all(not x.startswith('-std=') for x in ctx.env.CXXFLAGS):
ctx.env.CXXFLAGS.append('-std=c++11')
if not ctx.env.LDFLAGS:
ctx.env.LDFLAGS = ldflags
else: