servo: Merge #14346 - Use MSVC toolchain if PLATFORM is defined (from mati865:master); r=UK992,larsberg

<!-- Please describe your changes on the following line: -->
`VSInstallDir` exists only when Visual Studio is installed.
`VS140COMNTOOLS` is defined by installing either Visual Studio or [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)

It will allow to build MSVC based Servo without having to install whole Visual Studio (few GiB).

EDIT: Another (maybe cleaner) solution would be reverting 63ec96a57d

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because `VS140COMNTOOLS` variable is already used in [mach.bat](https://github.com/servo/servo/blob/master/mach.bat)

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 7f2da7483b2d0c71a227fb8707eea00b0602d977
This commit is contained in:
mati865 2016-12-28 07:37:45 -08:00
parent 02804e87c7
commit eb3464f50e
2 changed files with 4 additions and 5 deletions

View File

@ -35,9 +35,6 @@ branches:
only:
- master
platform:
- x64
cache:
- .servo -> rust-nightly-date, cargo-commit-hash
- .cargo -> rust-nightly-date, cargo-commit-hash

View File

@ -110,10 +110,12 @@ def host_triple():
os_type = "linux-androideabi"
elif os_type == "windows":
# If we are in a Visual Studio environment, use msvc
if os.getenv("VSInstallDir") is not None:
if os.getenv("PLATFORM") is not None:
os_type = "pc-windows-msvc"
else:
elif os.getenv("MSYSTEM") is not None:
os_type = "pc-windows-gnu"
else:
os_type = "unknown"
elif os_type.startswith("mingw64_nt-") or os_type.startswith("cygwin_nt-"):
os_type = "pc-windows-gnu"
elif os_type == "freebsd":