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

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

Issue 2350583002: Starting work on full GN build (Closed)
Patch Set: Fixes for Fuchsia and Flutter. Cleanup. Created 4 years, 2 months 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
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/bin/bin.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 declare_args() { 5 declare_args() {
6 # Whether to fall back to built-in root certificates when they cannot be 6 # Whether to fall back to built-in root certificates when they cannot be
7 # verified at the operating system level. 7 # verified at the operating system level.
8 dart_use_fallback_root_certificates = false 8 dart_use_fallback_root_certificates = false
9
10 # The BUILD.gn file that we pull from chromium as part of zlib has a
11 # dependence on //base, which we don't pull in. In a standalone build of the
12 # VM, we set this to //runtime/bin/zlib where we have a BUILD.gn file without
13 # a dependence on //base.
14 dart_zlib_path = "//third_party/zlib"
9 } 15 }
10 16
11 resources_sources_gypi = 17 resources_sources_gypi =
12 exec_script("../../tools/gypi_to_gn.py", 18 exec_script("../../tools/gypi_to_gn.py",
13 [rebase_path("vmservice/vmservice_sources.gypi")], 19 [rebase_path("vmservice/vmservice_sources.gypi")],
14 "scope", 20 "scope",
15 ["vmservice/vmservice_sources.gypi"]) 21 ["vmservice/vmservice_sources.gypi"])
16 22
17 # Generate a resources.cc file for the service isolate without Observatory. 23 # Generate a resources.cc file for the service isolate without Observatory.
18 action("gen_resources_cc") { 24 action("gen_resources_cc") {
(...skipping 11 matching lines...) Expand all
30 args = [ 36 args = [
31 "--output", 37 "--output",
32 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir), 38 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir),
33 "--outer_namespace", "dart", 39 "--outer_namespace", "dart",
34 "--inner_namespace", "bin", 40 "--inner_namespace", "bin",
35 "--table_name", "service_bin", 41 "--table_name", "service_bin",
36 "--root_prefix", rebase_path(".", root_build_dir) + "/", 42 "--root_prefix", rebase_path(".", root_build_dir) + "/",
37 ] + rebase_path(sources, root_build_dir) 43 ] + rebase_path(sources, root_build_dir)
38 } 44 }
39 45
40
41 template("gen_library_src_path") { 46 template("gen_library_src_path") {
42 assert(defined(invoker.sources), "Need sources in $target_name") 47 assert(defined(invoker.sources), "Need sources in $target_name")
43 assert(defined(invoker.output), "Need output in $target_name") 48 assert(defined(invoker.output), "Need output in $target_name")
44 action(target_name) { 49 action(target_name) {
45 visibility = [ ":*" ] # Only targets in this file can see this. 50 visibility = [ ":*" ] # Only targets in this file can see this.
46 script = "../tools/gen_library_src_paths.py" 51 script = "../tools/gen_library_src_paths.py"
47 inputs = [ 52 inputs = [
48 "../tools/gen_library_src_paths.py", 53 "../tools/gen_library_src_paths.py",
49 "builtin_in.cc", 54 "builtin_in.cc",
50 ] + invoker.sources 55 ] + invoker.sources
51 outputs = [ invoker.output, ] 56 outputs = [ invoker.output, ]
52 name = invoker.name 57 name = invoker.name
53 kind = invoker.kind 58 kind = invoker.kind
59 library_name = "dart:${name}"
60 if (defined(invoker.library_name)) {
61 library_name = invoker.library_name
62 }
54 args = [ 63 args = [
55 "--output", rebase_path(invoker.output, root_build_dir), 64 "--output", rebase_path(invoker.output, root_build_dir),
56 "--input_cc", rebase_path("builtin_in.cc", root_build_dir), 65 "--input_cc", rebase_path("builtin_in.cc", root_build_dir),
57 "--include", "bin/builtin.h", 66 "--include", "bin/builtin.h",
58 "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_", 67 "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_",
59 "--library_name", "dart:${name}",] + 68 "--library_name", library_name,] +
60 rebase_path(invoker.sources, root_build_dir) 69 rebase_path(invoker.sources, root_build_dir)
61 } 70 }
62 } 71 }
63 72
64
65 builtin_sources_gypi = 73 builtin_sources_gypi =
66 exec_script("../../tools/gypi_to_gn.py", 74 exec_script("../../tools/gypi_to_gn.py",
67 [rebase_path("builtin_sources.gypi")], 75 [rebase_path("builtin_sources.gypi")],
68 "scope", 76 "scope",
69 ["builtin_sources.gypi"]) 77 ["builtin_sources.gypi"])
70 78
71 gen_library_src_path("generate_builtin_cc_file") { 79 gen_library_src_path("generate_builtin_cc_file") {
72 name = "_builtin" 80 name = "_builtin"
73 kind = "source" 81 kind = "source"
74 sources = builtin_sources_gypi.sources 82 sources = builtin_sources_gypi.sources
75 output = "$target_gen_dir/builtin_gen.cc" 83 output = "$target_gen_dir/builtin_gen.cc"
76 } 84 }
77 85
78
79 sdk_io_sources_gypi = 86 sdk_io_sources_gypi =
80 exec_script("../../tools/gypi_to_gn.py", 87 exec_script("../../tools/gypi_to_gn.py",
81 [rebase_path("../../sdk/lib/io/io_sources.gypi")], 88 [rebase_path("../../sdk/lib/io/io_sources.gypi")],
82 "scope", 89 "scope",
83 ["../../sdk/lib/io/io_sources.gypi"]) 90 ["../../sdk/lib/io/io_sources.gypi"])
84 sdk_io_sources = 91 sdk_io_sources =
85 rebase_path(sdk_io_sources_gypi.sources, ".", "../../sdk/lib/io") 92 rebase_path(sdk_io_sources_gypi.sources, ".", "../../sdk/lib/io")
86 93
87 gen_library_src_path("generate_io_cc_file") { 94 gen_library_src_path("generate_io_cc_file") {
88 name = "io" 95 name = "io"
89 kind = "source" 96 kind = "source"
90 sources = ["../../sdk/lib/io/io.dart"] + sdk_io_sources 97 sources = ["../../sdk/lib/io/io.dart"] + sdk_io_sources
91 output = "$target_gen_dir/io_gen.cc" 98 output = "$target_gen_dir/io_gen.cc"
92 } 99 }
93 100
94 io_sources_gypi = 101 io_sources_gypi =
95 exec_script("../../tools/gypi_to_gn.py", 102 exec_script("../../tools/gypi_to_gn.py",
96 [rebase_path("io_sources.gypi")], 103 [rebase_path("io_sources.gypi")],
97 "scope", 104 "scope",
98 ["io_sources.gypi"]) 105 ["io_sources.gypi"])
99 106
100 gen_library_src_path("generate_io_patch_cc_file") { 107 gen_library_src_path("generate_io_patch_cc_file") {
101 name = "io" 108 name = "io"
102 kind = "patch" 109 kind = "patch"
103 sources = io_sources_gypi.sources 110 sources = io_sources_gypi.sources
104 output = "$target_gen_dir/io_patch_gen.cc" 111 output = "$target_gen_dir/io_patch_gen.cc"
105 } 112 }
106 113
114 gen_library_src_path("generate_html_cc_file") {
115 name = "html"
116 kind = "source"
117 sources = ["../../sdk/lib/html/dartium/html_dartium.dart"]
118 output = "$target_gen_dir/html_gen.cc"
119 }
120
121 gen_library_src_path("generate_html_common_cc_file") {
122 name = "html_common"
123 kind = "source"
124 sources = [
125 "../../sdk/lib/html/html_common/html_common.dart",
126 "../../sdk/lib/html/html_common/css_class_set.dart",
127 "../../sdk/lib/html/html_common/device.dart",
128 "../../sdk/lib/html/html_common/filtered_element_list.dart",
129 "../../sdk/lib/html/html_common/lists.dart",
130 "../../sdk/lib/html/html_common/conversions.dart",
131 "../../sdk/lib/html/html_common/conversions_dartium.dart",
132 ]
133 output = "$target_gen_dir/html_common_gen.cc"
134 }
135
136 gen_library_src_path("generate_js_cc_file") {
137 name = "js"
138 kind = "source"
139 sources = ["../../sdk/lib/js/dartium/js_dartium.dart"]
140 output = "$target_gen_dir/js_gen.cc"
141 }
142
143 gen_library_src_path("generate_blink_cc_file") {
144 name = "_blink"
145 kind = "source"
146 sources = ["../../sdk/lib/_blink/dartium/_blink_dartium.dart"]
147 output = "$target_gen_dir/blink_gen.cc"
148 }
149
150 gen_library_src_path("generate_indexed_db_cc_file") {
151 name = "indexed_db"
152 kind = "source"
153 sources = ["../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart"]
154 output = "$target_gen_dir/indexed_db_gen.cc"
155 }
156
157 gen_library_src_path("generate_cached_patches_cc_file") {
158 name = "cached_patches"
159 library_name = "cached_patches.dart"
160 kind = "sources"
161 sources = ["../../sdk/lib/js/dartium/cached_patches.dart"]
162 output = "$target_gen_dir/cached_patches_gen.cc"
163 }
164
165 gen_library_src_path("generate_web_gl_cc_file") {
166 name = "web_gl"
167 kind = "source"
168 sources = ["../../sdk/lib/web_gl/dartium/web_gl_dartium.dart"]
169 output = "$target_gen_dir/web_gl_gen.cc"
170 }
171
172 gen_library_src_path("generate_metadata_cc_file") {
173 name = "metadata"
174 library_name = "metadata.dart"
175 kind = "source"
176 sources = ["../../sdk/lib/html/html_common/metadata.dart"]
177 output = "$target_gen_dir/metadata_gen.cc"
178 }
179
180 gen_library_src_path("generate_web_sql_cc_file") {
181 name = "web_sql"
182 kind = "source"
183 sources = ["../../sdk/lib/web_sql/dartium/web_sql_dartium.dart"]
184 output = "$target_gen_dir/web_sql_gen.cc"
185 }
186
187 gen_library_src_path("generate_svg_cc_file") {
188 name = "svg"
189 kind = "source"
190 sources = ["../../sdk/lib/svg/dartium/svg_dartium.dart"]
191 output = "$target_gen_dir/svg_gen.cc"
192 }
193
194 gen_library_src_path("generate_web_audio_cc_file") {
195 name = "web_audio"
196 kind = "source"
197 sources = ["../../sdk/lib/web_audio/dartium/web_audio_dartium.dart"]
198 output = "$target_gen_dir/web_audio_gen.cc"
199 }
107 200
108 config("libdart_builtin_config") { 201 config("libdart_builtin_config") {
109 libs = [ 202 libs = [
110 "dl", 203 "dl",
111 ] 204 ]
205 if (is_android) {
206 libs += [
207 "android",
208 "log",
209 ]
210 }
112 } 211 }
113 212
114
115 builtin_impl_sources_gypi = 213 builtin_impl_sources_gypi =
116 exec_script("../../tools/gypi_to_gn.py", 214 exec_script("../../tools/gypi_to_gn.py",
117 [rebase_path("builtin_impl_sources.gypi")], 215 [rebase_path("builtin_impl_sources.gypi")],
118 "scope", 216 "scope",
119 ["builtin_impl_sources.gypi"]) 217 ["builtin_impl_sources.gypi"])
120 218
121 static_library("libdart_builtin") { 219 static_library("libdart_builtin") {
122 configs += ["..:dart_config", "..:dart_product_config"] 220 configs += ["..:dart_config",
221 "..:dart_maybe_product_config"]
123 public_configs = [":libdart_builtin_config"] 222 public_configs = [":libdart_builtin_config"]
124 deps = [ 223 deps = [
125 ":generate_builtin_cc_file", 224 ":generate_builtin_cc_file",
126 ":generate_io_cc_file", 225 ":generate_io_cc_file",
127 ":generate_io_patch_cc_file", 226 ":generate_io_patch_cc_file",
227 ":generate_html_cc_file",
228 ":generate_html_common_cc_file",
229 ":generate_js_cc_file",
230 ":generate_blink_cc_file",
231 ":generate_indexed_db_cc_file",
232 ":generate_cached_patches_cc_file",
233 ":generate_web_gl_cc_file",
234 ":generate_metadata_cc_file",
235 ":generate_web_sql_cc_file",
236 ":generate_svg_cc_file",
237 ":generate_web_audio_cc_file",
128 ] 238 ]
129 include_dirs = [ 239 include_dirs = [
130 "..", 240 "..",
131 ] 241 ]
132 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 242 set_sources_assignment_filter(["*_test.cc", "*_test.h"])
133 sources = [ 243 sources = [
134 "log_android.cc", 244 "log_android.cc",
135 "log_fuchsia.cc", 245 "log_fuchsia.cc",
136 "log_linux.cc", 246 "log_linux.cc",
137 "log_macos.cc", 247 "log_macos.cc",
138 "log_win.cc", 248 "log_win.cc",
139 ] + builtin_impl_sources_gypi.sources 249 ] + builtin_impl_sources_gypi.sources
140 } 250 }
141 251
142
143 static_library("libdart_nosnapshot") {
144 configs += ["..:dart_config",
145 "..:dart_product_config",
146 "..:dart_precompiled_runtime_config"]
147 deps = [
148 "../vm:libdart_lib_nosnapshot",
149 "../vm:libdart_vm_nosnapshot",
150 "../vm:libdart_platform",
151 "../third_party/double-conversion/src:libdouble_conversion",
152 "..:generate_version_cc_file",
153 ]
154
155 sources = [
156 "../include/dart_api.h",
157 "../include/dart_mirrors_api.h",
158 "../include/dart_native_api.h",
159 "../include/dart_tools_api.h",
160 "../vm/dart_api_impl.cc",
161 "../vm/debugger_api_impl.cc",
162 "../vm/mirrors_api_impl.cc",
163 "../vm/native_api_impl.cc",
164 "$target_gen_dir/../version.cc",
165 ]
166
167 include_dirs = [
168 "..",
169 ]
170
171 defines = [
172 "DART_SHARED_LIB",
173 ]
174 }
175
176
177 static_library("libdart_nosnapshot_with_precompiler") {
178 configs += ["..:dart_config",
179 "..:dart_product_config",
180 "..:dart_precompiler_config"]
181 deps = [
182 "../vm:libdart_lib_nosnapshot_with_precompiler",
183 "../vm:libdart_vm_nosnapshot_with_precompiler",
184 "../vm:libdart_platform",
185 "../third_party/double-conversion/src:libdouble_conversion",
186 "..:generate_version_cc_file",
187 ]
188
189 sources = [
190 "../include/dart_api.h",
191 "../include/dart_mirrors_api.h",
192 "../include/dart_native_api.h",
193 "../include/dart_tools_api.h",
194 "../vm/dart_api_impl.cc",
195 "../vm/debugger_api_impl.cc",
196 "../vm/mirrors_api_impl.cc",
197 "../vm/native_api_impl.cc",
198 "$target_gen_dir/../version.cc",
199 ]
200
201 include_dirs = [
202 "..",
203 ]
204
205 defines = [
206 "DART_SHARED_LIB",
207 ]
208 }
209
210 io_impl_sources_gypi = 252 io_impl_sources_gypi =
211 exec_script("../../tools/gypi_to_gn.py", 253 exec_script("../../tools/gypi_to_gn.py",
212 [ rebase_path("io_impl_sources.gypi") ], 254 [ rebase_path("io_impl_sources.gypi") ],
213 "scope", 255 "scope",
214 [ "io_impl_sources.gypi" ]) 256 [ "io_impl_sources.gypi" ])
215 257
216 executable("gen_snapshot") { 258 executable("gen_snapshot") {
217 configs += ["..:dart_config", 259 configs += ["..:dart_config",
218 "..:dart_product_config", 260 "..:dart_maybe_product_config",
219 "..:dart_precompiler_config"] 261 "..:dart_precompiler_config"]
220 deps = [ 262 deps = [
221 ":gen_resources_cc", 263 ":gen_resources_cc",
222 ":gen_snapshot_dart_io", 264 ":gen_snapshot_dart_io",
223 ":generate_builtin_cc_file", 265 ":generate_builtin_cc_file",
224 ":generate_io_cc_file", 266 ":generate_io_cc_file",
225 ":generate_io_patch_cc_file", 267 ":generate_io_patch_cc_file",
226 ":libdart_builtin", 268 ":libdart_builtin",
227 ":libdart_nosnapshot_with_precompiler", 269 "..:libdart_nosnapshot_with_precompiler",
228 ] 270 ]
229 271
230 sources = [ 272 sources = [
231 "address_sanitizer.cc", 273 "address_sanitizer.cc",
232 "gen_snapshot.cc", 274 "gen_snapshot.cc",
233 # Very limited native resolver provided. 275 # Very limited native resolver provided.
234 "builtin_common.cc", 276 "builtin_common.cc",
235 "builtin_gen_snapshot.cc", 277 "builtin_gen_snapshot.cc",
236 "builtin.cc", 278 "builtin.cc",
237 "builtin.h", 279 "builtin.h",
(...skipping 15 matching lines...) Expand all
253 "CoreFoundation.framework", 295 "CoreFoundation.framework",
254 "CoreServices.framework" 296 "CoreServices.framework"
255 ] 297 ]
256 } 298 }
257 } 299 }
258 300
259 # A source set for the implementation of 'dart:io' library 301 # A source set for the implementation of 'dart:io' library
260 # (without secure sockets) suitable for linking with gen_snapshot. 302 # (without secure sockets) suitable for linking with gen_snapshot.
261 source_set("gen_snapshot_dart_io") { 303 source_set("gen_snapshot_dart_io") {
262 configs += ["..:dart_config", 304 configs += ["..:dart_config",
263 "..:dart_product_config", 305 "..:dart_maybe_product_config",
264 "..:dart_precompiler_config"] 306 "..:dart_precompiler_config"]
265 307
266 deps = [ 308 deps = [
267 "//third_party/zlib", 309 "$dart_zlib_path",
268 ] 310 ]
269 311
270 custom_sources_filter = [ 312 custom_sources_filter = [
271 "*_test.cc", 313 "*_test.cc",
272 "*_test.h", 314 "*_test.h",
273 "builtin.cc", 315 "builtin.cc",
274 "builtin_common.cc", 316 "builtin_common.cc",
275 "builtin_gen_snapshot.cc", 317 "builtin_gen_snapshot.cc",
276 ] 318 ]
277 if (!is_mac && !is_ios) { 319 if (!is_mac && !is_ios) {
(...skipping 14 matching lines...) Expand all
292 ] 334 ]
293 335
294 include_dirs = [ 336 include_dirs = [
295 "..", 337 "..",
296 "//third_party" 338 "//third_party"
297 ] 339 ]
298 } 340 }
299 341
300 source_set("libdart_embedder_noio") { 342 source_set("libdart_embedder_noio") {
301 configs += ["..:dart_config", 343 configs += ["..:dart_config",
302 "..:dart_product_config", 344 "..:dart_maybe_product_config"]
303 "..:dart_precompiled_runtime_config"]
304 deps = [ 345 deps = [
305 "..:libdart", 346 "..:libdart",
306 "../vm:libdart_platform",
307 ] 347 ]
308 } 348 }
309 349
310 350 # A source set for the implementation of 'dart:io' library.
311 # A source set for the implementation of 'dart:io' library
312 # (without secure sockets).
313 source_set("embedded_dart_io") { 351 source_set("embedded_dart_io") {
314 configs += ["..:dart_config", 352 configs += ["..:dart_config",
315 "..:dart_product_config", 353 "..:dart_maybe_product_config"]
316 "..:dart_precompiled_runtime_config"]
317
318 custom_sources_filter = [ 354 custom_sources_filter = [
319 "*_test.cc", 355 "*_test.cc",
320 "*_test.h", 356 "*_test.h",
321 "builtin.cc", 357 "builtin.cc",
322 "builtin_gen_snapshot.cc", 358 "builtin_gen_snapshot.cc",
323 ] 359 ]
324 if (!is_mac && !is_ios) { 360 if (!is_mac && !is_ios) {
325 # Dart tree uses *_macos.* instead of *_mac.* 361 # Dart tree uses *_macos.* instead of *_mac.*
326 custom_sources_filter += [ 362 custom_sources_filter += [
327 "*_macos.h", 363 "*_macos.h",
328 "*_macos.cc", 364 "*_macos.cc",
329 ] 365 ]
330 } 366 }
331 set_sources_assignment_filter(custom_sources_filter) 367 set_sources_assignment_filter(custom_sources_filter)
332 368
369 defines = []
333 if (is_mac || is_ios) { 370 if (is_mac || is_ios) {
334 libs = [ 371 libs = [
335 "CoreFoundation.framework", 372 "CoreFoundation.framework",
336 "CoreServices.framework", 373 "CoreServices.framework",
337 "Security.framework", 374 "Security.framework",
338 ] 375 ]
339 } else if (defined(is_fuchsia) && is_fuchsia) { 376 } else if (defined(is_fuchsia) && is_fuchsia) {
340 defines = [ 377 defines += [
341 "DART_IO_SECURE_SOCKET_DISABLED" 378 "DART_IO_SECURE_SOCKET_DISABLED"
342 ] 379 ]
343 } else { 380 } else {
344 deps = [ 381 deps = [
345 "//third_party/boringssl", 382 "//third_party/boringssl",
346 ] 383 ]
347 if (is_linux && !dart_use_fallback_root_certificates) {
348 defines = [
349 "DART_IO_ROOT_CERTS_DISABLED"
350 ]
351 }
352 } 384 }
353 385
354 sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources 386 sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources
355 sources += [ 387 sources += [
356 "builtin_nolib.cc", 388 "builtin_nolib.cc",
357 "builtin_natives.cc", 389 "builtin_natives.cc",
358 "io_natives.cc", 390 "io_natives.cc",
359 "io_natives.h", 391 "io_natives.h",
360 "embedded_dart_io.cc", 392 "embedded_dart_io.cc",
361 "embedded_dart_io.h", 393 "embedded_dart_io.h",
362 "log_android.cc", 394 "log_android.cc",
363 "log_linux.cc", 395 "log_linux.cc",
364 "log_macos.cc", 396 "log_macos.cc",
365 "log_win.cc", 397 "log_win.cc",
366 "log.h", 398 "log.h",
367 ] 399 ]
368 400
369 if (is_linux && dart_use_fallback_root_certificates) { 401 if (is_linux || is_win) {
370 sources += [ "//third_party/root_certificates/root_certificates.cc"] 402 if (dart_use_fallback_root_certificates) {
403 sources += [ "//third_party/root_certificates/root_certificates.cc"]
404 } else {
405 defines += [
406 "DART_IO_ROOT_CERTS_DISABLED",
407 ]
408 }
371 } 409 }
372 410
373 include_dirs = [ 411 include_dirs = [
374 "..", 412 "..",
375 "//third_party" 413 "//third_party"
376 ] 414 ]
377 } 415 }
378 416
379
380 action("generate_snapshot_bin") { 417 action("generate_snapshot_bin") {
381 deps = [ 418 deps = [
382 "../bin:gen_snapshot($host_toolchain)", 419 "../bin:gen_snapshot($host_toolchain)",
383 ] 420 ]
384 421
385 vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin" 422 vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin"
386 isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin" 423 isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin"
387 gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp" 424 gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp"
388 outputs = [ 425 outputs = [
389 vm_isolate_snapshot, 426 vm_isolate_snapshot,
(...skipping 12 matching lines...) Expand all
402 rebase_path(vm_isolate_snapshot, root_build_dir), 439 rebase_path(vm_isolate_snapshot, root_build_dir),
403 "--output_bin", 440 "--output_bin",
404 rebase_path(isolate_snapshot, root_build_dir), 441 rebase_path(isolate_snapshot, root_build_dir),
405 "--target_os", 442 "--target_os",
406 current_os, 443 current_os,
407 "--timestamp_file", 444 "--timestamp_file",
408 rebase_path(gen_snapshot_stamp_file, root_build_dir), 445 rebase_path(gen_snapshot_stamp_file, root_build_dir),
409 ] 446 ]
410 } 447 }
411 448
412
413 action("generate_snapshot_file") { 449 action("generate_snapshot_file") {
414 deps = [ 450 deps = [
415 ":generate_snapshot_bin", 451 ":generate_snapshot_bin",
416 ] 452 ]
417 453
418 snapshot_in_cc_file = "snapshot_in.cc" 454 snapshot_in_cc_file = "snapshot_in.cc"
419 inputs = [ 455 inputs = [
420 "../tools/create_snapshot_file.py", 456 "../tools/create_snapshot_file.py",
421 snapshot_in_cc_file, 457 snapshot_in_cc_file,
422 "$target_gen_dir/vm_isolate_snapshot.bin", 458 "$target_gen_dir/vm_isolate_snapshot.bin",
(...skipping 10 matching lines...) Expand all
433 rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"), 469 rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"),
434 "--input_bin", 470 "--input_bin",
435 rebase_path("$target_gen_dir/isolate_snapshot.bin"), 471 rebase_path("$target_gen_dir/isolate_snapshot.bin"),
436 "--input_cc", 472 "--input_cc",
437 rebase_path(snapshot_in_cc_file), 473 rebase_path(snapshot_in_cc_file),
438 "--output", 474 "--output",
439 rebase_path(output), 475 rebase_path(output),
440 ] 476 ]
441 } 477 }
442 478
443
444 source_set("dart_snapshot_cc") { 479 source_set("dart_snapshot_cc") {
445 sources = [ 480 sources = [
446 "$root_gen_dir/dart_snapshot.cc", 481 "$root_gen_dir/dart_snapshot.cc",
447 ] 482 ]
448 483
449 deps = [ 484 deps = [
450 ":generate_snapshot_file", 485 ":generate_snapshot_file",
451 ] 486 ]
452 } 487 }
453 488
489 template("dart_executable") {
490 extra_configs = []
491 if (defined(invoker.extra_configs)) {
492 extra_configs += invoker.extra_configs
493 }
494 extra_deps = []
495 if (defined(invoker.extra_deps)) {
496 extra_deps += invoker.extra_deps
497 }
498 extra_defines = []
499 if (defined(invoker.extra_defines)) {
500 extra_defines = invoker.extra_defines
501 }
502 extra_sources = []
503 if (defined(invoker.extra_sources)) {
504 extra_sources += invoker.extra_sources
505 }
506 executable(target_name) {
507 configs += [
508 "..:dart_config",
509 "..:dart_maybe_product_config"
510 ] + extra_configs
511
512 deps = [
513 ":gen_resources_cc",
514 ":embedded_dart_io",
515 ":libdart_builtin",
516 "$dart_zlib_path",
517 ] + extra_deps
518
519 defines = extra_defines
520
521 sources = [
522 "main.cc",
523 "vmservice_impl.cc",
524 "vmservice_impl.h",
525 "$target_gen_dir/resources_gen.cc",
526 ] + extra_sources
527
528 include_dirs = [
529 "..",
530 "//third_party",
531 ]
532
533 ldflags = [
534 "-rdynamic",
535 ]
536 }
537 }
538
539 if (!defined(is_fuchsia) || !is_fuchsia) {
540 dart_executable("dart") {
541 extra_deps = [
542 "..:libdart",
543 ":dart_snapshot_cc",
544 "../observatory:standalone_observatory_archive",
545 ]
546 }
547
548 dart_executable("dart_precompiled_runtime") {
549 extra_configs = [
550 "..:dart_precompiled_runtime_config"
551 ]
552 extra_deps = [
553 "..:libdart_precompiled_runtime",
554 ":dart_snapshot_cc",
555 "../observatory:standalone_observatory_archive",
556 ]
557 }
558 }
559
560 dart_executable("dart_bootstrap") {
561 extra_configs = [
562 "..:dart_precompiler_config",
563 "..:dart_no_snapshot_config",
564 ]
565 extra_deps = [
566 "..:libdart",
567 ]
568 extra_defines = [
569 "NO_OBSERVATORY",
570 ]
571 extra_sources = [
572 "observatory_assets_empty.cc",
573 "snapshot_empty.cc",
574 ]
575 }
576
454 if (defined(is_fuchsia) && is_fuchsia) { 577 if (defined(is_fuchsia) && is_fuchsia) {
455 copy("hello_fuchsia") { 578 copy("hello_fuchsia") {
456 sources = [ "../tests/vm/dart/hello_fuchsia_test.dart" ] 579 sources = [ "../tests/vm/dart/hello_fuchsia_test.dart" ]
457 outputs = [ "$root_out_dir/hello_fuchsia.dart" ] 580 outputs = [ "$root_out_dir/hello_fuchsia.dart" ]
458 } 581 }
459 }
460
461 executable("dart_no_observatory") {
462 configs += ["..:dart_config",
463 "..:dart_product_config",
464 "..:dart_precompiled_runtime_config",]
465 deps = [
466 ":gen_resources_cc",
467 ":embedded_dart_io",
468 ":libdart_builtin",
469 "../vm:libdart_platform",
470 "..:libdart",
471 ":dart_snapshot_cc",
472 "//third_party/zlib",
473 ]
474
475 if (defined(is_fuchsia) && is_fuchsia) {
476 deps += [
477 ":hello_fuchsia",
478 ]
479 }
480
481 defines = [
482 "NO_OBSERVATORY",
483 ]
484
485 sources = [
486 "main.cc",
487 "observatory_assets_empty.cc",
488 "vmservice_impl.cc",
489 "vmservice_impl.h",
490 "$target_gen_dir/resources_gen.cc",
491 ]
492
493 include_dirs = [
494 "..",
495 "//third_party",
496 ]
497 }
498
499
500 if (defined(is_fuchsia) && is_fuchsia) {
501 action("generate_snapshot_test_dat_file") {
502 snapshot_test_dat_file = "$root_gen_dir/snapshot_test.dat"
503 snapshot_test_in_dat_file = "../vm/snapshot_test_in.dat"
504 snapshot_test_dart_file = "../vm/snapshot_test.dart"
505 inputs = [
506 "../tools/create_string_literal.py",
507 snapshot_test_in_dat_file,
508 snapshot_test_dart_file,
509 ]
510
511 outputs = [
512 snapshot_test_dat_file,
513 ]
514
515 script = "../tools/create_string_literal.py"
516 args = [
517 "--output",
518 rebase_path(snapshot_test_dat_file),
519 "--input_cc",
520 rebase_path(snapshot_test_in_dat_file),
521 "--include",
522 "INTENTIONALLY_LEFT_BLANK",
523 "--var_name",
524 "INTENTIONALLY_LEFT_BLANK_TOO",
525 rebase_path(snapshot_test_dart_file),
526 ]
527 }
528
529 executable("run_vm_tests") {
530 testonly = true
531 configs += ["..:dart_config",
532 "..:dart_product_config",
533 "..:dart_precompiled_runtime_config",]
534 deps = [
535 "..:libdart",
536 ":libdart_builtin",
537 ":embedded_dart_io",
538 ":dart_snapshot_cc",
539 ":generate_snapshot_test_dat_file",
540 "../vm:libdart_platform",
541 "//third_party/zlib",
542 ]
543 include_dirs = [
544 "..",
545 "$target_gen_dir",
546 ]
547 defines = [
548 "TESTING",
549 ]
550
551 vm_tests_list = exec_script("../../tools/gypi_to_gn.py",
552 [rebase_path("../vm/vm_sources.gypi"),
553 "--keep_only=_test.cc",
554 "--keep_only=_test.h",],
555 "scope",
556 ["../vm/vm_sources.gypi"])
557 vm_tests = rebase_path(vm_tests_list.sources, ".", "../vm")
558
559 builtin_impl_tests_list =
560 exec_script("../../tools/gypi_to_gn.py",
561 [rebase_path("builtin_impl_sources.gypi"),
562 "--keep_only=_test.cc",
563 "--keep_only=_test.h",],
564 "scope",
565 ["builtin_impl_sources.gypi"])
566
567 sources = [
568 "run_vm_tests.cc",
569 ] + builtin_impl_tests_list.sources + vm_tests
570 }
571 582
572 executable("run_vm_tests_fuchsia") { 583 executable("run_vm_tests_fuchsia") {
573 testonly = true 584 testonly = true
574 configs += ["..:dart_config"] 585 configs += ["..:dart_config"]
575 sources = [ 586 sources = [
576 "run_vm_tests_fuchsia.cc" 587 "run_vm_tests_fuchsia.cc"
577 ] 588 ]
578 libs = [ 589 libs = [
579 "launchpad", 590 "launchpad",
580 "magenta", 591 "magenta",
581 "runtime", 592 "runtime",
582 ] 593 ]
583 } 594 }
584 } # defined(is_fuchsia) && is_fuchsia 595 }
596
597 # This is only needed for the Fuchsia target build until the Observatory is
598 # supported.
599 dart_executable("dart_no_observatory") {
600 extra_deps = [
601 "..:libdart",
602 ":dart_snapshot_cc",
603 ]
604 if (defined(is_fuchsia) && is_fuchsia) {
605 extra_deps += [ ":hello_fuchsia" ]
606 }
607 extra_defines = [
608 "NO_OBSERVATORY",
609 ]
610 extra_sources = [
611 "observatory_assets_empty.cc",
612 ]
613 }
614
615 executable("process_test") {
616 sources = [
617 "process_test.cc",
618 ]
619 }
620
621 action("generate_snapshot_test_dat_file") {
622 snapshot_test_dat_file = "$root_gen_dir/snapshot_test.dat"
623 snapshot_test_in_dat_file = "../vm/snapshot_test_in.dat"
624 snapshot_test_dart_file = "../vm/snapshot_test.dart"
625 inputs = [
626 "../tools/create_string_literal.py",
627 snapshot_test_in_dat_file,
628 snapshot_test_dart_file,
629 ]
630
631 outputs = [
632 snapshot_test_dat_file,
633 ]
634
635 script = "../tools/create_string_literal.py"
636 args = [
637 "--output",
638 rebase_path(snapshot_test_dat_file),
639 "--input_cc",
640 rebase_path(snapshot_test_in_dat_file),
641 "--include",
642 "INTENTIONALLY_LEFT_BLANK",
643 "--var_name",
644 "INTENTIONALLY_LEFT_BLANK_TOO",
645 rebase_path(snapshot_test_dart_file),
646 ]
647 }
648
649 executable("run_vm_tests") {
650 configs += ["..:dart_config",
651 "..:dart_maybe_product_config"]
652 deps = [
653 "..:libdart",
654 ":libdart_builtin",
655 ":embedded_dart_io",
656 ":dart_snapshot_cc",
657 ":generate_snapshot_test_dat_file",
658 "$dart_zlib_path",
659 ]
660 include_dirs = [
661 "..",
662 "$target_gen_dir",
663 ]
664 defines = [
665 "TESTING",
666 ]
667
668 # The VM sources are already included in libdart, so we just want to add in
669 # the tests here.
670 vm_tests_list = exec_script("../../tools/gypi_to_gn.py",
671 [rebase_path("../vm/vm_sources.gypi"),
672 "--keep_only=_test.cc",
673 "--keep_only=_test.h",],
674 "scope",
675 ["../vm/vm_sources.gypi"])
676 vm_tests = rebase_path(vm_tests_list.sources, ".", "../vm")
677
678 builtin_impl_tests_list =
679 exec_script("../../tools/gypi_to_gn.py",
680 [rebase_path("builtin_impl_sources.gypi"),
681 "--keep_only=_test.cc",
682 "--keep_only=_test.h",],
683 "scope",
684 ["builtin_impl_sources.gypi"])
685
686 sources = [
687 "run_vm_tests.cc",
688 ] + builtin_impl_tests_list.sources + vm_tests
689
690 ldflags = [
691 "-rdynamic",
692 ]
693 }
694
695 if (!defined(is_fuchsia) || !is_fuchsia) {
696 shared_library("test_extension") {
697 deps = [
698 ":dart",
699 ]
700 sources = [
701 "test_extension.c",
702 "test_extension_dllmain_win.cc",
703 ]
704 include_dirs = [
705 "..",
706 ]
707 defines = [
708 # The only effect of DART_SHARED_LIB is to export the Dart API.
709 "DART_SHARED_LIB",
710 ]
711 }
712
713 shared_library("sample_extension") {
714 deps = [
715 ":dart",
716 ]
717 sources = [
718 "../../samples/sample_extension/sample_extension.cc",
719 "../../samples/sample_extension/sample_extension_dllmain_win.cc",
720 ]
721 include_dirs = [
722 "..",
723 ]
724 defines = [
725 # The only effect of DART_SHARED_LIB is to export the Dart API.
726 "DART_SHARED_LIB",
727 ]
728 }
729 }
OLDNEW
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/bin/bin.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698