1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-07 07:02:53 +03:00

Add support to pass vcvarsall path on the command line

Summary: On Windows "--vcvars-path" can be passed to point to the toolchain we want to use.

Reviewed By: wez

Differential Revision: D15926044

fbshipit-source-id: 2b0cde793f7c7f8473b78afde8794640bae351f3
This commit is contained in:
Puneet Kaushik
2019-07-02 11:34:53 -07:00
committed by Facebook Github Bot
parent 6ae7d47317
commit 62109423be
3 changed files with 35 additions and 20 deletions

View File

@@ -49,30 +49,13 @@ class BuilderBase(object):
env = self.env
if self.build_opts.is_windows():
# On Windows, the compiler is not available in the PATH by default
# so we need to run the vcvarsall script to populate the environment.
# We use a glob to find some version of this script as deployed with
# Visual Studio 2017. This logic will need updating when we switch
# to a newer compiler.
vcvarsall = glob.glob(
os.path.join(
os.environ["ProgramFiles(x86)"],
"Microsoft Visual Studio",
"2017",
"*",
"VC",
"Auxiliary",
"Build",
"vcvarsall.bat",
)
)
if len(vcvarsall) > 0:
vcvarsall = self.build_opts.get_vcvars_path()
if vcvarsall is not None:
# Since it sets rather a large number of variables we mildly abuse
# the cmd quoting rules to assemble a command that calls the script
# to prep the environment and then triggers the actual command that
# we wanted to run.
cmd = [vcvarsall[0], "amd64", "&&"] + cmd
cmd = [vcvarsall, "amd64", "&&"] + cmd
run_cmd(cmd=cmd, env=env, cwd=cwd or self.build_dir)