# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

declare_args() {
  # Path to Visual Studio. If empty, the default is used which is to use the
  # automatic toolchain in depot_tools. If set, you must also set the
  # visual_studio_version, visual_studio_runtime_dirs and windows_sdk_version.
  visual_studio_path = ""

  # Version of Visual Studio pointed to by the visual_studio_path.
  visual_studio_version = ""

  # Path to Visual Studio runtime libraries.
  visual_studio_runtime_dirs = ""

  # Full path to the Windows SDK, not including a backslash at the end.
  # This value is the default location, override if you have a different
  # installation location.
  windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"

  # Version of the Windows SDK pointed to by the windows_sdk_path.
  windows_sdk_version = ""
}

if (visual_studio_path == "") {
  toolchain_data =
      exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
  visual_studio_path = toolchain_data.vs_path
  windows_sdk_version = toolchain_data.sdk_version
  windows_sdk_path = toolchain_data.sdk_path
  visual_studio_version = toolchain_data.vs_version
  visual_studio_runtime_dirs = toolchain_data.runtime_dirs
} else {
  assert(visual_studio_version != "",
         "You must set the visual_studio_version if you set the path")
  assert(visual_studio_runtime_dirs != "",
         "You must set the visual_studio_runtime_dirs if you set the visual " +
         "studio path")
  assert(windows_sdk_version != "",
         "You must set the windows_sdk_version if you set the path")
}