OLD | NEW |
---|---|
1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2017, 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 # This GN file contains build rules for assembling the Dart SDK. There are | 5 # This GN file contains build rules for assembling the Dart SDK. There are |
6 # two possible variants: the "Full" SDK, and the "Platform" SDK. If you want | 6 # two possible variants: the "Full" SDK, and the "Platform" SDK. If you want |
7 # to make a new subset of the Full SDK, make it the same way we make | 7 # to make a new subset of the Full SDK, make it the same way we make |
8 # the Platform SDK. | 8 # the Platform SDK. |
9 # | 9 # |
10 # Warning: | 10 # Warning: |
11 # If you need to copy something into dart-sdk/lib/foo in addition to the stuff | 11 # If you need to copy something into dart-sdk/lib/foo in addition to the stuff |
12 # copied there by :copy_libraries, then you must depend on ":copy_libraries", | 12 # copied there by :copy_libraries, then you must depend on ":copy_libraries", |
13 # or ":copy_libraries" may delete/overwrite your addition, and the build will | 13 # or ":copy_libraries" may delete/overwrite your addition, and the build will |
14 # fail. | 14 # fail. |
15 | 15 |
16 import("../build/copy_tree.gni") | 16 import("../build/copy_tree.gni") |
17 | 17 |
18 declare_args() { | 18 declare_args() { |
19 # Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries. | 19 # Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries. |
20 dart_platform_sdk = false | 20 dart_platform_sdk = false |
21 } | 21 } |
22 | 22 |
23 if (is_fuchsia || is_fuchsia_host) { | 23 if (is_fuchsia || |
24 is_fuchsia_host || | |
25 current_cpu == "arm64" || | |
26 current_cpu == "arm") { | |
24 dart_platform_sdk = true | 27 dart_platform_sdk = true |
25 } | 28 } |
26 | 29 |
27 # The directory layout of the SDK is as follows: | 30 # The directory layout of the SDK is as follows: |
28 # | 31 # |
29 # ..dart-sdk/ | 32 # ..dart-sdk/ |
30 # ....bin/ | 33 # ....bin/ |
31 # ......dart or dart.exe (executable) | 34 # ......dart or dart.exe (executable) |
32 # ......dart.lib (import library for VM native extensions on Windows) | 35 # ......dart.lib (import library for VM native extensions on Windows) |
33 # ......dartdoc | 36 # ......dartdoc |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
452 ] | 455 ] |
453 outputs = [ | 456 outputs = [ |
454 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", | 457 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", |
455 ] | 458 ] |
456 } | 459 } |
457 | 460 |
458 # This rule copies js needed by ddc to lib/dev_compiler | 461 # This rule copies js needed by ddc to lib/dev_compiler |
459 copy_tree("copy_dev_compiler_js") { | 462 copy_tree("copy_dev_compiler_js") { |
460 visibility = [ | 463 visibility = [ |
461 ":copy_dev_compiler_sdk", | 464 ":copy_dev_compiler_sdk", |
462 ":copy_dev_compiler_require_js", | 465 ":copy_dev_compiler_require_js", |
zra
2017/05/22 21:34:45
Hmm. I was expecting that you'd have to add ":copy
Jacob
2017/05/22 21:49:30
Done.
| |
463 ] | 466 ] |
464 source = "../pkg/dev_compiler/lib/js" | 467 source = "../pkg/dev_compiler/lib/js" |
465 dest = "$root_out_dir/dart-sdk/lib/dev_compiler" | 468 dest = "$root_out_dir/dart-sdk/lib/dev_compiler" |
466 } | 469 } |
467 | 470 |
468 # This rule copies require.js to lib/dev_compiler/amd | 471 # This rule copies require.js to lib/dev_compiler/amd |
469 copy("copy_dev_compiler_require_js") { | 472 copy("copy_dev_compiler_require_js") { |
470 visibility = [ ":copy_dev_compiler_sdk" ] | 473 visibility = [ ":copy_dev_compiler_sdk" ] |
471 deps = [ | 474 deps = [ |
472 ":copy_dev_compiler_js", | 475 ":copy_dev_compiler_js", |
473 ] | 476 ] |
474 sources = [ | 477 sources = [ |
475 "../third_party/requirejs/require.js", | 478 "../third_party/requirejs/require.js", |
476 ] | 479 ] |
477 outputs = [ | 480 outputs = [ |
478 "$root_out_dir/dart-sdk/lib/dev_compiler/amd/{{source_file_part}}", | 481 "$root_out_dir/dart-sdk/lib/dev_compiler/amd/{{source_file_part}}", |
479 ] | 482 ] |
480 } | 483 } |
481 | 484 |
485 # This rule copies tools to go along with ddc. | |
486 copy("copy_dev_compiler_tools") { | |
487 visibility = [ ":copy_dev_compiler_sdk" ] | |
488 deps = [ | |
489 ":copy_dev_compiler_js", | |
490 "../utils/dartdevc:dartdevc_web", | |
491 "../utils/dartdevc:stack_trace_mapper", | |
492 ] | |
493 dart_out = get_label_info("../utils/dartdevc:dartdevc_web", "root_out_dir") | |
494 sources = [ | |
495 "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js", | |
496 "$dart_out/dev_compiler/build/web/ddc_web_compiler.js", | |
497 ] | |
498 outputs = [ | |
499 "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}", | |
500 ] | |
501 } | |
502 | |
482 # This is the main rule for copying ddc's dependencies to lib/ | 503 # This is the main rule for copying ddc's dependencies to lib/ |
483 group("copy_dev_compiler_sdk") { | 504 group("copy_dev_compiler_sdk") { |
484 visibility = [ ":create_full_sdk" ] | 505 visibility = [ ":create_full_sdk" ] |
485 deps = [ | 506 deps = [ |
486 ":copy_dev_compiler_js", | 507 ":copy_dev_compiler_js", |
487 ":copy_dev_compiler_require_js", | 508 ":copy_dev_compiler_require_js", |
488 ":copy_dev_compiler_summary", | 509 ":copy_dev_compiler_summary", |
510 ":copy_dev_compiler_tools", | |
489 ] | 511 ] |
490 } | 512 } |
491 | 513 |
492 # This rule copies header files to include/ | 514 # This rule copies header files to include/ |
493 copy("copy_headers") { | 515 copy("copy_headers") { |
494 visibility = [ ":create_common_sdk" ] | 516 visibility = [ ":create_common_sdk" ] |
495 sources = [ | 517 sources = [ |
496 "../runtime/include/dart_api.h", | 518 "../runtime/include/dart_api.h", |
497 "../runtime/include/dart_mirrors_api.h", | 519 "../runtime/include/dart_mirrors_api.h", |
498 "../runtime/include/dart_native_api.h", | 520 "../runtime/include/dart_native_api.h", |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
704 deps = [ | 726 deps = [ |
705 ":copy_platform_sdk_libraries", | 727 ":copy_platform_sdk_libraries", |
706 ":copy_platform_sdk_scripts", | 728 ":copy_platform_sdk_scripts", |
707 ":copy_platform_sdk_snapshots", | 729 ":copy_platform_sdk_snapshots", |
708 ] | 730 ] |
709 } | 731 } |
710 | 732 |
711 # Parts specific to the full SDK. | 733 # Parts specific to the full SDK. |
712 group("create_full_sdk") { | 734 group("create_full_sdk") { |
713 visibility = [ | 735 visibility = [ |
714 ":copy_dev_compiler_tools", | |
715 ":create_sdk", | 736 ":create_sdk", |
716 ] | 737 ] |
738 | |
717 deps = [ | 739 deps = [ |
718 ":copy_dev_compiler_sdk", | 740 ":copy_dev_compiler_sdk", |
719 ":copy_full_sdk_libraries", | 741 ":copy_full_sdk_libraries", |
720 ":copy_full_sdk_scripts", | 742 ":copy_full_sdk_scripts", |
721 ":copy_full_sdk_snapshots", | 743 ":copy_full_sdk_snapshots", |
722 ] | 744 ] |
723 } | 745 } |
724 | 746 |
725 # The main target to depend on from ../BUILD.gn | 747 # The main target to depend on from ../BUILD.gn |
726 group("create_sdk") { | 748 group("create_sdk") { |
727 deps = [ | 749 deps = [ |
728 ":create_common_sdk", | 750 ":create_common_sdk", |
729 ] | 751 ] |
730 if (dart_platform_sdk) { | 752 if (dart_platform_sdk) { |
731 deps += [ ":create_platform_sdk" ] | 753 deps += [ ":create_platform_sdk" ] |
732 } else { | 754 } else { |
733 deps += [ ":create_full_sdk" ] | 755 deps += [ ":create_full_sdk" ] |
734 } | 756 } |
735 } | 757 } |
736 | |
737 # This rule copies tools to go along with ddc. | |
738 copy("copy_dev_compiler_tools") { | |
739 deps = [ | |
740 ":create_full_sdk", | |
741 "../utils/dartdevc:dartdevc_web", | |
742 "../utils/dartdevc:stack_trace_mapper", | |
743 ] | |
744 dart_out = get_label_info("../utils/dartdevc:dartdevc_web", "root_out_dir") | |
745 sources = [ | |
746 "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js", | |
747 "$dart_out/dev_compiler/build/web/ddc_web_compiler.js", | |
748 ] | |
749 outputs = [ | |
750 "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}", | |
751 ] | |
752 } | |
OLD | NEW |