|
1 | | -# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
2 | | - |
3 | 1 | import platform |
4 | 2 | from waflib import Configure, Logs, Utils |
5 | 3 |
|
@@ -128,16 +126,16 @@ def getCompilerVersion(self, conf): |
128 | 126 |
|
129 | 127 | def getGeneralFlags(self, conf): |
130 | 128 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed""" |
| 129 | + return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []} |
| 130 | + |
| 131 | + def getDebugFlags(self, conf): |
| 132 | + """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode""" |
131 | 133 | return { |
132 | 134 | 'CXXFLAGS': [], |
133 | 135 | 'LINKFLAGS': [], |
134 | 136 | 'DEFINES': ['BOOST_FILESYSTEM_NO_DEPRECATED'], |
135 | 137 | } |
136 | 138 |
|
137 | | - def getDebugFlags(self, conf): |
138 | | - """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode""" |
139 | | - return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []} |
140 | | - |
141 | 139 | def getOptimizedFlags(self, conf): |
142 | 140 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode""" |
143 | 141 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']} |
@@ -245,6 +243,9 @@ def getDebugFlags(self, conf): |
245 | 243 | elif self.getCompilerVersion(conf) >= (15, 0, 0): |
246 | 244 | # https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode |
247 | 245 | flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1'] |
| 246 | + # Tell libc++ to avoid including transitive headers |
| 247 | + # https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html |
| 248 | + flags['DEFINES'] += ['_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1'] |
248 | 249 | return flags |
249 | 250 |
|
250 | 251 | def getOptimizedFlags(self, conf): |
|
0 commit comments