forked from timniederhausen/gn-build
/
settings.gni
87 lines (71 loc) · 2.4 KB
/
settings.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
if (is_clang) {
import("//build/toolchain/clang.gni")
}
declare_args() {
# Version of Visual Studio pointed to by the visual_studio_path.
# Use "2013" for Visual Studio 2013.
visual_studio_version = "2013"
# Path to Visual Studio.
visual_studio_path = ""
# 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 = ""
# Value of the _MSC_VER variable.
# see: https://msdn.microsoft.com/en-us/library/b0084kay.aspx
msc_ver = 0
# Value of the _MSC_FULL_VER variable.
# see: https://msdn.microsoft.com/en-us/library/b0084kay.aspx
msc_full_ver = 0
}
assert(visual_studio_version != "",
"You must set visual_studio_version on Windows")
if (visual_studio_path == "") {
visual_studio_path = exec_script("toolchain.py",
[
"get_vs_dir",
visual_studio_version,
],
"trim string")
}
if (is_clang) {
sys_include_prefix = "-imsvc"
_clang_base_path_arg = clang_base_path
} else {
# MSVC doesn't have the concept of system headers.
sys_include_prefix = "/I"
_clang_base_path_arg = ""
}
if (host_os == "win") {
clang_cl = "clang-cl.exe"
} else {
clang_cl = "clang-cl"
}
toolchain_data = exec_script("toolchain.py",
[
"setup_toolchain",
visual_studio_version,
visual_studio_path,
sys_include_prefix,
# Don't use clang_base_path directly, so we can
# skip clang detection if not needed
# (i.e. !is_clang).
_clang_base_path_arg,
],
"scope")
if (windows_sdk_path == "") {
windows_sdk_path = toolchain_data.windows_sdk_path
}
if (msc_ver == 0) {
msc_ver = toolchain_data.msc_ver
}
if (msc_full_ver == 0) {
msc_full_ver = toolchain_data.msc_full_ver
}
if (is_clang) {
win_clang_version = toolchain_data.clang_version
}
# These are hardcoded in toolchain.py
x86_environment_path = "environment.x86"
x64_environment_path = "environment.x64"
# TODO(tim): WinRT