diff options
author | Vili Väinölä <vilivainola@gmail.com> | 2020-09-13 07:56:24 +0300 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-09-13 06:27:00 +0000 |
commit | 416b47c9159a507d4059a9dbdc230f87ed6dbac2 (patch) | |
tree | db20522d2c2d4fe8d448402801040679a10ef53d | |
parent | 25ad10e501ba11a017a63404756a1e796427b118 (diff) | |
download | meson-416b47c9159a507d4059a9dbdc230f87ed6dbac2.zip meson-416b47c9159a507d4059a9dbdc230f87ed6dbac2.tar.gz meson-416b47c9159a507d4059a9dbdc230f87ed6dbac2.tar.bz2 |
Remove redudant checks in vs2010 backend
- Implicit include dirs was checked twice in a row
- Add define only if it does not yet exist rather than remove.
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 4e95c80..a9896a1 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -966,9 +966,7 @@ class Vs2010Backend(backends.Backend): t_inc_dirs = [self.relpath(self.get_target_private_dir(target), self.get_target_dir(target))] if target.implicit_include_directories: - t_inc_dirs += ['.'] - if target.implicit_include_directories: - t_inc_dirs += [proj_to_src_dir] + t_inc_dirs += ['.', proj_to_src_dir] args += ['-I' + arg for arg in t_inc_dirs] # Split preprocessor defines and include directories out of the list of @@ -983,9 +981,8 @@ class Vs2010Backend(backends.Backend): else: define = arg[2:] # De-dup - if define in file_defines[l]: - file_defines[l].remove(define) - file_defines[l].append(define) + if define not in file_defines[l]: + file_defines[l].append(define) elif arg.startswith(('-I', '/I')) or arg == '%(AdditionalIncludeDirectories)': file_args[l].remove(arg) # Don't escape the marker |