Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost: always treat include dirs as system includes #8657

Open
wberrier opened this issue Apr 14, 2021 · 0 comments
Open

boost: always treat include dirs as system includes #8657

wberrier opened this issue Apr 14, 2021 · 0 comments

Comments

@wberrier
Copy link
Contributor

Describe the bug
The boost dependency allows the user to specify a boost specific include dir. Builds fail since these includes are not treated as a "system" include.

To Reproduce

Boost_dep = dependency('Boost', modules : [                                                                                                                                                    
  'locale',                                                                                                                                                                                    
  'log',                                                                                                                                                                                       
  'filesystem',                                                                                                                                                                                
  'iostreams',                                                                                                                                                                                 
  'regex',                                                                                                                                                                                     
  'program_options',                                                                                                                                                                           
  'system',                                                                                                                                                                                    
  'thread',                                                                                                                                                                                    
])                                                                                                                                                                                             

Expected behavior
Custom boost include directories should always be treated as system dirs

system parameters

  • native build
  • Centos 7.9
  • Python 3.6.8
  • Meson 0.57.2
  • Ninja 1.10.2
$ /opt/rh/devtoolset-7/root/usr/bin/gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

$ rpm -qi boost169-devel # from epel
Name        : boost169-devel

Where:

export BOOST_INCLUDEDIR=/usr/include/boost169
export BOOST_LIBRARYDIR=/usr/lib64

/usr/lib64/boost169 exists, but the dependency fails to find the boost libraries in there, because it's a bunch of .so symlinks to files in /usr/lib64.

Compiling against boost as installed this way uses -I for the include dirs, spurring a bunch of warnings as errors.

I can use "include_type = 'system'" when declaring the boost dependency, but it seems like this should always be done and every boost dependency usage shouldn't need to specify this.

This works, although I'm not sure it's the "proper" way to achieve this default:

diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
index 8fb258e..88b9347 100644
--- a/mesonbuild/dependencies/boost.py
+++ b/mesonbuild/dependencies/boost.py
@@ -347,6 +347,8 @@ class BoostDependency(ExternalDependency):
         assert isinstance(buildtype, str)
         self.debug = buildtype.startswith('debug')
         self.multithreading = kwargs.get('threading', 'multi') == 'multi'
+        # Always treat boost includes as system includes
+        self.include_type = 'system'
 
         self.boost_root = None  # type: T.Optional[Path]
         self.explicit_static = 'static' in kwargs

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant