diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-17 23:26:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 23:26:53 +0300 |
commit | 8ee1e49ae683cbd7eb10da37327062a490cbee70 (patch) | |
tree | e3c4d8560ef9f345c75f14c8543ba59535070c1e /mesonbuild/compilers/compilers.py | |
parent | 3fc1ca8687a5030577ab2ba6449d7028c6a5b884 (diff) | |
parent | bd37afeeea0283dac1051b7d9bedf099252c1d19 (diff) | |
download | meson-8ee1e49ae683cbd7eb10da37327062a490cbee70.zip meson-8ee1e49ae683cbd7eb10da37327062a490cbee70.tar.gz meson-8ee1e49ae683cbd7eb10da37327062a490cbee70.tar.bz2 |
Merge pull request #3353 from xclaesse/has-link-argument
Add has_link_argument() and friends
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 37326d8..a2c6668 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -745,20 +745,15 @@ class Compiler: def get_library_dirs(self): return [] - def has_argument(self, arg, env): - return self.has_multi_arguments([arg], env) - def has_multi_arguments(self, args, env): raise EnvironmentException( 'Language {} does not support has_multi_arguments.'.format( self.get_display_language())) - def get_supported_arguments(self, args, env): - supported_args = [] - for arg in args: - if self.has_argument(arg, env): - supported_args.append(arg) - return supported_args + def has_multi_link_arguments(self, args, env): + raise EnvironmentException( + 'Language {} does not support has_multi_link_arguments.'.format( + self.get_display_language())) def get_cross_extra_flags(self, environment, link): extra_flags = [] @@ -815,7 +810,6 @@ class Compiler: # Construct the compiler command-line commands = CompilerArgs(self) commands.append(srcname) - commands += extra_args commands += self.get_always_args() if mode == 'compile': commands += self.get_compile_only_args() @@ -825,6 +819,10 @@ class Compiler: else: output = self._get_compile_output(tmpdirname, mode) commands += self.get_output_args(output) + # extra_args must be last because it could contain '/link' to + # pass args to VisualStudio's linker. In that case everything + # in the command line after '/link' is given to the linker. + commands += extra_args # Generate full command-line with the exelist commands = self.get_exelist() + commands.to_native() mlog.debug('Running compile:') |