xref: /aosp_15_r20/external/skia/modules/skottie/BUILD.gn (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1# Copyright 2018 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import("../../gn/skia.gni")
7
8if (skia_enable_skottie) {
9  config("public_config") {
10    defines = [
11      "SK_ENABLE_SKOTTIE",
12      "SK_ENABLE_SKOTTIE_SKSLEFFECT",
13    ]
14    include_dirs = [ "include" ]
15  }
16
17  skia_component("skottie") {
18    check_includes = false
19    import("skottie.gni")
20    public_configs = [ ":public_config" ]
21    public = skia_skottie_public
22    sources = skia_skottie_sources
23    configs = [ "../../:skia_private" ]
24    deps = [
25      "../..:skia",
26      "../skresources",
27      "../sksg",
28      "../skshaper",
29      "../skunicode",
30    ]
31  }
32
33  if (defined(is_skia_standalone)) {
34    config("utils_config") {
35      include_dirs = [ "utils" ]
36    }
37    skia_source_set("utils") {
38      check_includes = false
39      testonly = true
40
41      public_configs = [ ":utils_config" ]
42      configs = [ "../../:skia_private" ]
43
44      sources = [
45        "utils/SkottieUtils.cpp",
46        "utils/TextEditor.cpp",
47        "utils/TextPreshape.cpp",
48      ]
49      deps = [
50        ":skottie",
51        "../..:skia",
52      ]
53    }
54
55    if (skia_enable_tools) {
56      skia_source_set("tests") {
57        testonly = true
58
59        configs = [
60          "../..:skia_private",
61          "../..:tests_config",
62        ]
63        sources = [
64          "src/SkottieTest.cpp",
65          "tests/AudioLayer.cpp",
66          "tests/Expression.cpp",
67          "tests/Image.cpp",
68          "tests/Keyframe.cpp",
69          "tests/PropertyObserver.cpp",
70          "tests/Shaper.cpp",
71          "tests/Text.cpp",
72        ]
73
74        deps = [
75          ":skottie",
76          "../..:skia",
77          "../..:test",
78          "../skshaper",
79          "../skunicode",
80        ]
81      }
82
83      skia_source_set("fuzz") {
84        check_includes = false
85        testonly = true
86
87        configs = [ "../..:skia_private" ]
88        include_dirs = [
89          "../../tools",
90          "../../tools/flags",
91          "../../tools/fonts",
92        ]
93        sources = [
94          "../../tools/Resources.cpp",
95          "../../tools/fonts/TestFontMgr.cpp",
96          "../../tools/fonts/TestSVGTypeface.cpp",
97          "../../tools/fonts/TestTypeface.cpp",
98          "fuzz/FuzzSkottieJSON.cpp",
99        ]
100
101        deps = [
102          "../..:skia",
103          "../svg",
104        ]
105
106        public_deps = [ ":skottie" ]
107      }
108
109      skia_source_set("tool") {
110        check_includes = false
111        testonly = true
112
113        configs = [ "../..:skia_private" ]
114        sources = [ "src/SkottieTool.cpp" ]
115
116        deps = [
117          "../..:flags",
118          "../..:gpu_tool_utils",
119          "../..:skia",
120          "../../experimental/ffmpeg:video_encoder",
121          "../skshaper",
122        ]
123
124        public_deps = [
125          ":skottie",
126          ":utils",
127        ]
128      }
129
130      # A couple of backend specific targets, to facilitate binary size experiments.
131      skia_source_set("tool_cpu") {
132        check_includes = false
133        testonly = true
134
135        configs = [ "../..:skia_private" ]
136        sources = [ "src/SkottieTool.cpp" ]
137        defines = [ "CPU_ONLY" ]
138
139        deps = [
140          "../..:flags",
141          "../..:gpu_tool_utils",
142          "../..:skia",
143          "../../experimental/ffmpeg:video_encoder",
144          "../skshaper",
145        ]
146
147        public_deps = [
148          ":skottie",
149          ":utils",
150        ]
151      }
152
153      skia_source_set("tool_gpu") {
154        check_includes = false
155        testonly = true
156
157        configs = [ "../..:skia_private" ]
158        sources = [ "src/SkottieTool.cpp" ]
159        defines = [ "GPU_ONLY" ]
160
161        deps = [
162          "../..:flags",
163          "../..:gpu_tool_utils",
164          "../..:skia",
165          "../../experimental/ffmpeg:video_encoder",
166          "../skshaper",
167        ]
168
169        public_deps = [
170          ":skottie",
171          ":utils",
172        ]
173      }
174
175      skia_source_set("preshape_tool") {
176        check_includes = false
177        testonly = true
178
179        configs = [ "../..:skia_private" ]
180        sources = [ "utils/PreshapeTool.cpp" ]
181
182        deps = [
183          "../..:flags",
184          "../..:skia",
185        ]
186
187        public_deps = [
188          ":skottie",
189          ":utils",
190        ]
191      }
192      skia_source_set("gm") {
193        check_includes = false
194        testonly = true
195
196        # would be nice to have a gm_config
197        include_dirs = [ "../../gm" ]
198
199        configs = [ "../..:skia_private" ]
200        sources = [
201          "gm/ExternalProperties.cpp",
202          "gm/SkottieGM.cpp",
203        ]
204
205        deps = [
206          ":skottie",
207          ":utils",
208          "../..:gpu_tool_utils",
209          "../..:skia",
210          "../..:tool_utils",
211          "../skshaper",
212        ]
213      }
214    }
215  }
216} else {
217  group("skottie") {
218  }
219  group("fuzz") {
220  }
221  group("gm") {
222  }
223  group("tests") {
224  }
225  group("utils") {
226  }
227}
228