diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-01-21 11:15:14 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-01-27 23:42:22 +0530 |
commit | dbcbf19ecea9d07d264dbbc1cd87ab22393be8a7 (patch) | |
tree | e00d94bf17cb98e7b61dab6afca8b1bd65cb6fa8 /mesonbuild/backend/vs2010backend.py | |
parent | 0e078adf5a7d47d5ad168f75e39d4a044032b197 (diff) | |
download | meson-dbcbf19ecea9d07d264dbbc1cd87ab22393be8a7.zip meson-dbcbf19ecea9d07d264dbbc1cd87ab22393be8a7.tar.gz meson-dbcbf19ecea9d07d264dbbc1cd87ab22393be8a7.tar.bz2 |
compilers: New class CompilerArgs derived from list()
The purpose of this class is to make it possible to sanely generate
compiler command-lines by ensuring that new arguments appended or added
to a list of arguments properly override previous arguments.
For instance:
>>> a = CompilerArgs(['-Lfoo', '-DBAR'])
>>> a += ['-Lgah', '-DTAZ']
>>> print(a)
['-Lgah', '-Lfoo', '-DBAR', '-DTAZ']
Arguments will be de-duped if it is safe to do so. Currently, this is
only done for -I and -L arguments (previous occurances are removed when
a new one is added) and arguments that once added cannot be overriden
such as -pipe are removed completely.
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 61f755b..31a4c0e 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -687,14 +687,14 @@ class Vs2010Backend(backends.Backend): file_args[l] += args for l, args in target.extra_args.items(): if l in file_args: - file_args[l] += compiler.unix_compile_flags_to_native(args) + file_args[l] += compiler.unix_args_to_native(args) for l, comp in target.compilers.items(): if l in file_args: file_args[l] += comp.get_option_compile_args(self.environment.coredata.compiler_options) for d in target.get_external_deps(): # Cflags required by external deps might have UNIX-specific flags, # so filter them out if needed - d_compile_args = compiler.unix_compile_flags_to_native(d.get_compile_args()) + d_compile_args = compiler.unix_args_to_native(d.get_compile_args()) for arg in d_compile_args: if arg.startswith(('-D', '/D')): define = arg[2:] @@ -793,7 +793,7 @@ class Vs2010Backend(backends.Backend): if isinstance(d, build.StaticLibrary): for dep in d.get_external_deps(): extra_link_args += dep.get_link_args() - extra_link_args = compiler.unix_link_flags_to_native(extra_link_args) + extra_link_args = compiler.unix_args_to_native(extra_link_args) (additional_libpaths, additional_links, extra_link_args) = self.split_link_args(extra_link_args) if len(extra_link_args) > 0: extra_link_args.append('%(AdditionalOptions)') |