aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schneider <nioncode+git@gmail.com>2016-03-13 18:58:41 +0100
committerNicolas Schneider <nioncode+git@gmail.com>2016-03-13 18:58:41 +0100
commite366631e9e310e92d261b9653c35f9a832056039 (patch)
treeb3155b880c4f76e611e9bf20467562ccef0be9f2
parent5503939866fca5c04fee5e1b6a9fd2429a0a464f (diff)
downloadmeson-e366631e9e310e92d261b9653c35f9a832056039.zip
meson-e366631e9e310e92d261b9653c35f9a832056039.tar.gz
meson-e366631e9e310e92d261b9653c35f9a832056039.tar.bz2
don't fail if we don't compile anything (we might just bundle object files)
-rw-r--r--mesonbuild/backend/vs2010backend.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 64a5f98..657f983 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -436,23 +436,25 @@ class Vs2010Backend(backends.Backend):
for l, args in target.extra_args.items():
if l in extra_args:
extra_args[l] += args
- for l in extra_args:
- comp_args = compiler.get_buildtype_args(self.buildtype)
- # 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.
- comp_args += compiler.get_option_compile_args(self.environment.coredata.compiler_options)
- extra_args[l] = comp_args + extra_args[l]
- for d in target.get_external_deps():
- extra_args[l] += d.compile_args
+ general_args = compiler.get_buildtype_args(self.buildtype)
+ # 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.
+ general_args += compiler.get_option_compile_args(self.environment.coredata.compiler_options)
+ for d in target.get_external_deps():
+ general_args += d.compile_args
languages += gen_langs
has_language_specific_args = any(l != extra_args['c'] for l in extra_args.values())
additional_options_set = False
if not has_language_specific_args or len(languages) == 1:
- extra_args = extra_args[languages[0]]
+ if len(languages) == 0:
+ extra_args = []
+ else:
+ extra_args = extra_args[languages[0]]
+ extra_args = general_args + extra_args
if len(extra_args) > 0:
extra_args.append('%(AdditionalOptions)')
ET.SubElement(clconf, "AdditionalOptions").text = ' '.join(extra_args)