summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2017-05-02 14:33:50 -0400
committerAndrew Morrow <acm@mongodb.com>2017-05-03 12:53:20 -0400
commitd949767b4ee2294cf3bd0d2e7433be29313cab03 (patch)
tree1ec2c6c92befa342b12b40152c8eb0541bb86d58 /SConstruct
parentf7942df347d738d1cbf1c0be527debbafea8dc17 (diff)
downloadmongo-d949767b4ee2294cf3bd0d2e7433be29313cab03.tar.gz
SERVER-24388 Enforce no link warnings on darwin targets
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct13
1 files changed, 9 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index effbf43cf04..abad9741eaf 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1597,7 +1597,12 @@ if env.TargetOSIs('posix'):
env.Append( CCFLAGS=["-Werror"] )
env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
- env.Append( LINKFLAGS=["-pthread"] )
+
+ # On OS X, clang doesn't want the pthread flag at link time, or it
+ # issues warnings which make it impossible for us to declare link
+ # warnings as errors. See http://stackoverflow.com/a/19382663.
+ if not (env.TargetOSIs('darwin') and env.ToolchainIs('clang')):
+ env.Append( LINKFLAGS=["-pthread"] )
# SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
# startup.
@@ -1627,11 +1632,11 @@ if env.TargetOSIs('posix'):
# Promote linker warnings into errors. We can't yet do this on OS X because its linker considers
# noall_load obsolete and warns about it.
- if not env.TargetOSIs('darwin') and not has_option("disable-warnings-as-errors"):
+ if not has_option("disable-warnings-as-errors"):
env.Append(
LINKFLAGS=[
- "-Wl,--fatal-warnings",
- ],
+ '-Wl,-fatal_warnings' if env.TargetOSIs('darwin') else "-Wl,--fatal-warnings",
+ ]
)
mmapv1 = False