[fuchsia] Add support for libs in packages (flutter/engine#10081)

This commit is contained in:
Kaushik Iska
2019-07-23 19:22:42 -07:00
committed by GitHub
parent aa814d7621
commit 602771c7d4
2 changed files with 38 additions and 0 deletions

View File

@@ -193,6 +193,35 @@ template("jit_runner") {
},
]
fuchsia_sdk_lib = "//fuchsia/sdk/$host_os/arch/$host_cpu/lib"
libraries = [
{
name = "libasync-default.so"
path = rebase_path("$fuchsia_sdk_lib")
},
{
name = "libtrace-engine.so"
path = rebase_path("$fuchsia_sdk_lib")
},
{
name = "libfdio.so"
path = rebase_path("$fuchsia_sdk_lib")
},
{
name = "libmemfs.so"
path = rebase_path("$fuchsia_sdk_lib")
},
{
name = "libsyslog.so"
path = rebase_path("$fuchsia_sdk_lib")
},
{
name = "libvulkan.so"
path = rebase_path("$fuchsia_sdk_lib")
},
]
meta = [
{
path = rebase_path("meta/flutter_jit${product_suffix}_runner.cmx")

View File

@@ -17,6 +17,7 @@ template("package_dir") {
"deps",
"meta",
"resources",
"libraries",
])
if (!defined(package_name)) {
package_name = pkg_target_name
@@ -30,6 +31,9 @@ template("package_dir") {
if (!defined(resources)) {
resources = []
}
if (!defined(libraries)) {
libraries = []
}
}
far_base_dir = "$root_out_dir/${pkg_target_name}_far"
@@ -42,6 +46,11 @@ template("package_dir") {
copy_outputs += [ "$far_base_dir/data/${res.dest}" ]
}
foreach(lib, pkg.libraries) {
copy_sources += [ "${lib.path}/${lib.name}" ]
copy_outputs += [ "$far_base_dir/lib/${lib.name}" ]
}
action(target_name) {
script = "$flutter_root/tools/fuchsia/copy_path.py"
response_file_contents = rebase_path(copy_sources + copy_outputs)