diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-11-07 00:04:04 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-11-07 00:04:04 +0200 |
commit | 8e24e9e09a17f4a944e827503b50c1b5282c1fc6 (patch) | |
tree | 42adabc6009aaf0753401987a9b4c46ee239ef5e | |
parent | eceedc0d2942998c57abb588837c44e37370f2dc (diff) | |
download | meson-8e24e9e09a17f4a944e827503b50c1b5282c1fc6.zip meson-8e24e9e09a17f4a944e827503b50c1b5282c1fc6.tar.gz meson-8e24e9e09a17f4a944e827503b50c1b5282c1fc6.tar.bz2 |
Use all the extra flags in vs2010 projects.
-rw-r--r-- | vs2010backend.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vs2010backend.py b/vs2010backend.py index 8084ba5..f785b96 100644 --- a/vs2010backend.py +++ b/vs2010backend.py @@ -382,12 +382,21 @@ class Vs2010Backend(backends.Backend): # SUCKS, VS can not handle per-language type flags, so just use # them all. extra_args += compiler.get_buildtype_args(self.buildtype) + for l in self.environment.coredata.external_args.values(): + for a in l: + extra_args.append(a) for l in self.build.global_args.values(): for a in l: extra_args.append(a) for l in target.extra_args.values(): for a in l: extra_args.append(a) + # FIXME all the internal flags of VS (optimization etc) are represented + # by their own XML elements. In theory we should split all flags to those + # that have an XML element and those that don't and serialise them + # properly. This is a crapton of work for no real gain, so just dump them + # here. + extra_args = compiler.get_option_compile_args(self.environment.coredata.compiler_options) if len(extra_args) > 0: extra_args.append('%(AdditionalOptions)') ET.SubElement(clconf, "AdditionalOptions").text = ' '.join(extra_args) @@ -413,6 +422,19 @@ class Vs2010Backend(backends.Backend): resourcecompile = ET.SubElement(compiles, 'ResourceCompile') ET.SubElement(resourcecompile, 'PreprocessorDefinitions') link = ET.SubElement(compiles, 'Link') + # Put all language args here, too. + extra_link_args = compiler.get_option_link_args(self.environment.coredata.compiler_options) + extra_link_args += compiler.get_buildtype_linker_args(self.buildtype) + for l in self.environment.coredata.external_link_args.values(): + for a in l: + extra_link_args.append(a) + for l in target.link_args: + for a in l: + extra_link_args.append(a) + if len(extra_args) > 0: + extra_args.append('%(AdditionalOptions)') + ET.SubElement(link, "AdditionalOptions").text = ' '.join(extra_args) + additional_links = [] for t in target.link_targets: lobj = self.build.targets[t.get_id()] |