aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/build_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r--python/servo/build_commands.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 4630c9a9dbf..60684e02c27 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -10,6 +10,7 @@
from __future__ import print_function, unicode_literals
import datetime
+import locale
import os
import os.path as path
import platform
@@ -318,6 +319,16 @@ class MachCommands(CommandBase):
"lib", "pkgconfig"
)
+ if 'windows' in host:
+ process = subprocess.Popen('("%s" %s > nul) && "python" -c "import os; print(repr(os.environ))"' %
+ (os.path.join(vs_dirs['vcdir'], "Auxiliary", "Build", "vcvarsall.bat"), "x64"),
+ stdout=subprocess.PIPE, shell=True)
+ stdout, _ = process.communicate()
+ exitcode = process.wait()
+ encoding = locale.getpreferredencoding() # See https://stackoverflow.com/a/9228117
+ if exitcode == 0:
+ os.environ.update(eval(stdout.decode(encoding)))
+
# Ensure that GStreamer libraries are accessible when linking.
if 'windows' in target_triple:
gst_root = gstreamer_root(target_triple, env)