| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//third_party/quickjs/compiled_js.gni") |
| |
| static_library("lib") { |
| sources = [ |
| "fdio.cc", |
| "fdio.h", |
| "fidl.cc", |
| "fidl.h", |
| "object_converter.cc", |
| "object_converter.h", |
| "qjs_util.h", |
| "runtime.cc", |
| "runtime.h", |
| "sys.cc", |
| "sys.h", |
| "zx.cc", |
| "zx.h", |
| ] |
| |
| public_deps = [ |
| ":fidl", |
| ":zx", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/shell/mirror:client", |
| "//src/lib/fidl_codec", |
| "//src/lib/line_input", |
| "//third_party/quickjs:qjs-lib", |
| "//zircon/public/lib/fidl_base", |
| "//zircon/public/lib/zx", |
| |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. |
| "//zircon/third_party/rapidjson", |
| ] |
| } |
| |
| compiled_js("fidl") { |
| source = "fidl.js" |
| module = true |
| extra_args = [ |
| "-M", |
| "fidl_internal", |
| ] |
| } |
| |
| compiled_js("zx") { |
| source = "zx.js" |
| module = true |
| extra_args = [ |
| "-M", |
| "zx_internal", |
| ] |
| } |
| |
| action("js_libs") { |
| script = "generate_js_libs.sh" |
| sources = [ |
| "ns.js", |
| "pp.js", |
| "task.js", |
| "util.js", |
| ] |
| generated_output = "$target_gen_dir/libs.manifest" |
| outputs = [ "$generated_output" ] |
| args = [ rebase_path("$generated_output", root_build_dir) ] + |
| rebase_path(sources, root_build_dir) |
| } |
| |
| compiled_js("repl_init") { |
| source = "repl_init.js" |
| module = true |
| extra_args = [ |
| "-M", |
| "li_internal", |
| ] |
| } |
| |
| executable("spawn_child_test_util") { |
| testonly = true |
| |
| sources = [ "spawn_child_test_util.cc" ] |
| deps = [ "//sdk/fidl/fuchsia.sys" ] |
| } |
| |
| source_set("tests") { |
| testonly = true |
| sources = [ |
| "fidl_test.cc", |
| "js_testing_utils.h", |
| "ns_test.cc", |
| "pp_test.cc", |
| "task_test.cc", |
| "zx_test.cc", |
| ] |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.sys", |
| "//sdk/lib/fdio", |
| "//sdk/lib/fidl/cpp:test_support", |
| "//sdk/lib/fidl/cpp/test", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/shell/josh/console", |
| "//src/lib/fidl_codec:json_for_test", |
| "//src/sys/component_index/fidl:index", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/memfs", |
| "//zircon/system/ulib/task-utils", |
| ] |
| } |