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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 = [ | |
zra
2017/05/22 20:56:09
This also needs to depend on ":copy_dev_compiler_j
Jacob
2017/05/22 21:29:02
Done.
| |
489 "../utils/dartdevc:dartdevc_web", | |
490 "../utils/dartdevc:stack_trace_mapper", | |
491 ] | |
492 dart_out = get_label_info("../utils/dartdevc:dartdevc_web", "root_out_dir") | |
493 sources = [ | |
494 "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js", | |
495 "$dart_out/dev_compiler/build/web/ddc_web_compiler.js", | |
496 ] | |
497 outputs = [ | |
498 "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}", | |
499 ] | |
500 } | |
501 | |
482 # This is the main rule for copying ddc's dependencies to lib/ | 502 # This is the main rule for copying ddc's dependencies to lib/ |
483 group("copy_dev_compiler_sdk") { | 503 group("copy_dev_compiler_sdk") { |
484 visibility = [ ":create_full_sdk" ] | 504 visibility = [ ":create_full_sdk" ] |
485 deps = [ | 505 deps = [ |
486 ":copy_dev_compiler_js", | 506 ":copy_dev_compiler_js", |
487 ":copy_dev_compiler_require_js", | 507 ":copy_dev_compiler_require_js", |
488 ":copy_dev_compiler_summary", | 508 ":copy_dev_compiler_summary", |
509 ":copy_dev_compiler_tools", | |
489 ] | 510 ] |
490 } | 511 } |
491 | 512 |
492 # This rule copies header files to include/ | 513 # This rule copies header files to include/ |
493 copy("copy_headers") { | 514 copy("copy_headers") { |
494 visibility = [ ":create_common_sdk" ] | 515 visibility = [ ":create_common_sdk" ] |
495 sources = [ | 516 sources = [ |
496 "../runtime/include/dart_api.h", | 517 "../runtime/include/dart_api.h", |
497 "../runtime/include/dart_mirrors_api.h", | 518 "../runtime/include/dart_mirrors_api.h", |
498 "../runtime/include/dart_native_api.h", | 519 "../runtime/include/dart_native_api.h", |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
704 deps = [ | 725 deps = [ |
705 ":copy_platform_sdk_libraries", | 726 ":copy_platform_sdk_libraries", |
706 ":copy_platform_sdk_scripts", | 727 ":copy_platform_sdk_scripts", |
707 ":copy_platform_sdk_snapshots", | 728 ":copy_platform_sdk_snapshots", |
708 ] | 729 ] |
709 } | 730 } |
710 | 731 |
711 # Parts specific to the full SDK. | 732 # Parts specific to the full SDK. |
712 group("create_full_sdk") { | 733 group("create_full_sdk") { |
713 visibility = [ | 734 visibility = [ |
714 ":copy_dev_compiler_tools", | |
715 ":create_sdk", | 735 ":create_sdk", |
716 ] | 736 ] |
737 | |
717 deps = [ | 738 deps = [ |
718 ":copy_dev_compiler_sdk", | 739 ":copy_dev_compiler_sdk", |
719 ":copy_full_sdk_libraries", | 740 ":copy_full_sdk_libraries", |
720 ":copy_full_sdk_scripts", | 741 ":copy_full_sdk_scripts", |
721 ":copy_full_sdk_snapshots", | 742 ":copy_full_sdk_snapshots", |
722 ] | 743 ] |
723 } | 744 } |
724 | 745 |
725 # The main target to depend on from ../BUILD.gn | 746 # The main target to depend on from ../BUILD.gn |
726 group("create_sdk") { | 747 group("create_sdk") { |
727 deps = [ | 748 deps = [ |
728 ":create_common_sdk", | 749 ":create_common_sdk", |
729 ] | 750 ] |
730 if (dart_platform_sdk) { | 751 if (dart_platform_sdk) { |
731 deps += [ ":create_platform_sdk" ] | 752 deps += [ ":create_platform_sdk" ] |
732 } else { | 753 } else { |
733 deps += [ ":create_full_sdk" ] | 754 deps += [ ":create_full_sdk" ] |
734 } | 755 } |
735 } | 756 } |
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 |