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

Commit a49703b

Browse files
authored
[Impeller] Create a libImpeller dylib and expose symbols. (#55526)
1 parent 6c91618 commit a49703b

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ group("unittests") {
210210
"//flutter/impeller:impeller_dart_unittests",
211211
"//flutter/impeller:impeller_unittests",
212212
"//flutter/impeller/toolkit/interop:example",
213+
"//flutter/impeller/toolkit/interop:library",
213214
]
214215
}
215216

impeller/toolkit/interop/BUILD.gn

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
import("//flutter/impeller/tools/impeller.gni")
66

7-
impeller_component("interop_public") {
8-
public = [ "impeller.h" ]
9-
10-
sources = [ "impeller_c.c" ]
11-
}
12-
137
impeller_component("interop") {
148
sources = [
159
"color_filter.cc",
@@ -27,6 +21,8 @@ impeller_component("interop") {
2721
"image_filter.cc",
2822
"image_filter.h",
2923
"impeller.cc",
24+
"impeller.h",
25+
"impeller_c.c",
3026
"mask_filter.cc",
3127
"mask_filter.h",
3228
"object.cc",
@@ -43,8 +39,6 @@ impeller_component("interop") {
4339
"texture.h",
4440
]
4541

46-
public_deps = [ ":interop_public" ]
47-
4842
deps = [
4943
"../../base",
5044
"../../display_list",
@@ -55,6 +49,14 @@ impeller_component("interop") {
5549
]
5650
}
5751

52+
impeller_component("library") {
53+
target_type = "shared_library"
54+
55+
output_name = "impeller"
56+
57+
deps = [ ":interop" ]
58+
}
59+
5860
impeller_component("example") {
5961
target_type = "executable"
6062

impeller/toolkit/interop/impeller.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@
1919
#define IMPELLER_EXTERN_C_END
2020
#endif // defined(__cplusplus)
2121

22-
#ifndef IMPELLER_EXPORT
22+
#ifdef _WIN32
23+
#define IMPELLER_EXPORT_DECORATION __declspec(dllexport)
24+
#else
25+
#define IMPELLER_EXPORT_DECORATION __attribute__((visibility("default")))
26+
#endif
27+
28+
#ifndef IMPELLER_NO_EXPORT
29+
#define IMPELLER_EXPORT IMPELLER_EXPORT_DECORATION
30+
#else // IMPELLER_NO_EXPORT
2331
#define IMPELLER_EXPORT
24-
#endif // IMPELLER_EXPORT
32+
#endif // IMPELLER_NO_EXPORT
2533

2634
#ifdef __clang__
2735
#define IMPELLER_NULLABLE _Nullable

0 commit comments

Comments
 (0)