[mac] Build mac framework with app extension flag (flutter/engine#41011)

[mac] Build mac framework with app extension flag
This commit is contained in:
Chris Yang
2023-04-11 11:32:29 -07:00
committed by GitHub
parent 96c773ba3b
commit d753239cc0
4 changed files with 40 additions and 2 deletions

View File

@@ -2677,6 +2677,7 @@ ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTex
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputSemanticsObjectTest.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTextureRegistrar.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTextureRegistrar.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterUmbrellaImportTests.m + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm + ../../../flutter/LICENSE
@@ -5276,6 +5277,7 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTextu
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterTextureRegistrar.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterUmbrellaImportTests.m
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterView.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm

View File

@@ -61,6 +61,10 @@ if (is_ios || is_mac) {
"-Werror=overriding-method-mismatch",
"-Werror=undeclared-selector",
]
if (is_mac) {
flutter_cflags_objc += [ "-fapplication-extension" ]
}
flutter_cflags_objcc = flutter_cflags_objc
flutter_cflags_objc_arc = flutter_cflags_objc + [ "-fobjc-arc" ]
flutter_cflags_objcc_arc = flutter_cflags_objc_arc

View File

@@ -149,7 +149,10 @@ shared_library("flutter_framework_dylib") {
visibility = [ ":*" ]
output_name = "$_flutter_framework_name"
ldflags = [ "-Wl,-install_name,@rpath/$_flutter_framework_filename/$_framework_binary_subpath" ]
ldflags = [
"-Wl,-install_name,@rpath/$_flutter_framework_filename/$_framework_binary_subpath",
"-fapplication-extension",
]
deps = [ ":flutter_framework_source" ]
}
@@ -297,7 +300,7 @@ action("_generate_symlinks") {
}
group("flutter_framework") {
deps = [ ":_generate_symlinks" ]
deps = [ ":_generate_symlinks_and_verify_framework_module" ]
}
if (build_glfw_shell) {
@@ -334,3 +337,21 @@ generated_file("macos_framework_without_entitlement_config") {
deps = [ ":_generate_symlinks" ]
}
shared_library("_generate_symlinks_and_verify_framework_module") {
framework_search_path = rebase_path("$root_out_dir")
visibility = [ ":*" ]
cflags_objc = [ "-F$framework_search_path" ]
ldflags = [
"-F$framework_search_path",
"-fapplication-extension",
"-Xlinker",
"-fatal_warnings",
]
frameworks = [ "FlutterMacOS.framework" ]
sources = [ "framework/Source/FlutterUmbrellaImportTests.m" ]
deps = [ ":_generate_symlinks" ]
}

View File

@@ -0,0 +1,11 @@
// Copyright 2013 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.
// FLUTTER_NOLINT: https://github.com/flutter/flutter/issues/93360
// The only point of this file is to ensure that the Flutter framework umbrella header can be
// cleanly imported from an Objective-C translation unit. The target that uses this file copies the
// headers to a path that simulates how users would actually import the framework outside of the
// engine source root.
#import <FlutterMacOS/FlutterMacOS.h>