diff options
author | Andres Freund <andres@anarazel.de> | 2022-09-08 14:52:58 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-09-09 18:37:30 -0400 |
commit | 91206aaeb07c6cc8a7a93b23c968773c5b3a76e2 (patch) | |
tree | 55ce1fb50506cfa88ca65e4c3b473fea882b2ca1 /mesonbuild/backend/vs2010backend.py | |
parent | 1acccc862a85ec7aeacc4598957fecd66b203850 (diff) | |
download | meson-91206aaeb07c6cc8a7a93b23c968773c5b3a76e2.zip meson-91206aaeb07c6cc8a7a93b23c968773c5b3a76e2.tar.gz meson-91206aaeb07c6cc8a7a93b23c968773c5b3a76e2.tar.bz2 |
vs: Fix CustomBuild contents.
%% survived into the output since 038b31e72bc02f0a9b. That failed to fail, at
least in the common cases, because the whole command sequence is unnecessary /
redundant - it appears to come from cmake, which executes multiple commands
within a single CustomBuild element.
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 030ef75..017a509 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -1510,15 +1510,15 @@ class Vs2010Backend(backends.Backend): message.text = msg if not verify_files: ET.SubElement(custombuild, 'VerifyInputsAndOutputsExist').text = 'false' - ET.SubElement(custombuild, 'Command').text = f'''setlocal -{command} -if %%errorlevel%% neq 0 goto :cmEnd -:cmEnd -endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone -:cmErrorLevel -exit /b %%1 -:cmDone -if %%errorlevel%% neq 0 goto :VCEnd''' + + # If a command ever were to change the current directory or set local + # variables this would need to be more complicated, as msbuild by + # default executes all CustomBuilds in a project using the same + # shell. Right now such tasks are all done inside the meson_exe + # wrapper. The trailing newline appears to be necessary to allow + # parallel custom builds to work. + ET.SubElement(custombuild, 'Command').text = f"{command}\n" + if not outputs: # Use a nonexistent file to always consider the target out-of-date. outputs = [self.nonexistent_file(os.path.join(self.environment.get_scratch_dir(), |