aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib/vsenv.py
AgeCommit message (Collapse)AuthorFilesLines
2022-02-16flake8: use plain strings instead of f-strings when no variables usedEli Schwartz1-1/+1
2022-02-03Remove unnecessary check during VS activationNazar Mokrynskyi1-2/+0
2022-01-16Add a test for the --vsenv meson setup optionNirbheek Chauhan1-9/+10
The tests and the unittests both unconditionally call setup_vsenv() because all tests are run using the backend commands directly: ninja, msbuild, etc. There's no way to undo this vs env setup, so the only way to test that --vsenv works is by: 1. Removing all paths in PATH that provide ninja 2. Changing setup_vsenv(force=True) to forcibly set-up a new vsenv when MESON_FORCE_VSENV_FOR_UNITTEST is set 3. Mock-patching build_command, test_command, install_command to use `meson` instead of `ninja` 4. Asserting that 'Activating VS' is in the output for all commands 5. Ensure that compilation works because ninja is picked up from the vs env. I manually checked that this test actually does fail when the previous commit is reverted.
2022-01-13Search for Visual Studio Express when activating VS envDFOVIT1-0/+4
Visual Studio Express does not come with the 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' workload. This adds a check for the 'Microsoft.VisualStudio.Workload.WDExpress' workload. Non-express versions take precedence over express versions when activating.
2021-10-29Fix "meson compile" not activating vsenvXavier Claessens1-2/+3
setup_vsenv() was not propagating the return value, so build.need_vsenv was always False.
2021-10-20Add support for win-arm64 to MSVCGabor Kertesz1-1/+5
For Windows on Arm win-arm64 platform, the corresponding vcvars is called now.
2021-10-19Fix NamedTemporaryFile file reopen issue on Win #9412Gabor Kertesz1-2/+4
NamedTemporaryFile can't be opened by name on Windows. For Windows the created temporary bat file is now closed before passing to a subprocess, prevented from removal automatically upon close and deleted explicitly upon finish.
2021-10-16Add missing but expected as exception clauseMatthew Brett1-1/+1
The `except` line was missing its `as e` clause. As a result, when erroring out, after not finding a compiler, Meson gives an error ending: ``` File "C:\Users\Matthew\AppData\Roaming\Python\Python39\site-packages\mesonbuild\mesonlib\vsenv.py", line 100, in setup_vsenv mlog.warning('Failed to activate VS environment:', str(e)) ```
2021-10-10Add --vsenv command line option and active VS only when neededXavier Claessens1-0/+100