diff options
author | Daniel Schulte <trilader@schroedingers-bit.net> | 2018-04-11 23:14:32 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-04-13 01:05:25 +0000 |
commit | 57654bf36784c771fb16d90fd39ed58849d19564 (patch) | |
tree | 2169f46dd3e138789f55e32dc708c1ff72555e70 /mesonbuild/compilers | |
parent | 7806175c218d079bd2b608f96a902c6fcd17334d (diff) | |
download | meson-57654bf36784c771fb16d90fd39ed58849d19564.zip meson-57654bf36784c771fb16d90fd39ed58849d19564.tar.gz meson-57654bf36784c771fb16d90fd39ed58849d19564.tar.bz2 |
Deduplicate dependencies resolved to absolute paths
If paths are absolute the order of search directories is not relevant as the path is already resolved.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index a28a225..69ab6ef 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -526,15 +526,22 @@ class CompilerArgs(list): def append_direct(self, arg): ''' Append the specified argument without any reordering or de-dup + except for absolute paths where the order of include search directories + is not relevant ''' - super().append(arg) + if os.path.isabs(arg): + self.append(arg) + else: + super().append(arg) def extend_direct(self, iterable): ''' Extend using the elements in the specified iterable without any - reordering or de-dup + reordering or de-dup except for absolute paths where the order of + include search directories is not relevant ''' - super().extend(iterable) + for elem in iterable: + self.append_direct(elem) def __add__(self, args): new = CompilerArgs(self, self.compiler) |