diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2016-02-23 23:46:34 +0100 |
---|---|---|
committer | Nicolas Schneider <nioncode+git@gmail.com> | 2016-02-23 23:46:34 +0100 |
commit | 78551ae2426f3b6b71721ff495bcb285a153b134 (patch) | |
tree | 23e73151afcaf86c36db2c99ac60047c5f5087c7 | |
parent | 2dcac3862413ef6ebb536aabd91366ac7bd0cca4 (diff) | |
download | meson-78551ae2426f3b6b71721ff495bcb285a153b134.zip meson-78551ae2426f3b6b71721ff495bcb285a153b134.tar.gz meson-78551ae2426f3b6b71721ff495bcb285a153b134.tar.bz2 |
vs2010: do not add generated object files to project
MSBuild automatically includes the output objects of the CustomBuildStep
in the link command. If the objects are additionally added to the project,
they will be put twice on the linker command, which leads to LNK4042
warning.
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 378b1a8..fc241e3 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -493,14 +493,13 @@ class Vs2010Backend(backends.Backend): for s in gen_src: relpath = self.relpath(s, target.subdir) ET.SubElement(inc_src, 'CLCompile', Include=relpath) - if len(objects) + len(gen_objs) > 0: + if len(objects) > 0: + # Do not add gen_objs to project file. Those are automatically used by MSBuild, because they are part of + # the CustomBuildStep Outputs. inc_objs = ET.SubElement(root, 'ItemGroup') for s in objects: relpath = s.rel_to_builddir(proj_to_src_root) ET.SubElement(inc_objs, 'Object', Include=relpath) - for s in gen_objs: - relpath = self.relpath(s, target.subdir) - ET.SubElement(inc_objs, 'Object', Include=relpath) ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') # Reference the regen target. ig = ET.SubElement(root, 'ItemGroup') |