aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Natalie <jenatali@microsoft.com>2021-04-10 15:47:37 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2021-04-11 13:18:16 +0300
commite901581edec38eb3b49c2ba528681a957d18a8df (patch)
tree847893b870faa351535a0b040b539c123d943291
parent05489616fb1be217a7d2ca9381aaa971ec23ab91 (diff)
downloadmeson-e901581edec38eb3b49c2ba528681a957d18a8df.zip
meson-e901581edec38eb3b49c2ba528681a957d18a8df.tar.gz
meson-e901581edec38eb3b49c2ba528681a957d18a8df.tar.bz2
VS: Disable MSBuild warnings for always-generated targets
Without this, VS will generate warning MSB8065: Custom build for item "<path>\custom_target.rule" succeeded, but specified output "<path>\outofdate.file" has not been created. This may cause incremental build to work incorrectly.
-rw-r--r--mesonbuild/backend/vs2010backend.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 93b7f78..ee58114 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -577,7 +577,8 @@ class Vs2010Backend(backends.Backend):
ofilenames += [self.nonexistent_file(os.path.join(self.environment.get_scratch_dir(),
'outofdate.file'))]
self.add_custom_build(root, 'custom_target', ' '.join(self.quote_arguments(wrapper_cmd)),
- deps=wrapper_cmd[-1:] + srcs + depend_files, outputs=ofilenames)
+ deps=wrapper_cmd[-1:] + srcs + depend_files, outputs=ofilenames,
+ verify_files=not target.build_always_stale)
ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets')
self.generate_custom_generator_commands(target, root)
self.add_regen_dependency(root)
@@ -1490,7 +1491,7 @@ class Vs2010Backend(backends.Backend):
self.add_regen_dependency(root)
self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname)
- def add_custom_build(self, node, rulename, command, deps=None, outputs=None, msg=None):
+ def add_custom_build(self, node, rulename, command, deps=None, outputs=None, msg=None, verify_files=True):
igroup = ET.SubElement(node, 'ItemGroup')
rulefile = os.path.join(self.environment.get_scratch_dir(), rulename + '.rule')
if not os.path.exists(rulefile):
@@ -1500,6 +1501,8 @@ class Vs2010Backend(backends.Backend):
if msg:
message = ET.SubElement(custombuild, 'Message')
message.text = msg
+ if not verify_files:
+ ET.SubElement(custombuild, 'VerifyInputsAndOutputsExist').text = 'false'
cmd_templ = '''setlocal
%s
if %%errorlevel%% neq 0 goto :cmEnd