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

Side by Side Diff: runtime/bin/BUILD.gn

Issue 690923003: Adds GN build files for building in GN based projects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
(Empty)
1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file.
4
5
6 declare_args() {
7 dart_io_support = false
8 }
9
10
11 template("gen_library_src_path") {
12 assert(defined(invoker.sources), "Need sources in $target_name")
13 assert(defined(invoker.output), "Need output in $target_name")
14 action(target_name) {
15 visibility = [ ":*" ] # Only targets in this file can see this.
16 script = "../tools/gen_library_src_paths.py"
17 inputs = [
18 "../tools/gen_library_src_paths.py",
19 "builtin_in.cc",
20 ]
21 outputs = [ invoker.output, ]
22 name = invoker.name
23 kind = invoker.kind
24 args = [
25 "--output", rebase_path(invoker.output, root_build_dir),
26 "--input_cc", rebase_path("builtin_in.cc", root_build_dir),
27 "--include", "bin/builtin.h",
28 "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_",
29 "--library_name", "dart:${name}",] +
30 rebase_path(invoker.sources, root_build_dir)
31 }
32 }
33
34
35 builtin_sources_gypi =
36 exec_script("../../tools/gypi_to_gn.py",
37 [rebase_path("builtin_sources.gypi")],
38 "scope",
39 ["builtin_sources.gypi"])
40
41 gen_library_src_path("generate_builtin_cc_file") {
42 name = "_builtin"
43 kind = "source"
44 sources = builtin_sources_gypi.sources
45 output = "$target_gen_dir/builtin_gen.cc"
46 }
47
48
49 iolib_sources_gypi =
Ivan Posva 2014/11/11 18:26:23 I find it a bit confusing that we are including th
zra 2014/11/11 22:03:34 Needed for gen_snapshot
50 exec_script("../../tools/gypi_to_gn.py",
51 [rebase_path("../../sdk/lib/io/iolib_sources.gypi")],
52 "scope",
53 ["../../sdk/lib/io/iolib_sources.gypi"])
54 iolib_sources = rebase_path(iolib_sources_gypi.sources, ".", "../../sdk/lib/io")
55
56 gen_library_src_path("generate_io_cc_file") {
57 name = "io"
58 kind = "source"
59 sources = ["../../sdk/lib/io/io.dart"] + iolib_sources
60 output = "$target_gen_dir/io_gen.cc"
61 }
62
63 io_sources_gypi =
64 exec_script("../../tools/gypi_to_gn.py",
65 [rebase_path("io_sources.gypi")],
66 "scope",
67 ["io_sources.gypi"])
68
69 gen_library_src_path("generate_io_patch_cc_file") {
70 name = "io"
71 kind = "patch"
72 sources = io_sources_gypi.sources
73 output = "$target_gen_dir/io_patch_gen.cc"
74 }
75
76
77 config("libdart_builtin_config") {
78 libs = [
79 "dl",
80 ]
81 }
82
83
84 builtin_impl_sources_gypi =
85 exec_script("../../tools/gypi_to_gn.py",
86 [rebase_path("builtin_impl_sources.gypi")],
87 "scope",
88 ["builtin_impl_sources.gypi"])
89
90 static_library("libdart_builtin") {
91 configs += ["../..:dart_config"]
92 public_configs = [":libdart_builtin_config"]
93 deps = [
94 ":generate_builtin_cc_file",
95 ":generate_io_cc_file",
96 ":generate_io_patch_cc_file",
97 ]
98 include_dirs = [
99 "..",
100 ]
101 set_sources_assignment_filter(["*_test.cc", "*_test.h"])
102 sources = [
103 "log_android.cc",
104 "log_linux.cc",
105 "log_macos.cc",
106 "log_win.cc",
107 ] + builtin_impl_sources_gypi.sources
108 }
109
110
111 io_impl_sources_gypi =
112 exec_script("../../tools/gypi_to_gn.py",
113 [rebase_path("io_impl_sources.gypi")],
114 "scope",
115 ["io_impl_sources.gypi"])
116
117 static_library("libdart_io") {
118 configs += ["../..:dart_config"]
119
120 if (dart_io_support) {
121 sources = io_impl_sources_gypi.sources - [
122 "filter_unsupported.cc",
123 "secure_socket_unsupported.cc",
124 "io_service_unsupported.cc",
125 ]
126 # TODO(zra): This would be needed for full IO-enabled VM build.
127 # deps = ["net:libssl_dart",]
128 } else {
129 sources = io_impl_sources_gypi.sources - [
130 "filter.cc",
131 "filter.h",
132 "io_service.cc",
133 "io_service.h",
134 "net/nss_memio.cc",
135 "net/nss_memio.h",
136 "secure_socket.cc",
137 "secure_socket.h",
138 ]
139 }
140 sources += [
141 "io_natives.h",
142 "io_natives.cc",
143 ]
144
145 include_dirs = [
146 "..",
147 ]
148 }
149
150
151 static_library("libdart_withcore") {
152 configs += ["../..:dart_config"]
153 deps = [
154 "../vm:libdart_lib_withcore",
155 "../vm:libdart_vm",
156 "../vm:libdart_platform",
157 "../third_party/jscre:libjscre",
158 "../third_party/double-conversion/src:libdouble_conversion",
159 "..:generate_version_cc_file",
160 ]
161
162 sources = [
163 "../include/dart_api.h",
164 "../include/dart_debugger_api.h",
165 "../include/dart_mirrors_api.h",
166 "../include/dart_native_api.h",
167 "../vm/dart_api_impl.cc",
168 "../vm/debugger_api_impl.cc",
169 "../vm/mirrors_api_impl.cc",
170 "../vm/native_api_impl.cc",
171 "$target_gen_dir/../version.cc",
172 ]
173
174 include_dirs = [
175 "..",
176 ]
177
178 defines = [
179 "DART_SHARED_LIB",
180 ]
181 }
182
183
184 executable("gen_snapshot") {
185 configs += ["../..:dart_config"]
186 deps = [
187 ":libdart_withcore",
188 ":libdart_builtin",
189 ]
190
191 sources = [
192 "gen_snapshot.cc",
193 # Very limited native resolver provided.
194 "builtin_gen_snapshot.cc",
195 "builtin.cc",
196 "builtin.h",
197 # Include generated source files.
198 "$target_gen_dir/builtin_gen.cc",
199 "$target_gen_dir/io_gen.cc",
200 "$target_gen_dir/io_patch_gen.cc",
201 ]
202
203 include_dirs = [
204 "..",
205 ]
206 }
207
208
209 action("generate_snapshot_bin") {
210 deps = [":gen_snapshot"]
211 inputs = [
212 "../tools/create_snapshot_bin.py"
213 ]
214 output = "$target_gen_dir/snapshot_gen.bin"
215 outputs = [output,]
216
217 script = "../tools/create_snapshot_bin.py"
218 args = [
219 "--executable",
220 rebase_path("$root_out_dir/gen_snapshot"),
221 "--output_bin", rebase_path(output, root_build_dir),
222 "--target_os", os
223 ]
224 }
225
226
227 action("generate_snapshot_file") {
228 deps = [":generate_snapshot_bin"]
229 inputs = [
230 "../tools/create_snapshot_file.py",
231 "snapshot_in.cc",
232 "$target_gen_dir/snapshot_gen.bin",
233 ]
234 output = "$target_gen_dir/snapshot.cc"
235 outputs = [output,]
236
237 script = "../tools/create_snapshot_file.py"
238 args = [
239 "--input_bin", rebase_path("$target_gen_dir/snapshot_gen.bin"),
240 "--input_cc", rebase_path("snapshot_in.cc"),
241 "--output", rebase_path(output),
242 ]
243 }
244
245
246 resources_sources_gypi =
Ivan Posva 2014/11/11 18:26:23 If we do not have dart:io then including the obser
zra 2014/11/11 22:03:34 Removed
247 exec_script("../../tools/gypi_to_gn.py",
248 [rebase_path("resources_sources.gypi")],
249 "scope",
250 ["resources_sources.gypi"])
251
252 action("generate_resources_cc_file") {
253 sources = resources_sources_gypi.sources
254
255 inputs = [
256 "../tools/create_resources.py",
257 # The following two files are used to trigger a rebuild.
258 "vmservice/observatory/deployed/web/index.html",
259 "vmservice/observatory/deployed/web/index.html_bootstrap.dart.js",
260 ] + sources
261 output = "$target_gen_dir/resources_gen.cc"
262 outputs = [output,]
263
264 script = "../tools/create_resources.py"
265 args = [
266 "--output", rebase_path(output),
267 "--outer_namespace", "dart",
268 "--inner_namespace", "bin",
269 "--table_name", "service_bin",
270 "--root_prefix", "bin/",
271 "--client_root", "bin/vmservice/observatory/deployed/",
272 ] + rebase_path(sources)
273 }
274
275
276 static_library("libdart_embedder_noio") {
277 configs += ["../..:dart_config",]
278 deps = [
279 "..:libdart",
280 "../vm:libdart_platform",
281 ":generate_snapshot_file",
282 ":generate_resources_cc_file",
283 ]
284
285 sources = [
286 "$target_gen_dir/snapshot.cc",
287 "$target_gen_dir/resources_gen.cc",
288 ]
289
290 include_dirs = [
291 "..",
292 ]
293 }
294
295
296 config("dart_exe_config") {
297 ldflags = [
298 "-rdynamic",
299 ]
300 }
301
302
303 executable("dart") {
Ivan Posva 2014/11/11 18:26:23 This dart binary will not be usable as it lacks th
zra 2014/11/11 22:03:34 Removed
304 configs += ["../..:dart_config", ":dart_exe_config"]
305 deps = [
306 "..:libdart",
307 ":libdart_builtin",
308 "../vm:libdart_platform",
309 ":libdart_io",
310 ":generate_snapshot_file",
311 ":generate_resources_cc_file",
312 ]
313
314 sources = [
315 "main.cc",
316 "builtin_natives.cc",
317 "builtin_nolib.cc",
318 "builtin.h",
319 "io_natives.h",
320 "vmservice.h",
321 "vmservice_impl.cc",
322 "vmservice_impl.h",
323 "$target_gen_dir/snapshot.cc",
324 "$target_gen_dir/resources_gen.cc",
325 ]
326
327 include_dirs = [
328 "..",
329 ]
330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698