Skip to content

Commit 899d16e

Browse files
ehersheykangas
authored andcommitted
SERVER-13724 Add --disable-warnings-as-errors scons option
This change was prompted by attempts to build 2.6.0 in SLES 10 with its system gcc version 4.1.2. It builds fine other than a sole warning - src/third_party/boost/boost/thread/detail/thread.hpp:316: warning: type attributes are honored only at type definition. It should also help in cases where compilers are too new. (cherry picked from commit 27c128d) Conflicts: SConstruct
1 parent d218cd5 commit 899d16e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SConstruct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ add_option("mongod-concurrency-level", "Concurrency level, \"global\" or \"db\""
231231
add_option('client-dist-basename', "Name of the client source archive.", 1, False,
232232
default='mongo-cxx-driver')
233233

234+
add_option('disable-warnings-as-errors', "Don't add -Werror to compiler command line", 0, False)
235+
234236
# don't run configure if user calls --help
235237
if GetOption('help'):
236238
Return()
@@ -710,7 +712,9 @@ if nix:
710712
"-Winvalid-pch"] )
711713
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
712714
if linux:
713-
env.Append( CCFLAGS=["-Werror", "-pipe"] )
715+
env.Append( CCFLAGS=["-pipe"] )
716+
if not has_option("disable-warnings-as-errors"):
717+
env.Append( CCFLAGS=["-Werror"] )
714718
if not has_option('clang'):
715719
env.Append( CCFLAGS=["-fno-builtin-memcmp"] ) # glibc's memcmp is faster than gcc's
716720

0 commit comments

Comments
 (0)