mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Allow building the embedder API for the target toolchains. (#6069)
This commit is contained in:
parent
c62248bdd3
commit
c822ab26cf
2
BUILD.gn
2
BUILD.gn
@ -10,6 +10,7 @@ group("flutter") {
|
||||
public_deps = [
|
||||
"$flutter_root/lib/snapshot:generate_snapshot_bin",
|
||||
"$flutter_root/lib/snapshot:kernel_platform_files",
|
||||
"$flutter_root/shell/platform/embedder:flutter_engine",
|
||||
"$flutter_root/sky",
|
||||
]
|
||||
|
||||
@ -45,7 +46,6 @@ group("flutter") {
|
||||
"$flutter_root/runtime:runtime_unittests",
|
||||
"$flutter_root/shell/common:shell_unittests",
|
||||
"$flutter_root/shell/platform/embedder:embedder_unittests",
|
||||
"$flutter_root/shell/platform/embedder:flutter_engine",
|
||||
"$flutter_root/synchronization:synchronization_unittests",
|
||||
"$flutter_root/third_party/txt:txt_unittests",
|
||||
]
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
import("$flutter_root/testing/testing.gni")
|
||||
import("$flutter_root/shell/gpu/gpu.gni")
|
||||
import("$flutter_root/shell/platform/embedder/embedder.gni")
|
||||
|
||||
shell_gpu_configuration("embedder_gpu_configuration") {
|
||||
enable_software = false
|
||||
@ -205,14 +206,21 @@ if (is_mac) {
|
||||
}
|
||||
|
||||
group("flutter_engine") {
|
||||
# All platforms require the embedder dylib and headers.
|
||||
deps = [
|
||||
":copy_headers",
|
||||
":flutter_engine_library",
|
||||
]
|
||||
deps = []
|
||||
|
||||
# For the Mac, the dylib is packaged in a framework with the appropriate headers.
|
||||
if (is_mac) {
|
||||
deps += [ ":flutter_embedder_framework" ]
|
||||
build_embedder_api =
|
||||
current_toolchain == host_toolchain || embedder_for_target
|
||||
|
||||
if (build_embedder_api) {
|
||||
# All platforms require the embedder dylib and headers.
|
||||
deps += [
|
||||
":copy_headers",
|
||||
":flutter_engine_library",
|
||||
]
|
||||
|
||||
# For the Mac, the dylib is packaged in a framework with the appropriate headers.
|
||||
if (is_mac) {
|
||||
deps += [ ":flutter_embedder_framework" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
shell/platform/embedder/embedder.gni
Normal file
13
shell/platform/embedder/embedder.gni
Normal file
@ -0,0 +1,13 @@
|
||||
# Copyright 2018 The Flutter Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
declare_args() {
|
||||
# By default, the dynamic library target exposing the embedder API is only
|
||||
# built for the host. The reasoning is that platforms that have target
|
||||
# definitions would not need an embedder API because an embedder
|
||||
# implementation is already provided for said target. This flag allows tbe
|
||||
# builder to obtain a shared library exposing the embedder API for alternative
|
||||
# embedder implementations.
|
||||
embedder_for_target = false
|
||||
}
|
||||
5
tools/gn
5
tools/gn
@ -89,6 +89,8 @@ def to_gn_args(args):
|
||||
gn_args['is_debug'] = args.unoptimized
|
||||
gn_args['android_full_debug'] = args.target_os == 'android' and args.unoptimized
|
||||
gn_args['is_clang'] = not sys.platform.startswith(('cygwin', 'win'))
|
||||
|
||||
gn_args['embedder_for_target'] = args.embedder_for_target
|
||||
|
||||
enable_lto = args.lto
|
||||
if args.unoptimized:
|
||||
@ -234,9 +236,10 @@ def parse_args(args):
|
||||
parser.add_argument('--target-sysroot', type=str)
|
||||
parser.add_argument('--toolchain-prefix', type=str)
|
||||
|
||||
parser.add_argument('--use-glfw', action='store_true', default=False)
|
||||
parser.add_argument('--enable-vulkan', action='store_true', default=False)
|
||||
|
||||
parser.add_argument('--embedder-for-target', dest='embedder_for_target', action='store_true', default=False)
|
||||
|
||||
return parser.parse_args(args)
|
||||
|
||||
def main(argv):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user