Auto merge of #23667 - saschanaz:msbuild2019, r=jdm

Support VS Build Tools 2019

<!-- Please describe your changes on the following line: -->

This detects VS Build Tools 2019 installation, which optionally provides VC2017 to be compatible with Servo.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23666

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23667)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-06-30 08:50:50 -04:00 committed by GitHub
commit 3e446ef718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -803,12 +803,12 @@ def package_msvc_dlls(servo_exe_dir, target):
is_vs14 = True if os.path.isfile(vs14_vcvars) or vs_version == "14.0" else False is_vs14 = True if os.path.isfile(vs14_vcvars) or vs_version == "14.0" else False
if is_vs14: if is_vs14:
msvc_redist_dir = path.join(vc_dir, "redist", vs_platform, "Microsoft.VC140.CRT") msvc_redist_dir = path.join(vc_dir, "redist", vs_platform, "Microsoft.VC140.CRT")
elif vs_version == "15.0": elif vs_version in ("15.0", "16.0"):
redist_dir = path.join(vc_dir, "Redist", "MSVC") redist_dir = path.join(vc_dir, "Redist", "MSVC")
if os.path.isdir(redist_dir): if os.path.isdir(redist_dir):
for p in os.listdir(redist_dir)[::-1]: for p in os.listdir(redist_dir)[::-1]:
redist_path = path.join(redist_dir, p) redist_path = path.join(redist_dir, p)
for v in ["VC141", "VC150"]: for v in ["VC141", "VC150", "VC160"]:
# there are two possible paths # there are two possible paths
# `x64\Microsoft.VC*.CRT` or `onecore\x64\Microsoft.VC*.CRT` # `x64\Microsoft.VC*.CRT` or `onecore\x64\Microsoft.VC*.CRT`
redist1 = path.join(redist_path, vs_platform, "Microsoft.{}.CRT".format(v)) redist1 = path.join(redist_path, vs_platform, "Microsoft.{}.CRT".format(v))