- add sources.
[platform/framework/web/crosswalk.git] / src / tools / gn / secondary / build / toolchain / win / BUILD.gn
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.
4
5 # Should only be running on Windows.
6 assert(is_win)
7
8 # Setup the Visual Studio state.
9 #
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.
13 #
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],
18                      #     "value")
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
26 # 32-bit toolchain -------------------------------------------------------------
27
28 toolchain("32") {
29   # Make these apply to all tools below.
30   lib_prefix = ""
31   lib_dir_prefix="/LIBPATH:"
32
33   tool("cc") {
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"
36     rspfile = "\$out.rsp"
37     rspfile_content = "\$defines \$includes \$cflags \$cflags_c"
38     deps = "msvc"
39   }
40   tool("cxx") {
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"
43     rspfile = "\$out.rsp"
44     rspfile_content = "\$defines \$includes \$cflags \$cflags_cc"
45     deps = "msvc"
46   }
47   #tool("idl") {
48   #  command = $python_path gyp-win-tool midl-wrapper environment.x86 \$outdir \$tlb \$h \$dlldata \$iid \$
49   #      \$proxy \$in \$idlflags
50   #  description = IDL \$in
51   #}
52   tool("rc") {
53     command = "$python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$defines \$includes \$rcflags /fo\$out \$in"
54     description = "RC \$in"
55   }
56   #tool("asm") {
57   #  command = $python_path gyp-win-tool asm-wrapper environment.x86 ml.exe \$defines \$includes /c /Fo \$
58   #      \$out \$in
59   #  description = ASM \$in
60   #}
61   tool("alink") {
62     command = "$python_path gyp-win-tool link-wrapper environment.x86 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp"
63     description = "LIB \$out"
64     rspfile = "\$out.rsp"
65     rspfile_content = "\$in_newline \$libflags"
66   }
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
77   #  restat = 1
78   #  rspfile = \$dll.rsp
79   #  rspfile_content = \$libs \$in_newline \$ldflags
80   #}
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
91   #  restat = 1
92   #  rspfile = \$dll.rsp
93   #  rspfile_content = \$libs \$in_newline \$ldflags
94   #}
95   #rule link_embed_inc
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
107   #rule solink_embed
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
114   #  restat = 1
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
124   #  restat = 1
125   #  rspfile = \$dll.rsp
126   #  rspfile_content = \$libs \$in_newline \$ldflags
127   #rule link_embed
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
135   tool("solink") {
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"
138     restat = "1"
139     rspfile = "\$dll.rsp"
140     rspfile_content = "\$libs \$in_newline \$ldflags"
141   }
142   tool("link") {
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"
147   }
148   tool("stamp") {
149     command = "$python_path gyp-win-tool stamp \$out"
150     description = "STAMP \$out"
151   }
152   tool("copy") {
153     command = "$python_path gyp-win-tool recursive-mirror \$in \$out"
154     description = "COPY \$in \$out"
155   }
156 }
157
158 # 64-bit toolchain -------------------------------------------------------------
159
160 toolchain("64") {
161 }