From 602771c7d41e957df88594b43272062bf47ce31f Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Tue, 23 Jul 2019 19:22:42 -0700 Subject: [PATCH] [fuchsia] Add support for libs in packages (flutter/engine#10081) --- .../shell/platform/fuchsia/flutter/BUILD.gn | 29 +++++++++++++++++++ .../src/flutter/tools/fuchsia/package_dir.gni | 9 ++++++ 2 files changed, 38 insertions(+) diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index af89c2c101..2f90dd2951 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -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") diff --git a/engine/src/flutter/tools/fuchsia/package_dir.gni b/engine/src/flutter/tools/fuchsia/package_dir.gni index b7f6b5361c..f927d97a41 100644 --- a/engine/src/flutter/tools/fuchsia/package_dir.gni +++ b/engine/src/flutter/tools/fuchsia/package_dir.gni @@ -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)