| 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 | 5 |
| 6 declare_args() { | 6 declare_args() { |
| 7 dart_io_support = false | 7 dart_io_support = false |
| 8 } | 8 } |
| 9 | 9 |
| 10 | 10 |
| 11 resources_sources_gypi = |
| 12 exec_script("../../tools/gypi_to_gn.py", |
| 13 [rebase_path("resources_sources.gypi")], |
| 14 "scope", |
| 15 ["resources_sources.gypi"]) |
| 16 |
| 17 # Generate a resources.cc file for the service isolate without Observatory. |
| 18 action("gen_resources_cc") { |
| 19 visibility = [ ":*" ] # Only targets in this file can see this. |
| 20 script = "../tools/create_resources.py" |
| 21 inputs = [ |
| 22 "../tools/create_resources.py", |
| 23 ] |
| 24 sources = resources_sources_gypi.sources |
| 25 outputs = [ "$target_gen_dir/resources_gen.cc" ] |
| 26 args = [ |
| 27 "--output", |
| 28 rebase_path("$target_gen_dir/resources_gen.cc", root_build_dir), |
| 29 "--outer_namespace", "dart", |
| 30 "--inner_namespace", "bin", |
| 31 "--table_name", "service_bin", |
| 32 "--root_prefix", rebase_path(".", root_build_dir) + "/", |
| 33 ] + rebase_path(sources, root_build_dir) |
| 34 } |
| 35 |
| 36 |
| 11 template("gen_library_src_path") { | 37 template("gen_library_src_path") { |
| 12 assert(defined(invoker.sources), "Need sources in $target_name") | 38 assert(defined(invoker.sources), "Need sources in $target_name") |
| 13 assert(defined(invoker.output), "Need output in $target_name") | 39 assert(defined(invoker.output), "Need output in $target_name") |
| 14 action(target_name) { | 40 action(target_name) { |
| 15 visibility = [ ":*" ] # Only targets in this file can see this. | 41 visibility = [ ":*" ] # Only targets in this file can see this. |
| 16 script = "../tools/gen_library_src_paths.py" | 42 script = "../tools/gen_library_src_paths.py" |
| 17 inputs = [ | 43 inputs = [ |
| 18 "../tools/gen_library_src_paths.py", | 44 "../tools/gen_library_src_paths.py", |
| 19 "builtin_in.cc", | 45 "builtin_in.cc", |
| 20 ] | 46 ] |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 162 |
| 137 defines = [ | 163 defines = [ |
| 138 "DART_SHARED_LIB", | 164 "DART_SHARED_LIB", |
| 139 ] | 165 ] |
| 140 } | 166 } |
| 141 | 167 |
| 142 | 168 |
| 143 executable("gen_snapshot") { | 169 executable("gen_snapshot") { |
| 144 configs += ["..:dart_config"] | 170 configs += ["..:dart_config"] |
| 145 deps = [ | 171 deps = [ |
| 172 ":gen_resources_cc", |
| 173 ":gen_snapshot_dart_io", |
| 146 ":generate_builtin_cc_file", | 174 ":generate_builtin_cc_file", |
| 147 ":generate_io_cc_file", | 175 ":generate_io_cc_file", |
| 148 ":generate_io_patch_cc_file", | 176 ":generate_io_patch_cc_file", |
| 149 ":libdart_builtin", | 177 ":libdart_builtin", |
| 150 ":libdart_nosnapshot", | 178 ":libdart_nosnapshot", |
| 151 ] | 179 ] |
| 152 | 180 |
| 153 sources = [ | 181 sources = [ |
| 154 "address_sanitizer.cc", | 182 "address_sanitizer.cc", |
| 155 "gen_snapshot.cc", | 183 "gen_snapshot.cc", |
| 156 # Very limited native resolver provided. | 184 # Very limited native resolver provided. |
| 157 "builtin_common.cc", | 185 "builtin_common.cc", |
| 158 "builtin_gen_snapshot.cc", | 186 "builtin_gen_snapshot.cc", |
| 159 "builtin.cc", | 187 "builtin.cc", |
| 160 "builtin.h", | 188 "builtin.h", |
| 161 "platform_android.cc", | 189 "platform_android.cc", |
| 162 "platform_linux.cc", | 190 "platform_linux.cc", |
| 163 "platform_macos.cc", | 191 "platform_macos.cc", |
| 164 "platform_win.cc", | 192 "platform_win.cc", |
| 165 "platform.h", | 193 "platform.h", |
| 194 "vmservice_impl.cc", |
| 195 "vmservice_impl.h", |
| 166 # Include generated source files. | 196 # Include generated source files. |
| 167 "$target_gen_dir/builtin_gen.cc", | 197 "$target_gen_dir/builtin_gen.cc", |
| 168 "$target_gen_dir/io_gen.cc", | 198 "$target_gen_dir/io_gen.cc", |
| 169 "$target_gen_dir/io_patch_gen.cc", | 199 "$target_gen_dir/io_patch_gen.cc", |
| 200 "$target_gen_dir/resources_gen.cc", |
| 170 ] | 201 ] |
| 171 | 202 |
| 172 include_dirs = [ | 203 include_dirs = [ |
| 173 "..", | 204 "..", |
| 174 ] | 205 ] |
| 175 } | 206 } |
| 176 | 207 |
| 177 | 208 |
| 178 source_set("libdart_embedder_noio") { | 209 source_set("libdart_embedder_noio") { |
| 179 configs += ["..:dart_config",] | 210 configs += ["..:dart_config",] |
| 180 deps = [ | 211 deps = [ |
| 181 "..:libdart", | 212 "..:libdart", |
| 182 "../vm:libdart_platform", | 213 "../vm:libdart_platform", |
| 183 ] | 214 ] |
| 184 } | 215 } |
| 185 | 216 |
| 186 io_impl_sources_gypi = | 217 io_impl_sources_gypi = |
| 187 exec_script("../../tools/gypi_to_gn.py", | 218 exec_script("../../tools/gypi_to_gn.py", |
| 188 [ rebase_path("io_impl_sources.gypi") ], | 219 [ rebase_path("io_impl_sources.gypi") ], |
| 189 "scope", | 220 "scope", |
| 190 [ "io_impl_sources.gypi" ]) | 221 [ "io_impl_sources.gypi" ]) |
| 191 | 222 |
| 223 |
| 224 # A source set for the implementation of 'dart:io' library |
| 225 # (without secure sockets) suitable for linking with gen_snapshot. |
| 226 source_set("gen_snapshot_dart_io") { |
| 227 configs += ["..:dart_config",] |
| 228 |
| 229 # Set custom sources assignment filter. The custom filters does three things: |
| 230 # 1) Filters out unnecessary files pulled in from the gypi files. |
| 231 # 2) Filters out secure socket support. |
| 232 # 3) Enables dart:io by filtering out _unsupported.cc implementations. |
| 233 custom_sources_filter = [ |
| 234 "*net/nss_memio.cc", |
| 235 "*net/nss_memio.h", |
| 236 "*secure_socket.cc", |
| 237 "*secure_socket.h", |
| 238 "filter.cc", |
| 239 "*io_service_unsupported.cc", |
| 240 "platform_*.cc", |
| 241 "*io_service.cc", |
| 242 "*io_service.h", |
| 243 "*_test.cc", |
| 244 "*_test.h", |
| 245 "*dbg*", |
| 246 "builtin.cc", |
| 247 "builtin_common.cc", |
| 248 "builtin_gen_snapshot.cc", |
| 249 ] |
| 250 if (!is_mac && !is_ios) { |
| 251 # Dart tree uses *_macos.* instead of *_mac.* |
| 252 custom_sources_filter += [ |
| 253 "*_macos.h", |
| 254 "*_macos.cc", |
| 255 ] |
| 256 } |
| 257 set_sources_assignment_filter(custom_sources_filter) |
| 258 |
| 259 defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ] |
| 260 |
| 261 sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources |
| 262 sources += [ |
| 263 "io_natives.cc", |
| 264 "io_natives.h", |
| 265 "log_android.cc", |
| 266 "log_linux.cc", |
| 267 "log_macos.cc", |
| 268 "log_win.cc", |
| 269 "log.h", |
| 270 ] |
| 271 |
| 272 include_dirs = [ |
| 273 "..", |
| 274 "//third_party" |
| 275 ] |
| 276 } |
| 277 |
| 192 # A source set for the implementation of 'dart:io' library | 278 # A source set for the implementation of 'dart:io' library |
| 193 # (without secure sockets). | 279 # (without secure sockets). |
| 194 source_set("embedded_dart_io") { | 280 source_set("embedded_dart_io") { |
| 195 configs += ["..:dart_config",] | 281 configs += ["..:dart_config",] |
| 196 | 282 |
| 197 # Set custom sources assignment filter. The custom filters does three things: | 283 # Set custom sources assignment filter. The custom filters does three things: |
| 198 # 1) Filters out unnecessary files pulled in from the gypi files. | 284 # 1) Filters out unnecessary files pulled in from the gypi files. |
| 199 # 2) Filters out secure socket support. | 285 # 2) Filters out secure socket support. |
| 200 # 3) Enables dart:io by filtering out _unsupported.cc implementations. | 286 # 3) Enables dart:io by filtering out _unsupported.cc implementations. |
| 201 custom_sources_filter = [ | 287 custom_sources_filter = [ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 "log_macos.cc", | 323 "log_macos.cc", |
| 238 "log_win.cc", | 324 "log_win.cc", |
| 239 "log.h", | 325 "log.h", |
| 240 ] | 326 ] |
| 241 | 327 |
| 242 include_dirs = [ | 328 include_dirs = [ |
| 243 "..", | 329 "..", |
| 244 "//third_party" | 330 "//third_party" |
| 245 ] | 331 ] |
| 246 } | 332 } |
| OLD | NEW |