diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-06 17:33:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-06 17:33:12 +0300 |
commit | 51fef880b6a12e82955d5b93df7ffed0ae2f1478 (patch) | |
tree | 327575ae53cc7e25389ee6af1a02861c8296b9ad /mesonbuild/compilers/compilers.py | |
parent | 5bbea6be05c9740aedcd7f170c24a6b2c098cd01 (diff) | |
parent | 47e20b3004b41261c01b1a46898252924f031f1d (diff) | |
download | meson-51fef880b6a12e82955d5b93df7ffed0ae2f1478.zip meson-51fef880b6a12e82955d5b93df7ffed0ae2f1478.tar.gz meson-51fef880b6a12e82955d5b93df7ffed0ae2f1478.tar.bz2 |
Merge pull request #5953 from mensinda/isystem
Add is_system to dependency
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index b79fa41..ac74fc3 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -420,7 +420,7 @@ class CompilerArgs(list): # Arg prefixes that override by prepending instead of appending prepend_prefixes = ('-I', '-L') # Arg prefixes and args that must be de-duped by returning 2 - dedup2_prefixes = ('-I', '-L', '-D', '-U') + dedup2_prefixes = ('-I', '-isystem', '-L', '-D', '-U') dedup2_suffixes = () dedup2_args = () # Arg prefixes and args that must be de-duped by returning 1 @@ -548,6 +548,22 @@ class CompilerArgs(list): # Last occurrence of a library new.insert(group_end + 1, '-Wl,--end-group') new.insert(group_start, '-Wl,--start-group') + # Remove system/default include paths added with -isystem + if hasattr(self.compiler, 'get_default_include_dirs'): + default_dirs = self.compiler.get_default_include_dirs() + bad_idx_list = [] + for i, each in enumerate(new): + # Remove the -isystem and the path if the path is a dafault path + if (each == '-isystem' and + i < (len(new) - 1) and + new[i + 1] in default_dirs): + bad_idx_list += [i, i + 1] + elif each.startswith('-isystem=') and each[9:] in default_dirs: + bad_idx_list += [i] + elif each.startswith('-isystem') and each[8:] in default_dirs: + bad_idx_list += [i] + for i in reversed(bad_idx_list): + new.pop(i) return self.compiler.unix_args_to_native(new) def append_direct(self, arg): |