1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # Should only be running on Windows.
8 # Setup the Visual Studio state.
10 # Its argument is the location to write the environment files.
11 # It will write "environment.x86" and "environment.x64" to this directory,
12 # and return a list to us.
14 # The list contains the include path as its only element. (I'm expecting to
15 # add more so it's currently a list inside a list.)
16 #exec_script("get_msvc_config.py",
17 # [relative_root_output_dir],
20 # This will save the environment block and and copy the gyp-win-tool to the
21 # build directory. We pass in the source file of the win tool.
23 rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".", root_build_dir)
24 exec_script("setup_toolchain.py", [ gyp_win_tool_source ], "value")
26 # 32-bit toolchain -------------------------------------------------------------
29 # Make these apply to all tools below.
31 lib_dir_prefix="/LIBPATH:"
34 command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname"
35 description = "CC \$out"
37 rspfile_content = "\$defines \$includes \$cflags \$cflags_c"
41 command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname"
42 description = "CXX \$out"
44 rspfile_content = "\$defines \$includes \$cflags \$cflags_cc"
48 # command = $python_path gyp-win-tool midl-wrapper environment.x86 \$outdir \$tlb \$h \$dlldata \$iid \$
49 # \$proxy \$in \$idlflags
50 # description = IDL \$in
53 command = "$python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$defines \$includes \$rcflags /fo\$out \$in"
54 description = "RC \$in"
57 # command = $python_path gyp-win-tool asm-wrapper environment.x86 ml.exe \$defines \$includes /c /Fo \$
59 # description = ASM \$in
62 command = "$python_path gyp-win-tool link-wrapper environment.x86 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp"
63 description = "LIB \$out"
65 rspfile_content = "\$in_newline \$libflags"
67 #tool("solink_embed_inc") {
68 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
69 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
70 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
71 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
72 # -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc environment.x86 \$dll.manifest \$
73 # \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$
74 # \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$
75 # \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.res
76 # description = LINK_EMBED_INC(DLL) \$dll
79 # rspfile_content = \$libs \$in_newline \$ldflags
81 #tool("solink_module_embed_inc") {
82 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
83 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
84 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
85 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
86 # -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc environment.x86 \$dll.manifest \$
87 # \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$
88 # \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$
89 # \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.res
90 # description = LINK_EMBED_INC(DLL) \$dll
93 # rspfile_content = \$libs \$in_newline \$ldflags
96 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out \$
97 # /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c \$
98 # if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$
99 # manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest && \$
100 # $python_path gyp-win-tool manifest-to-rc environment.x86 \$out.manifest \$out.manifest.rc 1 && \$
101 # $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$out.manifest.rc && \$
102 # $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out /PDB:\$out.pdb \$
103 # @\$out.rsp \$out.manifest.res
104 # description = LINK_EMBED_INC \$out
105 # rspfile = \$out.rsp
106 # rspfile_content = \$in_newline \$libs \$ldflags
108 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
109 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
110 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
111 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
112 # -outputresource:\$dll;2
113 # description = LINK_EMBED(DLL) \$dll
115 # rspfile = \$dll.rsp
116 # rspfile_content = \$libs \$in_newline \$ldflags
117 #rule solink_module_embed
118 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag \$
119 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
120 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && \$
121 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests \$
122 # -outputresource:\$dll;2
123 # description = LINK_EMBED(DLL) \$dll
125 # rspfile = \$dll.rsp
126 # rspfile_content = \$libs \$in_newline \$ldflags
128 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out \$
129 # /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c \$
130 # if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$
131 # manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -outputresource:\$out;1
132 # description = LINK_EMBED \$out
133 # rspfile = \$out.rsp
134 # rspfile_content = \$in_newline \$libs \$ldflags
136 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"
137 description = "LINK(DLL) \$dll"
139 rspfile = "\$dll.rsp"
140 rspfile_content = "\$libs \$in_newline \$ldflags"
143 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"
144 description = "LINK \$out"
145 rspfile = "\$out.rsp"
146 rspfile_content = "\$in_newline \$libs \$ldflags"
149 command = "$python_path gyp-win-tool stamp \$out"
150 description = "STAMP \$out"
153 command = "$python_path gyp-win-tool recursive-mirror \$in \$out"
154 description = "COPY \$in \$out"
158 # 64-bit toolchain -------------------------------------------------------------