| # Copyright 2022 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. |
| # |
| # Artifacts from the Flutter Engine repository: https://github.com/flutter/engine |
| |
| load( |
| "@rules_fuchsia//fuchsia:defs.bzl", |
| "fuchsia_package_resource", |
| ) |
| |
| # ABI-stable interface for the Flutter embedder platform. Copied from the Flutter Engine. |
| cc_library( |
| name = "embedder_header", |
| hdrs = ["embedder.h"], |
| visibility = ["//src/embedder:__pkg__"], |
| ) |
| |
| # A debug version of libflutter_engine.so for the build's |
| # CPU architecture. |
| # TODO(akbiggs): Switch between debug vs. release builds. |
| cc_library( |
| name = "libflutter_engine_for_platform", |
| deps = select({ |
| ":arm64_cpu": ["//src/embedder/engine/debug_arm64:libflutter_engine"], |
| ":x64_cpu": ["//src/embedder/engine/debug_x64:libflutter_engine"], |
| }), |
| visibility = ["//visibility:public"], |
| ) |
| |
| # Package resource to include libflutter_engine.so into a Fuchsia package's |
| # libraries. |
| # |
| # You must include this in your package's dependencies if your package's binary |
| # has a dependency on `:libflutter_engine_for_platform`. |
| fuchsia_package_resource( |
| name = "libflutter_engine_pkg_resource", |
| src = select({ |
| ":arm64_cpu": "//src/embedder/engine/debug_arm64:libflutter_engine.so", |
| ":x64_cpu": "//src/embedder/engine/debug_x64:libflutter_engine.so", |
| }), |
| dest = "lib/libflutter_engine.so", |
| visibility = ["//visibility:public"], |
| ) |
| |
| config_setting( |
| name = "arm64_cpu", |
| values = {"cpu": "aarch64"}, |
| ) |
| |
| config_setting( |
| name = "x64_cpu", |
| values = {"cpu": "x86_64"}, |
| ) |