Skip to content

Commit

Permalink
build: tell libc++ to avoid including transitive headers
Browse files Browse the repository at this point in the history
And apply BOOST_*_NO_DEPRECATED to debug builds only

Change-Id: Ic65c7ceae07ab6ecd3b3f7322b68f817a41f7716
  • Loading branch information
Pesa committed Feb 28, 2024
1 parent 152874a commit 936205d
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 29 deletions.
2 changes: 0 additions & 2 deletions .jenkins.d/10-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ fi
./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
./waf --color=yes build

# (tests will be run against the debug version)

# Install
sudo ./waf --color=yes install
3 changes: 0 additions & 3 deletions .waf-tools/boost.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python
# encoding: utf-8
#
# partially based on boost.py written by Gernot Vormayr
# written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008
# modified by Bjoern Michaelsen, 2008
Expand Down
2 changes: 0 additions & 2 deletions .waf-tools/coverage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

from waflib import TaskGen

def options(opt):
Expand Down
13 changes: 7 additions & 6 deletions .waf-tools/default-compiler-flags.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

import platform
from waflib import Configure, Logs, Utils

Expand Down Expand Up @@ -128,16 +126,16 @@ def getCompilerVersion(self, conf):

def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}

def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
return {
'CXXFLAGS': [],
'LINKFLAGS': [],
'DEFINES': ['BOOST_FILESYSTEM_NO_DEPRECATED'],
}

def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}

def getOptimizedFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']}
Expand Down Expand Up @@ -245,6 +243,9 @@ def getDebugFlags(self, conf):
elif self.getCompilerVersion(conf) >= (15, 0, 0):
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
# Tell libc++ to avoid including transitive headers
# https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html
flags['DEFINES'] += ['_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1']
return flags

def getOptimizedFlags(self, conf):
Expand Down
4 changes: 1 addition & 3 deletions .waf-tools/dependency-checker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# encoding: utf-8

from waflib import Options, Logs
from waflib import Options
from waflib.Configure import conf

def addDependencyOptions(self, opt, name, extraHelp=''):
Expand Down
3 changes: 0 additions & 3 deletions .waf-tools/doxygen.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#! /usr/bin/env python
# encoding: UTF-8
# Thomas Nagy 2008-2010 (ita)

"""
Doxygen support
Variables passed to bld():
Expand Down
2 changes: 0 additions & 2 deletions .waf-tools/pch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env python
# encoding: utf-8
# Alexander Afanasyev (UCLA), 2014

"""
Expand Down
2 changes: 1 addition & 1 deletion .waf-tools/sanitizers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Davide Pesavento (LIP6), 2016

def options(opt):
opt.add_option('--with-sanitizer', action='store', default='', dest='sanitizers',
Expand Down
3 changes: 0 additions & 3 deletions .waf-tools/sphinx_build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python
# encoding: utf-8

# inspired by code by Hans-Martin von Gaudecker, 2012

import os
Expand Down
2 changes: 0 additions & 2 deletions .waf-tools/unix-socket.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014-2019, Regents of the University of California
#
# GPL 3.0 license, see the COPYING.md file for more information
Expand Down
2 changes: 0 additions & 2 deletions .waf-tools/websocket.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

from waflib import Options, Logs, Errors, Configure
import re

Expand Down

0 comments on commit 936205d

Please sign in to comment.