aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2016-08-18 21:19:27 +1000
committerXidorn Quan <me@upsuper.org>2016-08-18 21:19:27 +1000
commit0510b4a198f752c6c554a1dfc223b1f83ae3083b (patch)
treece3e91386197309a2d44d95cb1e2b0669dd8353e /python/servo/command_base.py
parent4e7c689a815198a51f96fdcac48a15eabf2157c0 (diff)
downloadservo-0510b4a198f752c6c554a1dfc223b1f83ae3083b.tar.gz
servo-0510b4a198f752c6c554a1dfc223b1f83ae3083b.zip
Check PLATFORM for proper toolchain when use msvc
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py11
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"