|
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_ASIO_NO_DEPRECATED', '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']}
|
@@ -246,6 +244,9 @@ def getDebugFlags(self, conf):
|
246 | 244 | elif self.getCompilerVersion(conf) >= (15, 0, 0):
|
247 | 245 | # https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
|
248 | 246 | flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
|
| 247 | + # Tell libc++ to avoid including transitive headers |
| 248 | + # https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html |
| 249 | + flags['DEFINES'] += ['_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1'] |
249 | 250 | return flags
|
250 | 251 |
|
251 | 252 | def getOptimizedFlags(self, conf):
|
|
0 commit comments