diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-18 03:49:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-18 03:49:48 +0300 |
commit | 3bc7651907e81cacb93f2f160b720dc97b958f05 (patch) | |
tree | db8cec8f6e8cb81db425c60cc89da21b1e641f00 /mesonbuild/compilers.py | |
parent | 7c7dc0efde77e395babfe3a082a23e6ceaa31a87 (diff) | |
parent | 1c34707aeeedfe499bf2101253788cb41e970383 (diff) | |
download | meson-3bc7651907e81cacb93f2f160b720dc97b958f05.zip meson-3bc7651907e81cacb93f2f160b720dc97b958f05.tar.gz meson-3bc7651907e81cacb93f2f160b720dc97b958f05.tar.bz2 |
Merge pull request #1951 from mesonbuild/dedupfix
Preserve standalone -D arguments
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r-- | mesonbuild/compilers.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 2b54cc8..6a9ad4f 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -430,6 +430,17 @@ class CompilerArgs(list): to recursively search for symbols in the libraries. This is not needed with other linkers. ''' + + # A standalone argument must never be deduplicated because it is + # defined by what comes _after_ it. Thus dedupping this: + # -D FOO -D BAR + # would yield either + # -D FOO BAR + # or + # FOO -D BAR + # both of which are invalid. + if arg in cls.dedup2_prefixes: + return 0 if arg in cls.dedup2_args or \ arg.startswith(cls.dedup2_prefixes) or \ arg.endswith(cls.dedup2_suffixes): |