diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-17 13:48:59 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-18 00:16:45 +0300 |
commit | 1c34707aeeedfe499bf2101253788cb41e970383 (patch) | |
tree | e3c4a73c75f7a636844d571aa5b016842a062457 /mesonbuild/compilers.py | |
parent | 85a263a6708f865bffe77c2fe9bb5e888c466709 (diff) | |
download | meson-1c34707aeeedfe499bf2101253788cb41e970383.zip meson-1c34707aeeedfe499bf2101253788cb41e970383.tar.gz meson-1c34707aeeedfe499bf2101253788cb41e970383.tar.bz2 |
Preserve standalone -D arguments always.
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): |