diff options
author | David Robillard <d@drobilla.net> | 2019-03-16 22:03:16 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-03-17 10:42:22 +0100 |
commit | f4259ee456f46f17eee496702471bb8f6f4ef39c (patch) | |
tree | bb80716d575996e203ca174cb50516aea93197ee /extras | |
parent | 927b60820227bcee5bf9c98f8c4dd98c5f0bc74e (diff) | |
download | autowaf-f4259ee456f46f17eee496702471bb8f6f4ef39c.tar.gz autowaf-f4259ee456f46f17eee496702471bb8f6f4ef39c.tar.bz2 autowaf-f4259ee456f46f17eee496702471bb8f6f4ef39c.zip |
Reduce system include path noise
Diffstat (limited to 'extras')
-rw-r--r-- | extras/autowaf.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/extras/autowaf.py b/extras/autowaf.py index 7ea26da..bad4f47 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -103,6 +103,7 @@ class ConfigureContext(Configure.ConfigurationContext): super(ConfigureContext, self).__init__(**kwargs) self.run_env = ConfigSet.ConfigSet() + self.system_include_paths = set() def pre_recurse(self, node): display_header('Configuring %s' % node.parent.srcpath()) @@ -110,6 +111,12 @@ class ConfigureContext(Configure.ConfigurationContext): def store(self): self.env.AUTOWAF_RUN_ENV = self.run_env.get_merged_dict() + for path in sorted(self.system_include_paths): + if 'COMPILER_CC' in self.env: + self.env.append_value('CFLAGS', ['-isystem', path]) + if 'COMPILER_CXX' in self.env: + self.env.append_value('CXXFLAGS', ['-isystem', path]) + super(ConfigureContext, self).store() def build_path(self, path='.'): @@ -200,14 +207,8 @@ def check_pkg(conf, name, **args): conf.env[var_name] = CheckType.OPTIONAL if not conf.env.MSVC_COMPILER and 'system' in args and args['system']: - includes = conf.env['INCLUDES_' + nameify(args['uselib_store'])] - for path in includes: - if 'COMPILER_CC' in conf.env: - conf.env.append_value('CFLAGS', ['-isystem', path]) - if 'COMPILER_CXX' in conf.env: - conf.env.append_value('CXXFLAGS', ['-isystem', path]) - - conf.env.append_value('CXXFLAGS', ['-isystem', '/usr/local/include']) + conf.system_include_paths.update( + conf.env['INCLUDES_' + nameify(args['uselib_store'])]) def normpath(path): if sys.platform == 'win32': |