OLD | NEW |
(Empty) | |
| 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 |
| 3 # BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 |
| 6 declare_args() { |
| 7 dart_io_support = false |
| 8 } |
| 9 |
| 10 |
| 11 template("gen_library_src_path") { |
| 12 assert(defined(invoker.sources), "Need sources in $target_name") |
| 13 assert(defined(invoker.output), "Need output in $target_name") |
| 14 action(target_name) { |
| 15 visibility = [ ":*" ] # Only targets in this file can see this. |
| 16 script = "../tools/gen_library_src_paths.py" |
| 17 inputs = [ |
| 18 "../tools/gen_library_src_paths.py", |
| 19 "builtin_in.cc", |
| 20 ] |
| 21 outputs = [ invoker.output, ] |
| 22 name = invoker.name |
| 23 kind = invoker.kind |
| 24 args = [ |
| 25 "--output", rebase_path(invoker.output, root_build_dir), |
| 26 "--input_cc", rebase_path("builtin_in.cc", root_build_dir), |
| 27 "--include", "bin/builtin.h", |
| 28 "--var_name", "dart::bin::Builtin::${name}_${kind}_paths_", |
| 29 "--library_name", "dart:${name}",] + |
| 30 rebase_path(invoker.sources, root_build_dir) |
| 31 } |
| 32 } |
| 33 |
| 34 |
| 35 builtin_sources_gypi = |
| 36 exec_script("../../tools/gypi_to_gn.py", |
| 37 [rebase_path("builtin_sources.gypi")], |
| 38 "scope", |
| 39 ["builtin_sources.gypi"]) |
| 40 |
| 41 gen_library_src_path("generate_builtin_cc_file") { |
| 42 name = "_builtin" |
| 43 kind = "source" |
| 44 sources = builtin_sources_gypi.sources |
| 45 output = "$target_gen_dir/builtin_gen.cc" |
| 46 } |
| 47 |
| 48 |
| 49 iolib_sources_gypi = |
| 50 exec_script("../../tools/gypi_to_gn.py", |
| 51 [rebase_path("../../sdk/lib/io/iolib_sources.gypi")], |
| 52 "scope", |
| 53 ["../../sdk/lib/io/iolib_sources.gypi"]) |
| 54 iolib_sources = rebase_path(iolib_sources_gypi.sources, ".", "../../sdk/lib/io") |
| 55 |
| 56 gen_library_src_path("generate_io_cc_file") { |
| 57 name = "io" |
| 58 kind = "source" |
| 59 sources = ["../../sdk/lib/io/io.dart"] + iolib_sources |
| 60 output = "$target_gen_dir/io_gen.cc" |
| 61 } |
| 62 |
| 63 io_sources_gypi = |
| 64 exec_script("../../tools/gypi_to_gn.py", |
| 65 [rebase_path("io_sources.gypi")], |
| 66 "scope", |
| 67 ["io_sources.gypi"]) |
| 68 |
| 69 gen_library_src_path("generate_io_patch_cc_file") { |
| 70 name = "io" |
| 71 kind = "patch" |
| 72 sources = io_sources_gypi.sources |
| 73 output = "$target_gen_dir/io_patch_gen.cc" |
| 74 } |
| 75 |
| 76 |
| 77 config("libdart_builtin_config") { |
| 78 libs = [ |
| 79 "dl", |
| 80 ] |
| 81 } |
| 82 |
| 83 |
| 84 builtin_impl_sources_gypi = |
| 85 exec_script("../../tools/gypi_to_gn.py", |
| 86 [rebase_path("builtin_impl_sources.gypi")], |
| 87 "scope", |
| 88 ["builtin_impl_sources.gypi"]) |
| 89 |
| 90 static_library("libdart_builtin") { |
| 91 configs += ["../..:dart_config"] |
| 92 public_configs = [":libdart_builtin_config"] |
| 93 deps = [ |
| 94 ":generate_builtin_cc_file", |
| 95 ":generate_io_cc_file", |
| 96 ":generate_io_patch_cc_file", |
| 97 ] |
| 98 include_dirs = [ |
| 99 "..", |
| 100 ] |
| 101 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) |
| 102 sources = [ |
| 103 "log_android.cc", |
| 104 "log_linux.cc", |
| 105 "log_macos.cc", |
| 106 "log_win.cc", |
| 107 ] + builtin_impl_sources_gypi.sources |
| 108 } |
| 109 |
| 110 |
| 111 static_library("libdart_withcore") { |
| 112 configs += ["../..:dart_config"] |
| 113 deps = [ |
| 114 "../vm:libdart_lib_withcore", |
| 115 "../vm:libdart_vm", |
| 116 "../vm:libdart_platform", |
| 117 "../third_party/jscre:libjscre", |
| 118 "../third_party/double-conversion/src:libdouble_conversion", |
| 119 "..:generate_version_cc_file", |
| 120 ] |
| 121 |
| 122 sources = [ |
| 123 "../include/dart_api.h", |
| 124 "../include/dart_debugger_api.h", |
| 125 "../include/dart_mirrors_api.h", |
| 126 "../include/dart_native_api.h", |
| 127 "../vm/dart_api_impl.cc", |
| 128 "../vm/debugger_api_impl.cc", |
| 129 "../vm/mirrors_api_impl.cc", |
| 130 "../vm/native_api_impl.cc", |
| 131 "$target_gen_dir/../version.cc", |
| 132 ] |
| 133 |
| 134 include_dirs = [ |
| 135 "..", |
| 136 ] |
| 137 |
| 138 defines = [ |
| 139 "DART_SHARED_LIB", |
| 140 ] |
| 141 } |
| 142 |
| 143 |
| 144 executable("gen_snapshot") { |
| 145 configs += ["../..:dart_config"] |
| 146 deps = [ |
| 147 ":libdart_withcore", |
| 148 ":libdart_builtin", |
| 149 ] |
| 150 |
| 151 sources = [ |
| 152 "gen_snapshot.cc", |
| 153 # Very limited native resolver provided. |
| 154 "builtin_gen_snapshot.cc", |
| 155 "builtin.cc", |
| 156 "builtin.h", |
| 157 # Include generated source files. |
| 158 "$target_gen_dir/builtin_gen.cc", |
| 159 "$target_gen_dir/io_gen.cc", |
| 160 "$target_gen_dir/io_patch_gen.cc", |
| 161 ] |
| 162 |
| 163 include_dirs = [ |
| 164 "..", |
| 165 ] |
| 166 } |
| 167 |
| 168 |
| 169 static_library("libdart_embedder_noio") { |
| 170 configs += ["../..:dart_config",] |
| 171 deps = [ |
| 172 "..:libdart", |
| 173 "../vm:libdart_platform", |
| 174 ] |
| 175 } |
OLD | NEW |