OLD | NEW |
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") | |
6 | |
7 declare_args() { | 5 declare_args() { |
8 # 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 |
9 # verified at the operating system level. | 7 # verified at the operating system level. |
10 dart_use_fallback_root_certificates = false | 8 dart_use_fallback_root_certificates = false |
11 | 9 |
12 # The BUILD.gn file that we pull from chromium as part of zlib has a | 10 # The BUILD.gn file that we pull from chromium as part of zlib has a |
13 # dependence on //base, which we don't pull in. In a standalone build of the | 11 # dependence on //base, which we don't pull in. In a standalone build of the |
14 # VM, we set this to //runtime/bin/zlib where we have a BUILD.gn file without | 12 # VM, we set this to //runtime/bin/zlib where we have a BUILD.gn file without |
15 # a dependence on //base. | 13 # a dependence on //base. |
16 dart_zlib_path = "//third_party/zlib" | 14 dart_zlib_path = "//third_party/zlib" |
17 | 15 |
18 # Whether to link the standalone VM against tcmalloc. The standalone build of | 16 # Whether to link the standalone VM against tcmalloc. The standalone build of |
19 # the VM enables this only for Linux builds. | 17 # the VM enables this only for Linux builds. |
20 dart_use_tcmalloc = false | 18 dart_use_tcmalloc = false |
21 } | 19 } |
22 | 20 |
| 21 resources_sources_gypi = |
| 22 exec_script("../../tools/gypi_to_gn.py", |
| 23 [ rebase_path("vmservice/vmservice_sources.gypi") ], |
| 24 "scope", |
| 25 [ "vmservice/vmservice_sources.gypi" ]) |
| 26 |
23 # Generate a resources.cc file for the service isolate without Observatory. | 27 # Generate a resources.cc file for the service isolate without Observatory. |
24 action("gen_resources_cc") { | 28 action("gen_resources_cc") { |
25 visibility = [ ":*" ] # Only targets in this file can see this. | 29 visibility = [ ":*" ] # Only targets in this file can see this. |
26 script = "../tools/create_resources.py" | 30 script = "../tools/create_resources.py" |
27 inputs = [ | 31 inputs = [ |
28 "../tools/create_resources.py", | 32 "../tools/create_resources.py", |
29 ] | 33 ] |
30 | 34 |
31 # The path below is hard coded for the Mojo and Flutter trees. When moving | 35 # The path below is hard coded for the Mojo and Flutter trees. When moving |
32 # the Dart runtime to gn, this path might need to be updated. | 36 # the Dart runtime to gn, this path might need to be updated. |
33 sources = rebase_path(resources_sources_gypi, "", "../bin/vmservice/") | 37 sources = rebase_path(resources_sources_gypi.sources, "", "../bin/vmservice/") |
34 outputs = [ | 38 outputs = [ |
35 "$target_gen_dir/resources_gen.cc", | 39 "$target_gen_dir/resources_gen.cc", |
36 ] | 40 ] |
37 args = [ | 41 args = [ |
38 "--output", | 42 "--output", |
39 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir), | 43 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir), |
40 "--outer_namespace", | 44 "--outer_namespace", |
41 "dart", | 45 "dart", |
42 "--inner_namespace", | 46 "--inner_namespace", |
43 "bin", | 47 "bin", |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 "--include", | 79 "--include", |
76 "bin/builtin.h", | 80 "bin/builtin.h", |
77 "--var_name", | 81 "--var_name", |
78 "dart::bin::Builtin::${name}_${kind}_paths_", | 82 "dart::bin::Builtin::${name}_${kind}_paths_", |
79 "--library_name", | 83 "--library_name", |
80 library_name, | 84 library_name, |
81 ] + rebase_path(invoker.sources, root_build_dir) | 85 ] + rebase_path(invoker.sources, root_build_dir) |
82 } | 86 } |
83 } | 87 } |
84 | 88 |
| 89 builtin_sources_gypi = exec_script("../../tools/gypi_to_gn.py", |
| 90 [ rebase_path("builtin_sources.gypi") ], |
| 91 "scope", |
| 92 [ "builtin_sources.gypi" ]) |
| 93 |
85 gen_library_src_path("generate_builtin_cc_file") { | 94 gen_library_src_path("generate_builtin_cc_file") { |
86 name = "_builtin" | 95 name = "_builtin" |
87 kind = "source" | 96 kind = "source" |
88 sources = builtin_sources_gypi | 97 sources = builtin_sources_gypi.sources |
89 output = "$target_gen_dir/builtin_gen.cc" | 98 output = "$target_gen_dir/builtin_gen.cc" |
90 } | 99 } |
91 | 100 |
92 sdk_io_sources_gypi = | 101 sdk_io_sources_gypi = |
93 exec_script("../../tools/gypi_to_gn.py", | 102 exec_script("../../tools/gypi_to_gn.py", |
94 [ rebase_path("../../sdk/lib/io/io_sources.gypi") ], | 103 [ rebase_path("../../sdk/lib/io/io_sources.gypi") ], |
95 "scope", | 104 "scope", |
96 [ "../../sdk/lib/io/io_sources.gypi" ]) | 105 [ "../../sdk/lib/io/io_sources.gypi" ]) |
97 sdk_io_sources = | 106 sdk_io_sources = |
98 rebase_path(sdk_io_sources_gypi.sources, ".", "../../sdk/lib/io") | 107 rebase_path(sdk_io_sources_gypi.sources, ".", "../../sdk/lib/io") |
99 | 108 |
100 gen_library_src_path("generate_io_cc_file") { | 109 gen_library_src_path("generate_io_cc_file") { |
101 name = "io" | 110 name = "io" |
102 kind = "source" | 111 kind = "source" |
103 sources = [ "../../sdk/lib/io/io.dart" ] + sdk_io_sources | 112 sources = [ "../../sdk/lib/io/io.dart" ] + sdk_io_sources |
104 output = "$target_gen_dir/io_gen.cc" | 113 output = "$target_gen_dir/io_gen.cc" |
105 } | 114 } |
106 | 115 |
| 116 io_sources_gypi = exec_script("../../tools/gypi_to_gn.py", |
| 117 [ rebase_path("io_sources.gypi") ], |
| 118 "scope", |
| 119 [ "io_sources.gypi" ]) |
| 120 |
107 gen_library_src_path("generate_io_patch_cc_file") { | 121 gen_library_src_path("generate_io_patch_cc_file") { |
108 name = "io" | 122 name = "io" |
109 kind = "patch" | 123 kind = "patch" |
110 sources = io_sources_gypi | 124 sources = io_sources_gypi.sources |
111 output = "$target_gen_dir/io_patch_gen.cc" | 125 output = "$target_gen_dir/io_patch_gen.cc" |
112 } | 126 } |
113 | 127 |
114 gen_library_src_path("generate_html_cc_file") { | 128 gen_library_src_path("generate_html_cc_file") { |
115 name = "html" | 129 name = "html" |
116 kind = "source" | 130 kind = "source" |
117 sources = [ | 131 sources = [ |
118 "../../sdk/lib/html/dartium/html_dartium.dart", | 132 "../../sdk/lib/html/dartium/html_dartium.dart", |
119 ] | 133 ] |
120 output = "$target_gen_dir/html_gen.cc" | 134 output = "$target_gen_dir/html_gen.cc" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 libs = [ "dl" ] | 246 libs = [ "dl" ] |
233 } | 247 } |
234 if (is_android) { | 248 if (is_android) { |
235 libs += [ | 249 libs += [ |
236 "android", | 250 "android", |
237 "log", | 251 "log", |
238 ] | 252 ] |
239 } | 253 } |
240 } | 254 } |
241 | 255 |
| 256 builtin_impl_sources_gypi = |
| 257 exec_script("../../tools/gypi_to_gn.py", |
| 258 [ rebase_path("builtin_impl_sources.gypi") ], |
| 259 "scope", |
| 260 [ "builtin_impl_sources.gypi" ]) |
| 261 |
242 static_library("libdart_builtin") { | 262 static_library("libdart_builtin") { |
243 configs += [ | 263 configs += [ |
244 "..:dart_config", | 264 "..:dart_config", |
245 "..:dart_maybe_product_config", | 265 "..:dart_maybe_product_config", |
246 ] | 266 ] |
247 public_configs = [ ":libdart_builtin_config" ] | 267 public_configs = [ ":libdart_builtin_config" ] |
248 deps = [ | 268 deps = [ |
249 ":generate_blink_cc_file", | 269 ":generate_blink_cc_file", |
250 ":generate_builtin_cc_file", | 270 ":generate_builtin_cc_file", |
251 ":generate_cached_patches_cc_file", | 271 ":generate_cached_patches_cc_file", |
(...skipping 14 matching lines...) Expand all Loading... |
266 set_sources_assignment_filter([ | 286 set_sources_assignment_filter([ |
267 "*_test.cc", | 287 "*_test.cc", |
268 "*_test.h", | 288 "*_test.h", |
269 ]) | 289 ]) |
270 sources = [ | 290 sources = [ |
271 "log_android.cc", | 291 "log_android.cc", |
272 "log_fuchsia.cc", | 292 "log_fuchsia.cc", |
273 "log_linux.cc", | 293 "log_linux.cc", |
274 "log_macos.cc", | 294 "log_macos.cc", |
275 "log_win.cc", | 295 "log_win.cc", |
276 ] + builtin_impl_sources_gypi | 296 ] + builtin_impl_sources_gypi.sources |
277 } | 297 } |
278 | 298 |
| 299 io_impl_sources_gypi = exec_script("../../tools/gypi_to_gn.py", |
| 300 [ rebase_path("io_impl_sources.gypi") ], |
| 301 "scope", |
| 302 [ "io_impl_sources.gypi" ]) |
| 303 |
279 executable("gen_snapshot") { | 304 executable("gen_snapshot") { |
280 configs += [ | 305 configs += [ |
281 "..:dart_config", | 306 "..:dart_config", |
282 "..:dart_maybe_product_config", | 307 "..:dart_maybe_product_config", |
283 "..:dart_precompiler_config", | 308 "..:dart_precompiler_config", |
284 ] | 309 ] |
285 deps = [ | 310 deps = [ |
286 ":gen_resources_cc", | 311 ":gen_resources_cc", |
287 ":gen_snapshot_dart_io", | 312 ":gen_snapshot_dart_io", |
288 ":generate_builtin_cc_file", | 313 ":generate_builtin_cc_file", |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 # Dart tree uses *_macos.* instead of *_mac.* | 379 # Dart tree uses *_macos.* instead of *_mac.* |
355 custom_sources_filter += [ | 380 custom_sources_filter += [ |
356 "*_macos.h", | 381 "*_macos.h", |
357 "*_macos.cc", | 382 "*_macos.cc", |
358 ] | 383 ] |
359 } | 384 } |
360 set_sources_assignment_filter(custom_sources_filter) | 385 set_sources_assignment_filter(custom_sources_filter) |
361 | 386 |
362 defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ] | 387 defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ] |
363 | 388 |
364 sources = io_impl_sources_gypi + builtin_impl_sources_gypi | 389 sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources |
365 sources += [ | 390 sources += [ |
366 "io_natives.cc", | 391 "io_natives.cc", |
367 "io_natives.h", | 392 "io_natives.h", |
368 ] | 393 ] |
369 | 394 |
370 include_dirs = [ | 395 include_dirs = [ |
371 "..", | 396 "..", |
372 "//third_party", | 397 "//third_party", |
373 ] | 398 ] |
374 } | 399 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 libs += [ "CoreServices.framework" ] | 445 libs += [ "CoreServices.framework" ] |
421 } | 446 } |
422 } else if (defined(is_fuchsia) && is_fuchsia) { | 447 } else if (defined(is_fuchsia) && is_fuchsia) { |
423 defines += [ "DART_IO_SECURE_SOCKET_DISABLED" ] | 448 defines += [ "DART_IO_SECURE_SOCKET_DISABLED" ] |
424 } else { | 449 } else { |
425 deps = [ | 450 deps = [ |
426 "//third_party/boringssl", | 451 "//third_party/boringssl", |
427 ] | 452 ] |
428 } | 453 } |
429 | 454 |
430 sources = io_impl_sources_gypi + builtin_impl_sources_gypi | 455 sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources |
431 sources += [ | 456 sources += [ |
432 "builtin_natives.cc", | 457 "builtin_natives.cc", |
433 "io_natives.cc", | 458 "io_natives.cc", |
434 "io_natives.h", | 459 "io_natives.h", |
435 "log_android.cc", | 460 "log_android.cc", |
436 "log_linux.cc", | 461 "log_linux.cc", |
437 "log_macos.cc", | 462 "log_macos.cc", |
438 "log_win.cc", | 463 "log_win.cc", |
439 "log.h", | 464 "log.h", |
440 ] + extra_sources | 465 ] + extra_sources |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 "$target_gen_dir", | 803 "$target_gen_dir", |
779 ] | 804 ] |
780 defines = [ "TESTING" ] | 805 defines = [ "TESTING" ] |
781 | 806 |
782 if (dart_use_tcmalloc) { | 807 if (dart_use_tcmalloc) { |
783 deps += [ "//third_party/tcmalloc" ] | 808 deps += [ "//third_party/tcmalloc" ] |
784 } | 809 } |
785 | 810 |
786 # The VM sources are already included in libdart, so we just want to add in | 811 # The VM sources are already included in libdart, so we just want to add in |
787 # the tests here. | 812 # the tests here. |
788 vm_tests = rebase_path(vm_tests_list, ".", "../vm") | 813 vm_tests_list = exec_script("../../tools/gypi_to_gn.py", |
| 814 [ |
| 815 rebase_path("../vm/vm_sources.gypi"), |
| 816 "--keep_only=_test.cc", |
| 817 "--keep_only=_test.h", |
| 818 ], |
| 819 "scope", |
| 820 [ "../vm/vm_sources.gypi" ]) |
| 821 vm_tests = rebase_path(vm_tests_list.sources, ".", "../vm") |
| 822 |
| 823 builtin_impl_tests_list = |
| 824 exec_script("../../tools/gypi_to_gn.py", |
| 825 [ |
| 826 rebase_path("builtin_impl_sources.gypi"), |
| 827 "--keep_only=_test.cc", |
| 828 "--keep_only=_test.h", |
| 829 ], |
| 830 "scope", |
| 831 [ "builtin_impl_sources.gypi" ]) |
789 | 832 |
790 sources = [ | 833 sources = [ |
791 "builtin_nolib.cc", | 834 "builtin_nolib.cc", |
792 "run_vm_tests.cc", | 835 "run_vm_tests.cc", |
793 ] + builtin_impl_tests_list + vm_tests | 836 ] + builtin_impl_tests_list.sources + vm_tests |
794 | 837 |
795 if (!is_win) { | 838 if (!is_win) { |
796 ldflags = [ "-rdynamic" ] | 839 ldflags = [ "-rdynamic" ] |
797 } | 840 } |
798 | 841 |
799 if (is_win) { | 842 if (is_win) { |
800 libs = [ | 843 libs = [ |
801 "iphlpapi.lib", | 844 "iphlpapi.lib", |
802 "psapi.lib", | 845 "psapi.lib", |
803 "ws2_32.lib", | 846 "ws2_32.lib", |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 # The only effect of DART_SHARED_LIB is to export the Dart API. | 884 # The only effect of DART_SHARED_LIB is to export the Dart API. |
842 "DART_SHARED_LIB", | 885 "DART_SHARED_LIB", |
843 ] | 886 ] |
844 if (is_win) { | 887 if (is_win) { |
845 libs = [ "dart.lib" ] | 888 libs = [ "dart.lib" ] |
846 abs_root_out_dir = rebase_path(root_out_dir) | 889 abs_root_out_dir = rebase_path(root_out_dir) |
847 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] | 890 ldflags = [ "/LIBPATH:$abs_root_out_dir" ] |
848 } | 891 } |
849 } | 892 } |
850 } | 893 } |
OLD | NEW |