diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-08-19 18:38:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-19 18:38:36 -0500 |
commit | 28767cdb6725be83dcf50b9682a49de01229a287 (patch) | |
tree | 18c83ba3852adedd071f29b7fca5fdfd9a0661ca /python/servo | |
parent | bf8b7ba6b06729031886db285d54045a4b61ef0e (diff) | |
parent | 0510b4a198f752c6c554a1dfc223b1f83ae3083b (diff) | |
download | servo-28767cdb6725be83dcf50b9682a49de01229a287.tar.gz servo-28767cdb6725be83dcf50b9682a49de01229a287.zip |
Auto merge of #12922 - upsuper:msvc-platform, r=metajack
Check PLATFORM for proper toolchain when use msvc
<!-- Please describe your changes on the following line: -->
Currently, x86_64 toolchain would always pick the amd64 MSVC linker, which will fail to link when it runs in an environment configured for building x86 program (has `PLATFORM=X86` in environment variable).
This commit picks the proper host triple according to the environment variable when using the MSVC backend.
---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because build system only
<!-- 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/12922)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/command_base.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 556f1e14e59..4b9f22fc376 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -104,7 +104,16 @@ def host_triple(): os_type = "unknown" cpu_type = platform.machine().lower() - if cpu_type in ["i386", "i486", "i686", "i768", "x86"]: + if os_type.endswith("-msvc"): + # vcvars*.bat should set it properly + platform_env = os.environ.get("PLATFORM") + if platform_env == "X86": + cpu_type = "i686" + elif platform_env == "X64": + cpu_type = "x86_64" + else: + cpu_type = "unknown" + elif cpu_type in ["i386", "i486", "i686", "i768", "x86"]: cpu_type = "i686" elif cpu_type in ["x86_64", "x86-64", "x64", "amd64"]: cpu_type = "x86_64" |