blob: 95cd9472abe1ea4d0f5fbcb317ecabf71709831e (
plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Should only be running on Windows.
assert(is_win)
# Setup the Visual Studio state.
#
# Its argument is the location to write the environment files.
# It will write "environment.x86" and "environment.x64" to this directory,
# and return a list to us.
#
# The list contains the include path as its only element. (I'm expecting to
# add more so it's currently a list inside a list.)
#exec_script("get_msvc_config.py",
# [relative_root_output_dir],
# "value")
# This will save the environment block and and copy the gyp-win-tool to the
# build directory. We pass in the source file of the win tool.
gyp_win_tool_source =
rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".", root_build_dir)
exec_script("setup_toolchain.py", [ gyp_win_tool_source ], "value")
# 32-bit toolchain -------------------------------------------------------------
toolchain("32") {
# Make these apply to all tools below.
lib_prefix = ""
lib_dir_prefix="/LIBPATH:"
tool("cc") {
command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname"
description = "CC \$out"
rspfile = "\$out.rsp"
rspfile_content = "\$defines \$includes \$cflags \$cflags_c"
deps = "msvc"
}
tool("cxx") {
command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname"
description = "CXX \$out"
rspfile = "\$out.rsp"
rspfile_content = "\$defines \$includes \$cflags \$cflags_cc"
deps = "msvc"
}
#tool("idl") {
# command = $python_path gyp-win-tool midl-wrapper environment.x86 \$outdir \$tlb \$h \$dlldata \$iid \$
# \$proxy \$in \$idlflags
# description = IDL \$in
#}
tool("rc") {
command = "$python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$defines \$includes \$rcflags /fo\$out \$in"
description = "RC \$in"
}
#tool("asm") {
# command = $python_path gyp-win-tool asm-wrapper environment.x86 ml.exe \$defines \$includes /c /Fo \$
# \$out \$in
# description = ASM \$in
#}
tool("alink") {
command = "$python_path gyp-win-tool link-wrapper environment.x86 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp"
description = "LIB \$out"
rspfile = "\$out.rsp"
rspfile_content = "\$in_newline \$libflags"
}
#tool("solink_embed_inc") {
# command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
# /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
# manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
# $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
# -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc environment.x86 \$dll.manifest \$
# \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$
# \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$
# \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.res
# description = LINK_EMBED_INC(DLL) \$dll
# restat = 1
# rspfile = \$dll.rsp
# rspfile_content = \$libs \$in_newline \$ldflags
#}
#tool("solink_module_embed_inc") {
# command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
# /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
# manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
# $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
# -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc environment.x86 \$dll.manifest \$
# \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$
# \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$
# \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.res
# description = LINK_EMBED_INC(DLL) \$dll
# restat = 1
# rspfile = \$dll.rsp
# rspfile_content = \$libs \$in_newline \$ldflags
#}
#rule link_embed_inc
# command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out \$
# /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c \$
# if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$
# manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest && \$
# $python_path gyp-win-tool manifest-to-rc environment.x86 \$out.manifest \$out.manifest.rc 1 && \$
# $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$out.manifest.rc && \$
# $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out /PDB:\$out.pdb \$
# @\$out.rsp \$out.manifest.res
# description = LINK_EMBED_INC \$out
# rspfile = \$out.rsp
# rspfile_content = \$in_newline \$libs \$ldflags
#rule solink_embed
# command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
# /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
# manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
# $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
# -outputresource:\$dll;2
# description = LINK_EMBED(DLL) \$dll
# restat = 1
# rspfile = \$dll.rsp
# rspfile_content = \$libs \$in_newline \$ldflags
#rule solink_module_embed
# command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
# /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
# manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
# $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
# -outputresource:\$dll;2
# description = LINK_EMBED(DLL) \$dll
# restat = 1
# rspfile = \$dll.rsp
# rspfile_content = \$libs \$in_newline \$ldflags
#rule link_embed
# command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out \$
# /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c \$
# if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$
# manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -outputresource:\$out;1
# description = LINK_EMBED \$out
# rspfile = \$out.rsp
# rspfile_content = \$in_newline \$libs \$ldflags
tool("solink") {
command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest"
description = "LINK(DLL) \$dll"
restat = "1"
rspfile = "\$dll.rsp"
rspfile_content = "\$libs \$in_newline \$ldflags"
}
tool("link") {
command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest"
description = "LINK \$out"
rspfile = "\$out.rsp"
rspfile_content = "\$in_newline \$libs \$ldflags"
}
tool("stamp") {
command = "$python_path gyp-win-tool stamp \$out"
description = "STAMP \$out"
}
tool("copy") {
command = "$python_path gyp-win-tool recursive-mirror \$in \$out"
description = "COPY \$in \$out"
}
}
# 64-bit toolchain -------------------------------------------------------------
toolchain("64") {
}
|