Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[darwin] Move common targets to common/BUILD.gn #44335

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ group("unittests") {
if (is_mac) {
public_deps += [
"//flutter/impeller/golden_tests:impeller_golden_tests",
"//flutter/shell/platform/darwin:flutter_channels_unittests",
"//flutter/shell/platform/darwin/common:framework_common_unittests",
"//flutter/third_party/spring_animation:spring_animation_unittests",
]
}
Expand Down
68 changes: 0 additions & 68 deletions shell/platform/darwin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
assert(is_mac || is_ios)

import("//flutter/shell/platform/config.gni")
import("//flutter/testing/testing.gni")

group("darwin") {
if (is_ios) {
Expand All @@ -18,70 +17,3 @@ group("darwin") {
}
}
}

source_set("flutter_channels") {
cflags_objc = flutter_cflags_objc
cflags_objcc = flutter_cflags_objcc

sources = [
"common/buffer_conversions.h",
"common/buffer_conversions.mm",
]

deps = [ "//flutter/fml" ]

public_deps = [ ":flutter_channels_arc" ]

public_configs = [ "//flutter:config" ]
}

source_set("flutter_channels_arc") {
cflags_objc = flutter_cflags_objc_arc
cflags_objcc = flutter_cflags_objcc_arc

sources = [
"common/framework/Headers/FlutterBinaryMessenger.h",
"common/framework/Headers/FlutterChannels.h",
"common/framework/Headers/FlutterCodecs.h",
"common/framework/Headers/FlutterMacros.h",
"common/framework/Source/FlutterChannels.mm",
"common/framework/Source/FlutterCodecs.mm",
"common/framework/Source/FlutterStandardCodec.mm",
"common/framework/Source/FlutterStandardCodecHelper.cc",
"common/framework/Source/FlutterStandardCodec_Internal.h",
]

public = [
"common/framework/Headers/FlutterBinaryMessenger.h",
"common/framework/Headers/FlutterChannels.h",
"common/framework/Headers/FlutterCodecs.h",
"common/framework/Headers/FlutterMacros.h",
"common/framework/Source/FlutterStandardCodec_Internal.h",
]

public_configs = [ "//flutter:config" ]

deps = [ "//flutter/fml" ]
}

test_fixtures("flutter_channels_fixtures") {
fixtures = []
}

executable("flutter_channels_unittests") {
testonly = true

sources = [
"common/framework/Source/flutter_codecs_unittest.mm",
"common/framework/Source/flutter_standard_codec_unittest.mm",
]

deps = [
":flutter_channels",
":flutter_channels_fixtures",
"//flutter/testing",
"//third_party/dart/runtime:libdart_jit",
]

public_configs = [ "//flutter:config" ]
}
32 changes: 29 additions & 3 deletions shell/platform/darwin/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

assert(is_mac || is_ios)

import("//flutter/common/config.gni")
import("framework_shared.gni")
import("//flutter/testing/testing.gni")
import("framework_common.gni")

source_set("common") {
cflags_objc = flutter_cflags_objc
Expand All @@ -29,7 +32,7 @@ config("framework_relative_headers") {
}

# Framework code shared between iOS and macOS.
source_set("framework_shared") {
source_set("framework_common") {
cflags_objc = flutter_cflags_objc_arc
cflags_objcc = flutter_cflags_objcc_arc

Expand All @@ -43,7 +46,7 @@ source_set("framework_shared") {
"framework/Source/FlutterStandardCodec_Internal.h",
]

public = framework_shared_headers
public = framework_common_headers

public += [ "framework/Source/FlutterNSBundleUtils.h" ]

Expand All @@ -56,3 +59,26 @@ source_set("framework_shared") {

deps = [ "//flutter/fml" ]
}

test_fixtures("framework_common_fixtures") {
fixtures = []
}

# Unit tests for channels.
executable("framework_common_unittests") {
testonly = true

sources = [
"framework/Source/flutter_codecs_unittest.mm",
"framework/Source/flutter_standard_codec_unittest.mm",
]

deps = [
":framework_common",
":framework_common_fixtures",
"//flutter/testing",
"//third_party/dart/runtime:libdart_jit",
]

public_configs = [ "//flutter:config" ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

framework_shared_headers =
framework_common_headers =
get_path_info([
"framework/Headers/FlutterMacros.h",
"framework/Headers/FlutterBinaryMessenger.h",
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/graphics/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ source_set("graphics") {
"//flutter/display_list",
"//flutter/fml",
"//flutter/shell/common",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
]

if (impeller_supports_rendering) {
Expand Down
12 changes: 6 additions & 6 deletions shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import("//build/toolchain/clang.gni")
import("//flutter/common/config.gni")
import("//flutter/shell/config.gni")
import("//flutter/shell/gpu/gpu.gni")
import("//flutter/shell/platform/darwin/common/framework_shared.gni")
import("//flutter/shell/platform/darwin/common/framework_common.gni")
import("//flutter/testing/testing.gni")

_flutter_framework_dir = "$root_out_dir/Flutter.framework"
Expand Down Expand Up @@ -52,7 +52,7 @@ source_set("flutter_framework_source_arc") {
":flutter_framework_source",
"//flutter/fml",
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
"//third_party/icu",
]
public_configs = [ "//flutter:config" ]
Expand Down Expand Up @@ -189,7 +189,7 @@ source_set("flutter_framework_source") {
"//flutter/shell/common",
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/darwin/common",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/profiling:profiling",
"//flutter/third_party/spring_animation",
Expand Down Expand Up @@ -243,7 +243,7 @@ source_set("ios_test_flutter_mrc") {
"//flutter/common:common",
"//flutter/lib/ui:ui",
"//flutter/shell/common:common",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/third_party/tonic",
"//flutter/third_party/txt",
Expand Down Expand Up @@ -308,7 +308,7 @@ shared_library("ios_test_flutter") {
":ios_test_flutter_mrc",
"//flutter/common:common",
"//flutter/lib/ui:ui",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/third_party/spring_animation",
Expand Down Expand Up @@ -397,7 +397,7 @@ action("copy_framework_headers") {
script = "//flutter/sky/tools/install_framework_headers.py"
visibility = [ ":*" ]
sources = get_path_info(_flutter_framework_headers, "abspath") +
framework_shared_headers
framework_common_headers
outputs = []
foreach(header, sources) {
header_basename = get_path_info(header, "file")
Expand Down
8 changes: 4 additions & 4 deletions shell/platform/darwin/macos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assert(is_mac)
import("//build/config/mac/mac_sdk.gni")
import("//flutter/build/zip_bundle.gni")
import("//flutter/shell/gpu/gpu.gni")
import("//flutter/shell/platform/darwin/common/framework_shared.gni")
import("//flutter/shell/platform/darwin/common/framework_common.gni")
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/testing/testing.gni")

Expand Down Expand Up @@ -121,7 +121,7 @@ source_set("flutter_framework_source") {
"//flutter/shell/platform/common:common_cpp_enums",
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/common:common_cpp_switches",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
"//flutter/shell/platform/darwin/graphics:graphics",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//third_party/skia",
Expand Down Expand Up @@ -204,7 +204,7 @@ executable("flutter_desktop_darwin_unittests") {
":flutter_framework_source",
"//flutter/shell/platform/common:common_cpp_accessibility",
"//flutter/shell/platform/common:common_cpp_enums",
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/common:framework_common",
"//flutter/shell/platform/darwin/graphics",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
Expand Down Expand Up @@ -241,7 +241,7 @@ action("copy_framework_headers") {
script = "//flutter/sky/tools/install_framework_headers.py"
visibility = [ ":*" ]
sources = get_path_info(_flutter_framework_headers, "abspath") +
framework_shared_headers
framework_common_headers
outputs = []
foreach(header, sources) {
header_basename = get_path_info(header, "file")
Expand Down
2 changes: 1 addition & 1 deletion testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def make_test(name, flags=None, extra_env=None):
unittests += [
# The accessibility library only supports Mac and Windows.
make_test('accessibility_unittests'),
make_test('flutter_channels_unittests'),
make_test('framework_common_unittests'),
make_test('spring_animation_unittests'),
]

Expand Down