aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/BUILD.gn
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-03-20 16:53:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-21 02:37:06 +0000
commit4e8472c5299b051c7e87481f97d46f5db5a3c98c (patch)
tree6551c82743995f80d16229e3a402fdb80ee4e96a /gn/BUILD.gn
parent0e032be6b25a943ae85f51aaf7309311da7fea44 (diff)
Support vs2017.
Change-Id: Icb333d34705c86f6204a5265b645a2a215e60ad6 Reviewed-on: https://skia-review.googlesource.com/9624 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/BUILD.gn')
-rw-r--r--gn/BUILD.gn52
1 files changed, 45 insertions, 7 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 36c881c5d7..0ee9d39321 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -20,7 +20,7 @@ declare_args() {
}
}
- windk = "C:/Program Files (x86)/Microsoft Visual Studio 14.0"
+ msvc = 2015
extra_cflags = []
extra_cflags_c = []
@@ -30,6 +30,13 @@ declare_args() {
cc_wrapper = ""
malloc = ""
}
+declare_args() {
+ if (msvc == 2015) {
+ windk = "C:/Program Files (x86)/Microsoft Visual Studio 14.0"
+ } else {
+ windk = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional"
+ }
+}
if (host_os == "win") {
python = "python.bat"
@@ -87,11 +94,22 @@ config("default") {
"NOMINMAX",
]
include_dirs = [
+ #2017
+ "$windk/VC/Tools/MSVC/14.10.25017/include",
+
+ #2015
"$windk/VC/include",
# For local builds.
- "$windk/../Windows Kits/10/Include/10.0.10150.0/ucrt",
+ # 2017
+ "$windk/../../../Windows Kits/10/Include/10.0.14393.0/shared",
+ "$windk/../../../Windows Kits/10/Include/10.0.14393.0/ucrt",
+ "$windk/../../../Windows Kits/10/Include/10.0.14393.0/um",
+ "$windk/../../../Windows Kits/10/Include/10.0.14393.0/winrt",
+
+ # 2015
"$windk/../Windows Kits/8.1/Include/shared",
+ "$windk/../Windows Kits/10/Include/10.0.10150.0/ucrt",
"$windk/../Windows Kits/8.1/Include/um",
"$windk/../Windows Kits/8.1/Include/winrt",
@@ -103,6 +121,11 @@ config("default") {
]
lib_dirs = [
# For local builds.
+ # 2017
+ "$windk/../../../Windows Kits/10/Lib/10.0.14393.0/ucrt/$target_cpu",
+ "$windk/../../../Windows Kits/10/Lib/10.0.14393.0/um/$target_cpu",
+
+ #2015
"$windk/../Windows Kits/10/Lib/10.0.10150.0/ucrt/$target_cpu",
"$windk/../Windows Kits/8.1/Lib/winv6.3/um/$target_cpu",
@@ -110,6 +133,11 @@ config("default") {
"$windk/win_sdk/Lib/10.0.14393.0/ucrt/$target_cpu",
"$windk/win_sdk/Lib/10.0.14393.0/um/$target_cpu",
]
+
+ #2017
+ lib_dirs += [ "$windk/VC/Tools/MSVC/14.10.25017/lib/$target_cpu" ]
+
+ #2015
if (target_cpu == "x86") {
lib_dirs += [ "$windk/VC/lib" ]
} else {
@@ -449,11 +477,21 @@ config("executable") {
toolchain("msvc") {
lib_dir_switch = "/LIBPATH:"
- bin = "$windk/VC/bin/amd64"
- env_setup = ""
- if (target_cpu == "x86") {
- bin += "_x86"
- env_setup = "cmd /c $windk/win_sdk/bin/SetEnv.cmd /x86 && "
+ if (msvc == 2015) {
+ bin = "$windk/VC/bin/amd64"
+ env_setup = ""
+ if (target_cpu == "x86") {
+ bin += "_x86"
+ env_setup = "cmd /c $windk/win_sdk/bin/SetEnv.cmd /x86 && "
+ }
+ } else {
+ bin = "$windk/VC/Tools/MSVC/14.10.25017/bin/HostX64/$target_cpu"
+ env_setup = ""
+ if (target_cpu == "x86") {
+ print("Be sure to run")
+ print("$windk/VC/Auxiliary/Build/vcvarsall.bat amd64_x86")
+ print("to set up your environment before running ninja.")
+ }
}
tool("asm") {