Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: tools/gn/secondary/build/toolchain/win/BUILD.gn

Issue 34603009: Improve Windows GN build setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Should only be running on Windows. 5 # Should only be running on Windows.
6 assert(is_win) 6 assert(is_win)
7 7
8 # Setup the Visual Studio state. 8 # Setup the Visual Studio state.
9 # 9 #
10 # Its argument is the location to write the environment files. 10 # Its argument is the location to write the environment files.
11 # It will write "environment.x86" and "environment.x64" to this directory, 11 # It will write "environment.x86" and "environment.x64" to this directory,
12 # and return a list to us. 12 # and return a list to us.
13 # 13 #
14 # The list contains the include path as its only element. (I'm expecting to 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.) 15 # add more so it's currently a list inside a list.)
16 msvc_config = [["foo"]]
17 #exec_script("get_msvc_config.py", 16 #exec_script("get_msvc_config.py",
18 # [relative_root_output_dir], 17 # [relative_root_output_dir],
19 # "value") 18 # "value")
20 19
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.
22 gyp_win_tool_source =
23 rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".", root_build_dir)
24 exec_script("setup_toolchain.py", [ gyp_win_tool_source ], "value")
25
21 # 32-bit toolchain ------------------------------------------------------------- 26 # 32-bit toolchain -------------------------------------------------------------
22 27
23 toolchain("32") { 28 toolchain("32") {
24 # Make these apply to all tools below. 29 # Make these apply to all tools below.
25 lib_prefix = "" 30 lib_prefix = ""
26 lib_dir_prefix="/LIBPATH:" 31 lib_dir_prefix="/LIBPATH:"
27 32
28 tool("cc") { 33 tool("cc") {
29 command = "ninja -t msvc -e \$arch -- cl.exe /nologo /showIncludes /FC @\$ou t.rsp /c \$in /Fo\$out /Fd\$pdbname" 34 command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname"
30 description = "CC \$out" 35 description = "CC \$out"
31 rspfile = "\$out.rsp" 36 rspfile = "\$out.rsp"
32 rspfile_content = "\$defines \$includes \$cflags \$cflags_c" 37 rspfile_content = "\$defines \$includes \$cflags \$cflags_c"
33 deps = "msvc" 38 deps = "msvc"
34 } 39 }
35 tool("cxx") { 40 tool("cxx") {
36 command = "ninja -t msvc -e \$arch -- cl.exe /nologo /showIncludes /FC @\$ou t.rsp /c \$in /Fo\$out /Fd\$pdbname" 41 command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname"
37 description = "CXX \$out" 42 description = "CXX \$out"
38 rspfile = "\$out.rsp" 43 rspfile = "\$out.rsp"
39 rspfile_content = "\$defines \$includes \$cflags \$cflags_cc" 44 rspfile_content = "\$defines \$includes \$cflags \$cflags_cc"
40 deps = "msvc" 45 deps = "msvc"
41 } 46 }
42 #tool("idl") { 47 #tool("idl") {
43 # command = $python_path gyp-win-tool midl-wrapper \$arch \$outdir \$tlb \$h \$dlldata \$iid \$ 48 # command = $python_path gyp-win-tool midl-wrapper environment.x86 \$outdir \ $tlb \$h \$dlldata \$iid \$
44 # \$proxy \$in \$idlflags 49 # \$proxy \$in \$idlflags
45 # description = IDL \$in 50 # description = IDL \$in
46 #} 51 #}
47 tool("rc") { 52 tool("rc") {
48 command = "$python_path gyp-win-tool rc-wrapper \$arch rc.exe \$defines \$in cludes \$rcflags /fo\$out \$in" 53 command = "$python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$def ines \$includes \$rcflags /fo\$out \$in"
49 description = "RC \$in" 54 description = "RC \$in"
50 } 55 }
51 #tool("asm") { 56 #tool("asm") {
52 # command = $python_path gyp-win-tool asm-wrapper \$arch ml.exe \$defines \$i ncludes /c /Fo \$ 57 # command = $python_path gyp-win-tool asm-wrapper environment.x86 ml.exe \$de fines \$includes /c /Fo \$
53 # \$out \$in 58 # \$out \$in
54 # description = ASM \$in 59 # description = ASM \$in
55 #} 60 #}
56 tool("alink") { 61 tool("alink") {
57 command = "$python_path gyp-win-tool link-wrapper \$arch lib.exe /nologo /ig nore:4221 /OUT:\$out @\$out.rsp" 62 command = "$python_path gyp-win-tool link-wrapper environment.x86 lib.exe /n ologo /ignore:4221 /OUT:\$out @\$out.rsp"
58 description = "LIB \$out" 63 description = "LIB \$out"
59 rspfile = "\$out.rsp" 64 rspfile = "\$out.rsp"
60 rspfile_content = "\$in_newline \$libflags" 65 rspfile_content = "\$in_newline \$libflags"
61 } 66 }
62 #tool("solink_embed_inc") { 67 #tool("solink_embed_inc") {
63 # command = cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo \$implibflag \$ 68 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.exe /nologo \$implibflag \$
64 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$ 69 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
65 # manifest-wrapper \$arch cmd /c if exist \$dll.manifest del \$dll.manife st && \$ 70 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$d ll.manifest && \$
66 # $python_path gyp-win-tool manifest-wrapper \$arch mt.exe -nologo -manif est \$manifests \$ 71 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nolo go -manifest \$manifests \$
67 # -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc \$arch \$dll.manifest \$ 72 # -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc environ ment.x86 \$dll.manifest \$
68 # \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper \$arch rc.e xe \$ 73 # \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper environment .x86 rc.exe \$
69 # \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper \$arch link .exe /nologo \$ 74 # \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper environment .x86 link.exe /nologo \$
70 # \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.r es 75 # \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.r es
71 # description = LINK_EMBED_INC(DLL) \$dll 76 # description = LINK_EMBED_INC(DLL) \$dll
72 # restat = 1 77 # restat = 1
73 # rspfile = \$dll.rsp 78 # rspfile = \$dll.rsp
74 # rspfile_content = \$libs \$in_newline \$ldflags 79 # rspfile_content = \$libs \$in_newline \$ldflags
75 #} 80 #}
76 #tool("solink_module_embed_inc") { 81 #tool("solink_module_embed_inc") {
77 # command = cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo \$implibflag \$ 82 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.exe /nologo \$implibflag \$
78 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$ 83 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
79 # manifest-wrapper \$arch cmd /c if exist \$dll.manifest del \$dll.manife st && \$ 84 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$d ll.manifest && \$
80 # $python_path gyp-win-tool manifest-wrapper \$arch mt.exe -nologo -manif est \$manifests \$ 85 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nolo go -manifest \$manifests \$
81 # -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc \$arch \$dll.manifest \$ 86 # -out:\$dll.manifest && $python_path gyp-win-tool manifest-to-rc environ ment.x86 \$dll.manifest \$
82 # \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper \$arch rc.e xe \$ 87 # \$dll.manifest.rc 2 && $python_path gyp-win-tool rc-wrapper environment .x86 rc.exe \$
83 # \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper \$arch link .exe /nologo \$ 88 # \$dll.manifest.rc && $python_path gyp-win-tool link-wrapper environment .x86 link.exe /nologo \$
84 # \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.r es 89 # \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp \$dll.manifest.r es
85 # description = LINK_EMBED_INC(DLL) \$dll 90 # description = LINK_EMBED_INC(DLL) \$dll
86 # restat = 1 91 # restat = 1
87 # rspfile = \$dll.rsp 92 # rspfile = \$dll.rsp
88 # rspfile_content = \$libs \$in_newline \$ldflags 93 # rspfile_content = \$libs \$in_newline \$ldflags
89 #} 94 #}
90 #rule link_embed_inc 95 #rule link_embed_inc
91 # command = cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo /OUT:\$out \$ 96 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.exe /nologo /OUT:\$out \$
92 # /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper \$arch cmd /c \$ 97 # /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c \$
93 # if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$ 98 # if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$
94 # manifest-wrapper \$arch mt.exe -nologo -manifest \$manifests -out:\$out .manifest && \$ 99 # manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests - out:\$out.manifest && \$
95 # $python_path gyp-win-tool manifest-to-rc \$arch \$out.manifest \$out.ma nifest.rc 1 && \$ 100 # $python_path gyp-win-tool manifest-to-rc environment.x86 \$out.manifest \$out.manifest.rc 1 && \$
96 # $python_path gyp-win-tool rc-wrapper \$arch rc.exe \$out.manifest.rc && \$ 101 # $python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$out.manif est.rc && \$
97 # $python_path gyp-win-tool link-wrapper \$arch link.exe /nologo /OUT:\$o ut /PDB:\$out.pdb \$ 102 # $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out /PDB:\$out.pdb \$
98 # @\$out.rsp \$out.manifest.res 103 # @\$out.rsp \$out.manifest.res
99 # description = LINK_EMBED_INC \$out 104 # description = LINK_EMBED_INC \$out
100 # rspfile = \$out.rsp 105 # rspfile = \$out.rsp
101 # rspfile_content = \$in_newline \$libs \$ldflags 106 # rspfile_content = \$in_newline \$libs \$ldflags
102 #rule solink_embed 107 #rule solink_embed
103 # command = cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo \$implibflag \$ 108 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.exe /nologo \$implibflag \$
104 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$ 109 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
105 # manifest-wrapper \$arch cmd /c if exist \$dll.manifest del \$dll.manife st && \$ 110 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$d ll.manifest && \$
106 # $python_path gyp-win-tool manifest-wrapper \$arch mt.exe -nologo -manif est \$manifests \$ 111 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nolo go -manifest \$manifests \$
107 # -outputresource:\$dll;2 112 # -outputresource:\$dll;2
108 # description = LINK_EMBED(DLL) \$dll 113 # description = LINK_EMBED(DLL) \$dll
109 # restat = 1 114 # restat = 1
110 # rspfile = \$dll.rsp 115 # rspfile = \$dll.rsp
111 # rspfile_content = \$libs \$in_newline \$ldflags 116 # rspfile_content = \$libs \$in_newline \$ldflags
112 #rule solink_module_embed 117 #rule solink_module_embed
113 # command = cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo \$implibflag \$ 118 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.exe /nologo \$implibflag \$
114 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$ 119 # /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool \$
115 # manifest-wrapper \$arch cmd /c if exist \$dll.manifest del \$dll.manife st && \$ 120 # manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$d ll.manifest && \$
116 # $python_path gyp-win-tool manifest-wrapper \$arch mt.exe -nologo -manif est \$manifests \$ 121 # $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nolo go -manifest \$manifests \$
117 # -outputresource:\$dll;2 122 # -outputresource:\$dll;2
118 # description = LINK_EMBED(DLL) \$dll 123 # description = LINK_EMBED(DLL) \$dll
119 # restat = 1 124 # restat = 1
120 # rspfile = \$dll.rsp 125 # rspfile = \$dll.rsp
121 # rspfile_content = \$libs \$in_newline \$ldflags 126 # rspfile_content = \$libs \$in_newline \$ldflags
122 #rule link_embed 127 #rule link_embed
123 # command = cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo /OUT:\$out \$ 128 # command = cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.exe /nologo /OUT:\$out \$
124 # /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper \$arch cmd /c \$ 129 # /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c \$
125 # if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$ 130 # if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool \$
126 # manifest-wrapper \$arch mt.exe -nologo -manifest \$manifests -outputres ource:\$out;1 131 # manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests - outputresource:\$out;1
127 # description = LINK_EMBED \$out 132 # description = LINK_EMBED \$out
128 # rspfile = \$out.rsp 133 # rspfile = \$out.rsp
129 # rspfile_content = \$in_newline \$libs \$ldflags 134 # rspfile_content = \$in_newline \$libs \$ldflags
130 tool("solink") { 135 tool("solink") {
131 command = "cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp- win-tool manifest-wrapper \$arch cmd /c if exist \$dll.manifest del \$dll.manife st && $python_path gyp-win-tool manifest-wrapper \$arch mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" 136 command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.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.manifes t del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x 86 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest"
132 description = "LINK(DLL) \$dll" 137 description = "LINK(DLL) \$dll"
133 restat = "1" 138 restat = "1"
134 rspfile = "\$dll.rsp" 139 rspfile = "\$dll.rsp"
135 rspfile_content = "\$libs \$in_newline \$ldflags" 140 rspfile_content = "\$libs \$in_newline \$ldflags"
136 } 141 }
137 tool("link") { 142 tool("link") {
138 command = "cmd /c $python_path gyp-win-tool link-wrapper \$arch link.exe /no logo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest- wrapper \$arch cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper \$arch mt.exe -nologo -manifest \$manifests -out: \$out.manifest" 143 command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 lin k.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.manife st && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest"
139 description = "LINK \$out" 144 description = "LINK \$out"
140 rspfile = "\$out.rsp" 145 rspfile = "\$out.rsp"
141 rspfile_content = "\$in_newline \$libs \$ldflags" 146 rspfile_content = "\$in_newline \$libs \$ldflags"
142 } 147 }
143 tool("stamp") { 148 tool("stamp") {
144 command = "$python_path gyp-win-tool stamp \$out" 149 command = "$python_path gyp-win-tool stamp \$out"
145 description = "STAMP \$out" 150 description = "STAMP \$out"
146 } 151 }
147 tool("copy") { 152 tool("copy") {
148 command = "$python_path gyp-win-tool recursive-mirror \$in \$out" 153 command = "$python_path gyp-win-tool recursive-mirror \$in \$out"
149 description = "COPY \$in \$out" 154 description = "COPY \$in \$out"
150 } 155 }
151 } 156 }
152 157
153 # 64-bit toolchain ------------------------------------------------------------- 158 # 64-bit toolchain -------------------------------------------------------------
154 159
155 toolchain("64") { 160 toolchain("64") {
156 } 161 }
OLDNEW
« no previous file with comments | « tools/gn/secondary/build/config/win/BUILD.gn ('k') | tools/gn/secondary/build/toolchain/win/setup_toolchain.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698