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

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

Issue 2023703002: Beginning work on GN build (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Really add //build. Add dart_bootstrap rule. Created 4 years, 6 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 5
6 declare_args() { 6 declare_args() {
7 dart_io_support = false 7 dart_io_support = false
8 dart_boringssl_path = "../../third_party/boringssl" 8 dart_boringssl_path = "../../third_party/boringssl"
9 } 9 }
10 10
11 11
12 resources_sources_gypi = 12 resources_sources_gypi =
13 exec_script("../../tools/gypi_to_gn.py", 13 exec_script("../../tools/gypi_to_gn.py",
14 [rebase_path("vmservice/vmservice_sources.gypi")], 14 [rebase_path("vmservice/vmservice_sources.gypi")],
15 "scope", 15 "scope",
16 ["vmservice/vmservice_sources.gypi"]) 16 ["vmservice/vmservice_sources.gypi"])
17 17
18 # Generate a resources.cc file for the service isolate without Observatory. 18 # Generate a resources.cc file for the service isolate without Observatory.
19 action("gen_resources_cc") { 19 action("gen_resources_cc") {
20 visibility = [ ":*" ] # Only targets in this file can see this. 20 visibility = [ ":*" ] # Only targets in this file can see this.
21 script = "../tools/create_resources.py" 21 script = "../tools/create_resources.py"
22 inputs = [ 22 inputs = [
23 "../tools/create_resources.py", 23 "../tools/create_resources.py",
24 ] 24 ]
25 # The path below is hard coded for the Mojo and Flutter trees. When moving 25 # The path below is hard coded for the Mojo and Flutter trees. When moving
26 # the Dart runtime to gn, this path might need to be updated. 26 # the Dart runtime to gn, this path might need to be updated.
27 sources = rebase_path(resources_sources_gypi.sources, 27 sources = rebase_path(resources_sources_gypi.sources,
28 "", 28 "",
29 "//dart/runtime/bin/vmservice/") 29 "../bin/vmservice/")
30 outputs = [ "$target_gen_dir/resources_gen.cc" ] 30 outputs = [ "$target_gen_dir/resources_gen.cc" ]
31 args = [ 31 args = [
32 "--output", 32 "--output",
33 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir), 33 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir),
34 "--outer_namespace", "dart", 34 "--outer_namespace", "dart",
35 "--inner_namespace", "bin", 35 "--inner_namespace", "bin",
36 "--table_name", "service_bin", 36 "--table_name", "service_bin",
37 "--root_prefix", rebase_path(".", root_build_dir) + "/", 37 "--root_prefix", rebase_path(".", root_build_dir) + "/",
38 ] + rebase_path(sources, root_build_dir) 38 ] + rebase_path(sources, root_build_dir)
39 } 39 }
40 40
41 41
42 template("gen_library_src_path") { 42 template("gen_library_src_path") {
43 assert(defined(invoker.sources), "Need sources in $target_name") 43 assert(defined(invoker.sources), "Need sources in $target_name")
44 assert(defined(invoker.output), "Need output in $target_name") 44 assert(defined(invoker.output), "Need output in $target_name")
45 action(target_name) { 45 action(target_name) {
46 visibility = [ ":*" ] # Only targets in this file can see this. 46 visibility = [ ":*" ] # Only targets in this file can see this.
47 script = "../tools/gen_library_src_paths.py" 47 script = "../tools/gen_library_src_paths.py"
48 inputs = [ 48 inputs = [
49 "../tools/gen_library_src_paths.py", 49 "../tools/gen_library_src_paths.py",
50 "builtin_in.cc", 50 "builtin_in.cc",
51 ] 51 ]
52 outputs = [ invoker.output, ] 52 outputs = [ invoker.output, ]
53 name = invoker.name 53 name = invoker.name
54 kind = invoker.kind 54 kind = invoker.kind
55 library_name = "dart:${name}"
56 if (defined(invoker.library_name)) {
57 library_name = invoker.library_name
58 }
55 args = [ 59 args = [
56 "--output", rebase_path(invoker.output, root_build_dir), 60 "--output", rebase_path(invoker.output, root_build_dir),
57 "--input_cc", rebase_path("builtin_in.cc", root_build_dir), 61 "--input_cc", rebase_path("builtin_in.cc", root_build_dir),
58 "--include", "bin/builtin.h", 62 "--include", "bin/builtin.h",
59 "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_", 63 "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_",
60 "--library_name", "dart:${name}",] + 64 "--library_name", library_name,] +
61 rebase_path(invoker.sources, root_build_dir) 65 rebase_path(invoker.sources, root_build_dir)
62 } 66 }
63 } 67 }
64 68
65 69
66 builtin_sources_gypi = 70 builtin_sources_gypi =
67 exec_script("../../tools/gypi_to_gn.py", 71 exec_script("../../tools/gypi_to_gn.py",
68 [rebase_path("builtin_sources.gypi")], 72 [rebase_path("builtin_sources.gypi")],
69 "scope", 73 "scope",
70 ["builtin_sources.gypi"]) 74 ["builtin_sources.gypi"])
(...skipping 27 matching lines...) Expand all
98 "scope", 102 "scope",
99 ["io_sources.gypi"]) 103 ["io_sources.gypi"])
100 104
101 gen_library_src_path("generate_io_patch_cc_file") { 105 gen_library_src_path("generate_io_patch_cc_file") {
102 name = "io" 106 name = "io"
103 kind = "patch" 107 kind = "patch"
104 sources = io_sources_gypi.sources 108 sources = io_sources_gypi.sources
105 output = "$target_gen_dir/io_patch_gen.cc" 109 output = "$target_gen_dir/io_patch_gen.cc"
106 } 110 }
107 111
112 gen_library_src_path("generate_html_cc_file") {
113 name = "html"
114 kind = "source"
115 sources = ["../../sdk/lib/html/dartium/html_dartium.dart"]
116 output = "$target_gen_dir/html_gen.cc"
117 }
118
119 gen_library_src_path("generate_html_common_cc_file") {
120 name = "html_common"
121 kind = "source"
122 sources = [
123 "../../sdk/lib/html/html_common/html_common.dart",
124 "../../sdk/lib/html/html_common/css_class_set.dart",
125 "../../sdk/lib/html/html_common/device.dart",
126 "../../sdk/lib/html/html_common/filtered_element_list.dart",
127 "../../sdk/lib/html/html_common/lists.dart",
128 "../../sdk/lib/html/html_common/conversions.dart",
129 "../../sdk/lib/html/html_common/conversions_dartium.dart",
130 ]
131 output = "$target_gen_dir/html_common_gen.cc"
132 }
133
134 gen_library_src_path("generate_js_cc_file") {
135 name = "js"
136 kind = "source"
137 sources = ["../../sdk/lib/js/dartium/js_dartium.dart"]
138 output = "$target_gen_dir/js_gen.cc"
139 }
140
141 gen_library_src_path("generate_blink_cc_file") {
142 name = "_blink"
143 kind = "source"
144 sources = ["../../sdk/lib/_blink/dartium/_blink_dartium.dart"]
145 output = "$target_gen_dir/blink_gen.cc"
146 }
147
148 gen_library_src_path("generate_indexed_db_cc_file") {
149 name = "indexed_db"
150 kind = "source"
151 sources = ["../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart"]
152 output = "$target_gen_dir/indexed_db_gen.cc"
153 }
154
155 gen_library_src_path("generate_cached_patches_cc_file") {
156 name = "cached_patches"
157 library_name = "cached_patches.dart"
158 kind = "sources"
159 sources = ["../../sdk/lib/js/dartium/cached_patches.dart"]
160 output = "$target_gen_dir/cached_patches_gen.cc"
161 }
162
163 gen_library_src_path("generate_web_gl_cc_file") {
164 name = "web_gl"
165 kind = "source"
166 sources = ["../../sdk/lib/web_gl/dartium/web_gl_dartium.dart"]
167 output = "$target_gen_dir/web_gl_gen.cc"
168 }
169
170 gen_library_src_path("generate_metadata_cc_file") {
171 name = "metadata"
172 library_name = "metadata.dart"
173 kind = "source"
174 sources = ["../../sdk/lib/html/html_common/metadata.dart"]
175 output = "$target_gen_dir/metadata_gen.cc"
176 }
177
178 gen_library_src_path("generate_web_sql_cc_file") {
179 name = "web_sql"
180 kind = "source"
181 sources = ["../../sdk/lib/web_sql/dartium/web_sql_dartium.dart"]
182 output = "$target_gen_dir/web_sql_gen.cc"
183 }
184
185 gen_library_src_path("generate_svg_cc_file") {
186 name = "svg"
187 kind = "source"
188 sources = ["../../sdk/lib/svg/dartium/svg_dartium.dart"]
189 output = "$target_gen_dir/svg_gen.cc"
190 }
191
192 gen_library_src_path("generate_web_audio_cc_file") {
193 name = "web_audio"
194 kind = "source"
195 sources = ["../../sdk/lib/web_audio/dartium/web_audio_dartium.dart"]
196 output = "$target_gen_dir/web_audio_gen.cc"
197 }
108 198
109 config("libdart_builtin_config") { 199 config("libdart_builtin_config") {
110 libs = [ 200 libs = [
111 "dl", 201 "dl",
112 ] 202 ]
113 } 203 }
114 204
115 205
116 builtin_impl_sources_gypi = 206 builtin_impl_sources_gypi =
117 exec_script("../../tools/gypi_to_gn.py", 207 exec_script("../../tools/gypi_to_gn.py",
118 [rebase_path("builtin_impl_sources.gypi")], 208 [rebase_path("builtin_impl_sources.gypi")],
119 "scope", 209 "scope",
120 ["builtin_impl_sources.gypi"]) 210 ["builtin_impl_sources.gypi"])
121 211
122 static_library("libdart_builtin") { 212 static_library("libdart_builtin") {
123 configs += ["..:dart_config", "..:dart_product_config"] 213 configs += ["..:dart_config", "..:dart_product_config"]
124 public_configs = [":libdart_builtin_config"] 214 public_configs = [":libdart_builtin_config"]
125 deps = [ 215 deps = [
126 ":generate_builtin_cc_file", 216 ":generate_builtin_cc_file",
127 ":generate_io_cc_file", 217 ":generate_io_cc_file",
128 ":generate_io_patch_cc_file", 218 ":generate_io_patch_cc_file",
219 ":generate_html_cc_file",
220 ":generate_html_common_cc_file",
221 ":generate_js_cc_file",
222 ":generate_blink_cc_file",
223 ":generate_indexed_db_cc_file",
224 ":generate_cached_patches_cc_file",
225 ":generate_web_gl_cc_file",
226 ":generate_metadata_cc_file",
227 ":generate_web_sql_cc_file",
228 ":generate_svg_cc_file",
229 ":generate_web_audio_cc_file",
129 ] 230 ]
130 include_dirs = [ 231 include_dirs = [
131 "..", 232 "..",
132 ] 233 ]
133 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 234 set_sources_assignment_filter(["*_test.cc", "*_test.h"])
134 sources = [ 235 sources = [
135 "log_android.cc", 236 "log_android.cc",
136 "log_linux.cc", 237 "log_linux.cc",
137 "log_macos.cc", 238 "log_macos.cc",
138 "log_win.cc", 239 "log_win.cc",
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 "io_natives.cc", 397 "io_natives.cc",
297 "io_natives.h", 398 "io_natives.h",
298 ] 399 ]
299 400
300 include_dirs = [ 401 include_dirs = [
301 "..", 402 "..",
302 "//third_party" 403 "//third_party"
303 ] 404 ]
304 } 405 }
305 406
407
306 # A source set for the implementation of 'dart:io' library 408 # A source set for the implementation of 'dart:io' library
307 # (without secure sockets). 409 # (without secure sockets).
308 source_set("embedded_dart_io") { 410 source_set("embedded_dart_io") {
309 configs += ["..:dart_config", 411 configs += ["..:dart_config",
310 "..:dart_product_config", 412 "..:dart_product_config",
311 "..:dart_precompiled_runtime_config"] 413 "..:dart_precompiled_runtime_config"]
312 414
313 custom_sources_filter = [ 415 custom_sources_filter = [
314 "*_test.cc", 416 "*_test.cc",
315 "*_test.h", 417 "*_test.h",
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 "log_macos.cc", 450 "log_macos.cc",
349 "log_win.cc", 451 "log_win.cc",
350 "log.h", 452 "log.h",
351 ] 453 ]
352 454
353 include_dirs = [ 455 include_dirs = [
354 "..", 456 "..",
355 "//third_party" 457 "//third_party"
356 ] 458 ]
357 } 459 }
460
461
462 action("generate_snapshot_bin") {
463 deps = [
464 "../bin:gen_snapshot($host_toolchain)",
465 ]
466
467 vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin"
468 isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin"
469 gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp"
470 outputs = [
471 vm_isolate_snapshot,
472 isolate_snapshot,
473 gen_snapshot_stamp_file,
474 ]
475
476 gen_snapshot_dir =
477 get_label_info("../bin:gen_snapshot($host_toolchain)", "root_out_dir")
478
479 script = rebase_path("../tools/create_snapshot_bin.py")
480 args = [
481 "--executable",
482 rebase_path("$gen_snapshot_dir/gen_snapshot"),
483 "--vm_output_bin",
484 rebase_path(vm_isolate_snapshot, root_build_dir),
485 "--output_bin",
486 rebase_path(isolate_snapshot, root_build_dir),
487 "--target_os",
488 current_os,
489 "--timestamp_file",
490 rebase_path(gen_snapshot_stamp_file, root_build_dir),
491 ]
492 }
493
494
495 action("generate_snapshot_file") {
496 deps = [
497 ":generate_snapshot_bin",
498 ]
499
500 snapshot_in_cc_file = "snapshot_in.cc"
501 inputs = [
502 "../tools/create_snapshot_file.py",
503 snapshot_in_cc_file,
504 "$target_gen_dir/vm_isolate_snapshot.bin",
505 "$target_gen_dir/isolate_snapshot.bin",
506 ]
507 output = "$root_gen_dir/dart_snapshot.cc"
508 outputs = [
509 output,
510 ]
511
512 script = "../tools/create_snapshot_file.py"
513 args = [
514 "--vm_input_bin",
515 rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"),
516 "--input_bin",
517 rebase_path("$target_gen_dir/isolate_snapshot.bin"),
518 "--input_cc",
519 rebase_path(snapshot_in_cc_file),
520 "--output",
521 rebase_path(output),
522 ]
523 }
524
525
526 source_set("dart_snapshot_cc") {
527 sources = [
528 "$root_gen_dir/dart_snapshot.cc",
529 ]
530
531 deps = [
532 ":generate_snapshot_file",
533 ]
534 }
535
536
537 executable("dart") {
538 configs += ["..:dart_config",
539 "..:dart_product_config",
540 "..:dart_precompiled_runtime_config",]
541 deps = [
542 ":gen_resources_cc",
543 ":embedded_dart_io",
544 # ":generate_builtin_cc_file",
545 # ":generate_io_cc_file",
546 # ":generate_io_patch_cc_file",
547 ":libdart_builtin",
548 "../vm:libdart_platform",
549 "..:libdart",
550 "../observatory:standalone_observatory_archive",
551 ":dart_snapshot_cc",
552 "//third_party/zlib",
553 ]
554
555 sources = [
556 "main.cc",
557 "vmservice_impl.cc",
558 "vmservice_impl.h",
559 "$target_gen_dir/resources_gen.cc",
560 ]
561
562 include_dirs = [
563 "..",
564 "//third_party",
565 ]
566 }
567
568
569 executable("dart_bootstrap") {
570 configs += ["..:dart_config",
571 "..:dart_product_config",
572 "..:dart_precompiler_config",
573 "..:dart_no_snapshot_config",]
574 deps = [
575 ":gen_resources_cc",
576 ":embedded_dart_io",
577 # ":generate_builtin_cc_file",
578 # ":generate_io_cc_file",
579 # ":generate_io_patch_cc_file",
580 ":libdart_builtin",
581 "../vm:libdart_platform",
582 "..:libdart",
583 "//third_party/zlib",
584 ]
585
586 sources = [
587 "main.cc",
588 "vmservice_impl.cc",
589 "vmservice_impl.h",
590 "observatory_assets_empty.cc",
591 "snapshot_empty.cc",
592 "$target_gen_dir/resources_gen.cc",
593 ]
594
595 include_dirs = [
596 "..",
597 "//third_party",
598 ]
599 }
600
601
602 executable("process_test") {
603 sources = [
604 "process_test.cc",
605 ]
606 }
607
608
609 action("generate_snapshot_test_dat_file") {
610 snapshot_test_dat_file = "$root_gen_dir/snapshot_test.dat"
611 snapshot_test_in_dat_file = "../vm/snapshot_test_in.dat"
612 snapshot_test_dart_file = "../vm/snapshot_test.dart"
613 inputs = [
614 "../tools/create_string_literal.py",
615 snapshot_test_in_dat_file,
616 snapshot_test_dart_file,
617 ]
618
619 outputs = [
620 snapshot_test_dat_file,
621 ]
622
623 script = "../tools/create_string_literal.py"
624 args = [
625 "--output",
626 rebase_path(snapshot_test_dat_file),
627 "--input_cc",
628 rebase_path(snapshot_test_in_dat_file),
629 "--include",
630 "INTENTIONALLY_LEFT_BLANK",
631 "--var_name",
632 "INTENTIONALLY_LEFT_BLANK_TOO",
633 rebase_path(snapshot_test_dart_file),
634 ]
635 }
636
637
638 executable("run_vm_tests") {
639 configs += ["..:dart_config",
640 "..:dart_product_config",
641 "..:dart_precompiled_runtime_config",]
642 deps = [
643 "..:libdart",
644 ":libdart_builtin",
645 ":embedded_dart_io",
646 ":dart_snapshot_cc",
647 ":generate_snapshot_test_dat_file",
648 "../vm:libdart_platform",
649 "//third_party/zlib",
650 ]
651 include_dirs = [
652 "..",
653 "$target_gen_dir",
654 ]
655 defines = [
656 "TESTING",
657 ]
658
659 vm_tests_list = exec_script("../../tools/gypi_to_gn.py",
660 [rebase_path("../vm/vm_sources.gypi"),
661 "--keep_only=_test.cc",
662 "--keep_only=_test.h",],
663 "scope",
664 ["../vm/vm_sources.gypi"])
665 vm_tests = rebase_path(vm_tests_list.sources, ".", "../vm")
666
667 builtin_impl_tests_list =
668 exec_script("../../tools/gypi_to_gn.py",
669 [rebase_path("builtin_impl_sources.gypi"),
670 "--keep_only=_test.cc",
671 "--keep_only=_test.h",],
672 "scope",
673 ["builtin_impl_sources.gypi"])
674
675 sources = [
676 "run_vm_tests.cc",
677 ] + builtin_impl_tests_list.sources + vm_tests
678 }
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