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

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

Issue 2975343002: Add libdart PRODUCT targets for Fuchsia's dart_runner (Closed)
Patch Set: Created 3 years, 5 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/vm/BUILD.gn » ('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 import("gypi_contents.gni") 5 import("gypi_contents.gni")
6 import("../runtime_args.gni") 6 import("../runtime_args.gni")
7 import("../../build/compiled_action.gni") 7 import("../../build/compiled_action.gni")
8 8
9 declare_args() { 9 declare_args() {
10 # Controls the kind of core snapshot linked into the standalone VM. Using a 10 # Controls the kind of core snapshot linked into the standalone VM. Using a
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 libs = [ "dl" ] 225 libs = [ "dl" ]
226 } 226 }
227 if (is_android) { 227 if (is_android) {
228 libs += [ 228 libs += [
229 "android", 229 "android",
230 "log", 230 "log",
231 ] 231 ]
232 } 232 }
233 } 233 }
234 234
235 static_library("libdart_builtin") { 235 template("build_libdart_builtin") {
236 configs += [ 236 extra_configs = []
237 "..:dart_config", 237 if (defined(invoker.extra_configs)) {
238 "..:dart_maybe_product_config", 238 extra_configs += invoker.extra_configs
239 ] 239 }
240 if (is_fuchsia) { 240 static_library(target_name) {
241 configs -= [ "//build/config:symbol_visibility_hidden" ] 241 configs += [ "..:dart_config" ] + extra_configs
242 } 242 if (is_fuchsia) {
243 public_configs = [ ":libdart_builtin_config" ] 243 configs -= [ "//build/config:symbol_visibility_hidden" ]
244 deps = [ 244 }
245 ":generate_blink_cc_file", 245 public_configs = [ ":libdart_builtin_config" ]
246 ":generate_builtin_cc_file", 246 deps = [
247 ":generate_cached_patches_cc_file", 247 ":generate_blink_cc_file",
248 ":generate_html_cc_file", 248 ":generate_builtin_cc_file",
249 ":generate_html_common_cc_file", 249 ":generate_cached_patches_cc_file",
250 ":generate_indexed_db_cc_file", 250 ":generate_html_cc_file",
251 ":generate_io_cc_file", 251 ":generate_html_common_cc_file",
252 ":generate_io_patch_cc_file", 252 ":generate_indexed_db_cc_file",
253 ":generate_js_cc_file", 253 ":generate_io_cc_file",
254 ":generate_js_util_cc_file", 254 ":generate_io_patch_cc_file",
255 ":generate_metadata_cc_file", 255 ":generate_js_cc_file",
256 ":generate_svg_cc_file", 256 ":generate_js_util_cc_file",
257 ":generate_web_audio_cc_file", 257 ":generate_metadata_cc_file",
258 ":generate_web_gl_cc_file", 258 ":generate_svg_cc_file",
259 ":generate_web_sql_cc_file", 259 ":generate_web_audio_cc_file",
260 ] 260 ":generate_web_gl_cc_file",
261 include_dirs = [ ".." ] 261 ":generate_web_sql_cc_file",
262 set_sources_assignment_filter([ 262 ]
263 "*_test.cc", 263 include_dirs = [ ".." ]
264 "*_test.h", 264 set_sources_assignment_filter([
265 ]) 265 "*_test.cc",
266 sources = [ 266 "*_test.h",
267 "log_android.cc", 267 ])
268 "log_fuchsia.cc", 268 sources = [
269 "log_linux.cc", 269 "log_android.cc",
270 "log_macos.cc", 270 "log_fuchsia.cc",
271 "log_win.cc", 271 "log_linux.cc",
272 ] + builtin_impl_sources_gypi 272 "log_macos.cc",
273 } 273 "log_win.cc",
274 274 ] + builtin_impl_sources_gypi
275 executable("gen_snapshot") { 275 }
276 configs += [ 276 }
277 "..:dart_config", 277
278 "..:dart_maybe_product_config", 278 build_libdart_builtin("libdart_builtin") {
279 "..:dart_precompiler_config", 279 extra_configs = [ "..:dart_maybe_product_config" ]
280 ] 280 }
281 if (is_fuchsia) { 281
282 configs -= [ "//build/config:symbol_visibility_hidden" ] 282 build_libdart_builtin("libdart_builtin_product") {
283 } 283 extra_configs = [ "..:dart_product_config" ]
284 deps = [ 284 }
285 ":gen_resources_cc", 285
286 template("build_gen_snapshot") {
287 extra_configs = []
288 if (defined(invoker.extra_configs)) {
289 extra_configs += invoker.extra_configs
290 }
291 extra_deps = []
292 if (defined(invoker.extra_deps)) {
293 extra_deps += invoker.extra_deps
294 }
295 executable(target_name) {
296 configs += [
297 "..:dart_config",
298 "..:dart_precompiler_config",
299 ] + extra_configs
300 if (is_fuchsia) {
301 configs -= [ "//build/config:symbol_visibility_hidden" ]
302 }
303 deps = [
304 ":gen_resources_cc",
305 ":generate_builtin_cc_file",
306 ":generate_io_cc_file",
307 ":generate_io_patch_cc_file",
308 ] + extra_deps
309
310 sources = [
311 # Include generated source files.
312 "$target_gen_dir/builtin_gen.cc",
313 "$target_gen_dir/io_gen.cc",
314 "$target_gen_dir/io_patch_gen.cc",
315 "$target_gen_dir/resources_gen.cc",
316 "address_sanitizer.cc",
317 "builtin.cc",
318 "builtin.h",
319 "loader.cc",
320 "loader.h",
321
322 # Very limited native resolver provided.
323 "builtin_common.cc",
324 "builtin_gen_snapshot.cc",
325 "dfe.cc",
326 "dfe.h",
327 "gen_snapshot.cc",
328 "vmservice_impl.cc",
329 "vmservice_impl.h",
330 ]
331
332 include_dirs = [ ".." ]
333
334 if (dart_use_tcmalloc) {
335 deps += [ "//third_party/tcmalloc" ]
336 }
337
338 if (is_mac) {
339 libs = [
340 "CoreFoundation.framework",
341 "CoreServices.framework",
342 ]
343 }
344
345 if (is_win) {
346 libs = [
347 "iphlpapi.lib",
348 "psapi.lib",
349 "ws2_32.lib",
350 "Rpcrt4.lib",
351 "winmm.lib",
352 ]
353 }
354
355 if (is_fuchsia) {
356 libs = [ "launchpad" ]
357 }
358 }
359 }
360
361 build_gen_snapshot("gen_snapshot") {
362 extra_configs = [ "..:dart_maybe_product_config" ]
363 extra_deps = [
286 ":gen_snapshot_dart_io", 364 ":gen_snapshot_dart_io",
287 ":generate_builtin_cc_file",
288 ":generate_io_cc_file",
289 ":generate_io_patch_cc_file",
290 ":libdart_builtin", 365 ":libdart_builtin",
291 "..:libdart_nosnapshot_with_precompiler", 366 "..:libdart_nosnapshot_with_precompiler",
292 ] 367 ]
293 368 }
294 sources = [ 369
295 # Include generated source files. 370
296 "$target_gen_dir/builtin_gen.cc", 371 build_gen_snapshot("gen_snapshot_product") {
297 "$target_gen_dir/io_gen.cc", 372 extra_configs = [ "..:dart_product_config" ]
298 "$target_gen_dir/io_patch_gen.cc", 373 extra_deps = [
299 "$target_gen_dir/resources_gen.cc", 374 ":gen_snapshot_dart_io_product",
300 "address_sanitizer.cc", 375 ":libdart_builtin_product",
301 "builtin.cc", 376 "..:libdart_nosnapshot_with_precompiler_product",
302 "builtin.h",
303 "loader.cc",
304 "loader.h",
305
306 # Very limited native resolver provided.
307 "builtin_common.cc",
308 "builtin_gen_snapshot.cc",
309 "dfe.cc",
310 "dfe.h",
311 "gen_snapshot.cc",
312 "vmservice_impl.cc",
313 "vmservice_impl.h",
314 ] 377 ]
315 378 }
316 include_dirs = [ ".." ] 379
317
318 if (dart_use_tcmalloc) {
319 deps += [ "//third_party/tcmalloc" ]
320 }
321
322 if (is_mac) {
323 libs = [
324 "CoreFoundation.framework",
325 "CoreServices.framework",
326 ]
327 }
328
329 if (is_win) {
330 libs = [
331 "iphlpapi.lib",
332 "psapi.lib",
333 "ws2_32.lib",
334 "Rpcrt4.lib",
335 "winmm.lib",
336 ]
337 }
338
339 if (is_fuchsia) {
340 libs = [ "launchpad" ]
341 }
342 }
343 380
344 # A source set for the implementation of 'dart:io' library 381 # A source set for the implementation of 'dart:io' library
345 # (without secure sockets) suitable for linking with gen_snapshot. 382 # (without secure sockets) suitable for linking with gen_snapshot.
346 source_set("gen_snapshot_dart_io") { 383 template("build_gen_snapshot_dart_io") {
347 configs += [ 384 extra_configs = []
348 "..:dart_config", 385 if (defined(invoker.extra_configs)) {
349 "..:dart_maybe_product_config", 386 extra_configs += invoker.extra_configs
350 "..:dart_precompiler_config", 387 }
351 ] 388 source_set(target_name) {
352 if (is_fuchsia) { 389 configs += [
353 configs -= [ "//build/config:symbol_visibility_hidden" ] 390 "..:dart_config",
354 } 391 "..:dart_precompiler_config",
355 392 ] + extra_configs
356 deps = [ 393 if (is_fuchsia) {
357 "$dart_zlib_path", 394 configs -= [ "//build/config:symbol_visibility_hidden" ]
358 ] 395 }
359 396
360 custom_sources_filter = [ 397 deps = [
361 "*_test.cc", 398 "$dart_zlib_path",
362 "*_test.h", 399 ]
363 "builtin.cc", 400
364 "builtin_common.cc", 401 custom_sources_filter = [
365 "builtin_gen_snapshot.cc", 402 "*_test.cc",
366 ] 403 "*_test.h",
367 if (!is_mac && !is_ios) { 404 "builtin.cc",
368 # Dart tree uses *_macos.* instead of *_mac.* 405 "builtin_common.cc",
369 custom_sources_filter += [ 406 "builtin_gen_snapshot.cc",
370 "*_macos.h", 407 ]
371 "*_macos.cc", 408 if (!is_mac && !is_ios) {
372 ] 409 # Dart tree uses *_macos.* instead of *_mac.*
373 } 410 custom_sources_filter += [
374 set_sources_assignment_filter(custom_sources_filter) 411 "*_macos.h",
375 412 "*_macos.cc",
376 defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ] 413 ]
377 414 }
378 sources = io_impl_sources_gypi + builtin_impl_sources_gypi 415 set_sources_assignment_filter(custom_sources_filter)
379 sources += [ 416
380 "io_natives.cc", 417 defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ]
381 "io_natives.h", 418
382 ] 419 sources = io_impl_sources_gypi + builtin_impl_sources_gypi
383 420 sources += [
384 include_dirs = [ 421 "io_natives.cc",
385 "..", 422 "io_natives.h",
386 "//third_party", 423 ]
387 ] 424
425 include_dirs = [
426 "..",
427 "//third_party",
428 ]
429 }
430 }
431
432 build_gen_snapshot_dart_io("gen_snapshot_dart_io") {
433 extra_configs = [ "..:dart_maybe_product_config" ]
434 }
435
436 build_gen_snapshot_dart_io("gen_snapshot_dart_io_product") {
437 extra_configs = [ "..:dart_product_config" ]
388 } 438 }
389 439
390 # A source set for the implementation of 'dart:io' library. 440 # A source set for the implementation of 'dart:io' library.
391 template("dart_io") { 441 template("dart_io") {
442 extra_configs = []
443 if (defined(invoker.extra_configs)) {
444 extra_configs += invoker.extra_configs
445 }
392 extra_sources = [] 446 extra_sources = []
393 if (defined(invoker.extra_sources)) { 447 if (defined(invoker.extra_sources)) {
394 extra_sources += invoker.extra_sources 448 extra_sources += invoker.extra_sources
395 } 449 }
396 source_set(target_name) { 450 source_set(target_name) {
397 configs += [ 451 configs += [ "..:dart_config" ] + extra_configs
398 "..:dart_config", 452 if (is_fuchsia) {
399 "..:dart_maybe_product_config", 453 configs -= [ "//build/config:symbol_visibility_hidden" ]
400 ] 454 }
401 if (is_fuchsia) {
402 configs -= [ "//build/config:symbol_visibility_hidden" ]
403 }
404 custom_sources_filter = [ 455 custom_sources_filter = [
405 "*_test.cc", 456 "*_test.cc",
406 "*_test.h", 457 "*_test.h",
407 "builtin.cc", 458 "builtin.cc",
408 "builtin_gen_snapshot.cc", 459 "builtin_gen_snapshot.cc",
409 ] 460 ]
410 if (!is_mac && !is_ios) { 461 if (!is_mac && !is_ios) {
411 # Dart tree uses *_macos.* instead of *_mac.* 462 # Dart tree uses *_macos.* instead of *_mac.*
412 custom_sources_filter += [ 463 custom_sources_filter += [
413 "*_macos.h", 464 "*_macos.h",
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 509 }
459 510
460 include_dirs = [ 511 include_dirs = [
461 "..", 512 "..",
462 "//third_party", 513 "//third_party",
463 ] 514 ]
464 } 515 }
465 } 516 }
466 517
467 dart_io("embedded_dart_io") { 518 dart_io("embedded_dart_io") {
519 extra_configs = [ "..:dart_maybe_product_config" ]
468 extra_sources = [ 520 extra_sources = [
469 "builtin_nolib.cc", 521 "builtin_nolib.cc",
470 "embedded_dart_io.cc", 522 "embedded_dart_io.cc",
523 "embedded_dart_io.h",
524 ]
525 }
526
527 dart_io("embedded_dart_io_product") {
528 extra_configs = [ "..:dart_product_config" ]
529 extra_sources = [
530 "builtin_nolib.cc",
531 "embedded_dart_io.cc",
471 "embedded_dart_io.h", 532 "embedded_dart_io.h",
472 ] 533 ]
473 } 534 }
474 535
475 dart_io("standalone_dart_io") { 536 dart_io("standalone_dart_io") {
537 extra_configs = [ "..:dart_maybe_product_config" ]
476 extra_sources = [] 538 extra_sources = []
477 } 539 }
478 540
479 compiled_action("generate_snapshot_bin") { 541 compiled_action("generate_snapshot_bin") {
480 vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin" 542 vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin"
481 vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin" 543 vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin"
482 isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin" 544 isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin"
483 isolate_snapshot_instructions = 545 isolate_snapshot_instructions =
484 "$target_gen_dir/isolate_snapshot_instructions.bin" 546 "$target_gen_dir/isolate_snapshot_instructions.bin"
485 547
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 ] 1023 ]
962 if (is_linux || is_android) { 1024 if (is_linux || is_android) {
963 cflags = [ "-fPIC" ] 1025 cflags = [ "-fPIC" ]
964 } 1026 }
965 if (is_win) { 1027 if (is_win) {
966 libs = [ "dart.lib" ] 1028 libs = [ "dart.lib" ]
967 abs_root_out_dir = rebase_path(root_out_dir) 1029 abs_root_out_dir = rebase_path(root_out_dir)
968 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] 1030 ldflags = [ "/LIBPATH:$abs_root_out_dir" ]
969 } 1031 }
970 } 1032 }
OLDNEW
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/vm/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698