Add embedded_dart_io source_set for Sky

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1124193004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45576 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
johnmccutchan@google.com 2015-05-06 21:36:15 +00:00
parent ac0f1ade9e
commit 37feb0c855
3 changed files with 97 additions and 0 deletions

View file

@ -179,3 +179,63 @@ static_library("libdart_embedder_noio") {
"../vm:libdart_platform",
]
}
io_impl_sources_gypi =
exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("io_impl_sources.gypi") ],
"scope",
[ "io_impl_sources.gypi" ])
# A source set for the implementation of 'dart:io' library
# (without secure sockets).
source_set("embedded_dart_io") {
configs += ["..:dart_config",]
# Set custom sources assignment filter. The custom filters does three things:
# 1) Filters out unnecessary files pulled in from the gypi files.
# 2) Filters out secure socket support.
# 3) Enables dart:io by filtering out _unsupported.cc implementations.
custom_sources_filter = [
"*net/nss_memio.cc",
"*net/nss_memio.h",
"*secure_socket.cc",
"*secure_socket.h",
"*filter_unsupported.cc",
"*io_service_unsupported.cc",
"*_test.cc",
"*_test.h",
"*dbg*",
"builtin.cc",
"builtin_gen_snapshot.cc",
]
if (!is_mac) {
# Dart tree uses *_macos.* instead of *_mac.*
custom_sources_filter += [
"*_macos.h",
"*_macos.cc",
]
}
set_sources_assignment_filter(custom_sources_filter)
defines = [ "DART_IO_SECURE_SOCKET_DISABLED" ]
sources = io_impl_sources_gypi.sources + builtin_impl_sources_gypi.sources
sources += [
"builtin_nolib.cc",
"builtin_natives.cc",
"io_natives.cc",
"io_natives.h",
"embedded_dart_io.cc",
"embedded_dart_io.h",
"log_android.cc",
"log_linux.cc",
"log_macos.cc",
"log_win.cc",
"log.h",
]
include_dirs = [
"..",
"//third_party"
]
}

View file

@ -0,0 +1,20 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "bin/embedded_dart_io.h"
#include "bin/eventhandler.h"
#include "bin/thread.h"
namespace dart {
namespace bin {
void BootstrapDartIo() {
// Bootstrap 'dart:io' event handler.
Thread::InitOnce();
EventHandler::Start();
}
} // namespace bin
} // namespace dart

View file

@ -0,0 +1,17 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef BIN_EMBEDDED_DART_IO_H_
#define BIN_EMBEDDED_DART_IO_H_
namespace dart {
namespace bin {
// Bootstraps 'dart:io'.
void BootstrapDartIo();
} // namespace bin
} // namespace dart
#endif // BIN_EMBEDDED_DART_IO_H_