Chromium Code Reviews| Index: build/toolchain/win/setup_toolchain.py |
| diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py |
| index 4e79cd904eea00303f17b15380ba7b807ebda02b..86774148393d715828de5a1464cdd77cf4cb2219 100644 |
| --- a/build/toolchain/win/setup_toolchain.py |
| +++ b/build/toolchain/win/setup_toolchain.py |
| @@ -55,6 +55,18 @@ def _ExtractImportantEnvironment(output_of_set): |
| return env |
| +def _DetectVisualStudioPath(): |
| + """Return path to the GYP_MSVS_VERSION of Visual Studio |
|
scottmg
2016/01/05 23:30:32
Trailing . on comments.
Daniel Bratell
2016/01/07 16:10:48
Done.
|
| + """ |
| + |
| + # Use the code in build/vs_toolchain.py to avoid duplicating code. |
| + this_dir = os.path.dirname(__file__) |
|
scottmg
2016/01/05 23:30:32
I think there's some rule about getting this befor
Daniel Bratell
2016/01/07 16:10:48
Done.
|
| + chromium_dir = os.path.abspath(os.path.join(this_dir, '..', '..', '..')) |
| + sys.path.append(os.path.join(chromium_dir, 'build')) |
| + import vs_toolchain |
| + return vs_toolchain.DetectVisualStudioPath() |
| + |
| + |
| def _SetupScript(target_cpu, sdk_dir): |
| """Returns a command (with arguments) to be used to set up the |
| environment.""" |
| @@ -66,9 +78,9 @@ def _SetupScript(target_cpu, sdk_dir): |
| return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')), |
| '/' + target_cpu] |
| else: |
| + if not 'GYP_MSVS_OVERRIDE_PATH' in os.environ: |
|
scottmg
2016/01/05 23:30:32
if 'GYP_MSVS_OVERRIDE_PATH' not in os.environ
Daniel Bratell
2016/01/07 16:10:48
Done.
|
| + os.environ['GYP_MSVS_OVERRIDE_PATH'] = _DetectVisualStudioPath() |
| # We only support x64-hosted tools. |
| - # TODO(scottmg|dpranke): Non-depot_tools toolchain: need to get Visual |
| - # Studio install location from registry. |
| return [os.path.normpath(os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'], |
| 'VC/vcvarsall.bat')), |
| 'amd64_x86' if target_cpu == 'x86' else 'amd64'] |