Skip to content

Commit c8ab82e

Browse files
committed
build: don't bother with _LIBCPP_ENABLE_ASSERTIONS
It's a library feature, so the check should be on the libc++ version, not the compiler. But given that it's already deprecated and superseded by the hardening mode in newer versions, let's just drop it altogether. Change-Id: I6eeb5489e4ff6cdd46b22dad451f40b53860ad82
1 parent acfff32 commit c8ab82e

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

.waf-tools/default-compiler-flags.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,14 @@ def getGeneralFlags(self, conf):
242242
def getDebugFlags(self, conf):
243243
flags = super().getDebugFlags(conf)
244244
flags['CXXFLAGS'] += self.__cxxFlags
245-
ccver = get_compiler_ver(conf)
246-
darwin = Utils.unversioned_sys_platform() == 'darwin'
247-
# Enable assertions in libc++
248-
if (darwin and ccver >= (17, 0, 0)) or (not darwin and ccver >= (18, 0, 0)):
245+
flags['DEFINES'] += [
246+
# Enable assertions in libc++
249247
# https://libcxx.llvm.org/Hardening.html
250-
flags['DEFINES'] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE']
251-
elif ccver >= (15, 0, 0):
252-
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
253-
flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
254-
# Tell libc++ to avoid including transitive headers
255-
# https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html
256-
flags['DEFINES'] += ['_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1']
248+
'_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE',
249+
# Disable transitive includes in libc++
250+
# https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html
251+
'_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1',
252+
]
257253
return flags
258254

259255
def getOptimizedFlags(self, conf):

0 commit comments

Comments
 (0)