From 55cdf532e53d1120b0b10f5a20351ac18cfda96e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 30 Sep 2024 13:04:15 -0700 Subject: [PATCH] [Impeller] Create a libImpeller dylib and expose symbols. (flutter/engine#55526) --- engine/src/flutter/BUILD.gn | 1 + .../flutter/impeller/toolkit/interop/BUILD.gn | 18 ++++++++++-------- .../impeller/toolkit/interop/impeller.h | 12 ++++++++++-- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn index 34acd32563..9dd5c94ed8 100644 --- a/engine/src/flutter/BUILD.gn +++ b/engine/src/flutter/BUILD.gn @@ -210,6 +210,7 @@ group("unittests") { "//flutter/impeller:impeller_dart_unittests", "//flutter/impeller:impeller_unittests", "//flutter/impeller/toolkit/interop:example", + "//flutter/impeller/toolkit/interop:library", ] } diff --git a/engine/src/flutter/impeller/toolkit/interop/BUILD.gn b/engine/src/flutter/impeller/toolkit/interop/BUILD.gn index e165701af0..5fa2fe26d9 100644 --- a/engine/src/flutter/impeller/toolkit/interop/BUILD.gn +++ b/engine/src/flutter/impeller/toolkit/interop/BUILD.gn @@ -4,12 +4,6 @@ import("//flutter/impeller/tools/impeller.gni") -impeller_component("interop_public") { - public = [ "impeller.h" ] - - sources = [ "impeller_c.c" ] -} - impeller_component("interop") { sources = [ "color_filter.cc", @@ -27,6 +21,8 @@ impeller_component("interop") { "image_filter.cc", "image_filter.h", "impeller.cc", + "impeller.h", + "impeller_c.c", "mask_filter.cc", "mask_filter.h", "object.cc", @@ -43,8 +39,6 @@ impeller_component("interop") { "texture.h", ] - public_deps = [ ":interop_public" ] - deps = [ "../../base", "../../display_list", @@ -55,6 +49,14 @@ impeller_component("interop") { ] } +impeller_component("library") { + target_type = "shared_library" + + output_name = "impeller" + + deps = [ ":interop" ] +} + impeller_component("example") { target_type = "executable" diff --git a/engine/src/flutter/impeller/toolkit/interop/impeller.h b/engine/src/flutter/impeller/toolkit/interop/impeller.h index 62ebd6fbb2..112cfc317d 100644 --- a/engine/src/flutter/impeller/toolkit/interop/impeller.h +++ b/engine/src/flutter/impeller/toolkit/interop/impeller.h @@ -19,9 +19,17 @@ #define IMPELLER_EXTERN_C_END #endif // defined(__cplusplus) -#ifndef IMPELLER_EXPORT +#ifdef _WIN32 +#define IMPELLER_EXPORT_DECORATION __declspec(dllexport) +#else +#define IMPELLER_EXPORT_DECORATION __attribute__((visibility("default"))) +#endif + +#ifndef IMPELLER_NO_EXPORT +#define IMPELLER_EXPORT IMPELLER_EXPORT_DECORATION +#else // IMPELLER_NO_EXPORT #define IMPELLER_EXPORT -#endif // IMPELLER_EXPORT +#endif // IMPELLER_NO_EXPORT #ifdef __clang__ #define IMPELLER_NULLABLE _Nullable