• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 Google LLC.
2
3import("../../gn/skia.gni")
4import("../../modules/skshaper/skshaper.gni")
5
6declare_args() {
7  skia_enable_sktext = true
8  text_gms_enabled = true
9  text_tests_enabled = true
10  text_bench_enabled = false
11}
12
13if (skia_enable_sktext && skia_enable_skshaper && skia_use_icu &&
14    skia_use_harfbuzz) {
15  config("public_config") {
16    include_dirs = [ "include" ]
17  }
18
19  component("sktext") {
20    import("sktext.gni")
21    public_configs = [ ":public_config" ]
22    public = sktext_public
23    sources = sktext_sources
24    if (is_ohos) {
25      include_dirs = [ "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
26    }
27    if (use_oh_skia) {
28      deps = [
29        "../..:skia_canvaskit",
30        "../../modules/skshaper",
31        "../../modules/skunicode",
32      ]
33    } else {
34      deps = [
35        "../..:skia",
36        "../../modules/skshaper",
37        "../../modules/skunicode",
38      ]
39    }
40  }
41
42  if (defined(is_skia_standalone) && skia_enable_tools) {
43    source_set("gm") {
44      if (text_gms_enabled) {
45        testonly = true
46        sources = []
47        deps = [
48          ":sktext",
49          "../..:gpu_tool_utils",
50          "../..:skia",
51          "../../modules/skshaper",
52        ]
53      } else {
54        sources = []
55      }
56    }
57
58    source_set("tests") {
59      if (text_tests_enabled) {
60        testonly = true
61        sources = [
62          "tests/FontResolvedText.cpp",
63          "tests/SelectableText.cpp",
64          "tests/ShapedText.cpp",
65          "tests/UnicodeText.cpp",
66          "tests/WrappedText.cpp",
67        ]
68        if (is_ohos) {
69          include_dirs = [ "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
70        }
71        if (use_oh_skia) {
72          deps = [
73            ":sktext",
74            "../..:gpu_tool_utils",
75          ]
76        } else {
77          deps = [
78            ":sktext",
79            "../..:gpu_tool_utils",
80            "../..:skia",
81            "../../modules/skshaper",
82          ]
83        }
84      } else {
85        sources = []
86      }
87    }
88
89    source_set("bench") {
90      if (text_bench_enabled) {
91        testonly = true
92        sources = []
93        deps = [
94          ":sktext",
95          "../..:skia",
96          "../../modules/skshaper",
97        ]
98      } else {
99        sources = []
100      }
101    }
102
103    source_set("samples") {
104      testonly = true
105      sources = [
106        "editor/Cursor.cpp",
107        "editor/Editor.cpp",
108        "editor/Mouse.cpp",
109        "editor/Selection.cpp",
110        "editor/Texts.cpp",
111        "samples/Text.cpp",
112      ]
113      deps = [
114        ":sktext",
115        "../..:skia",
116        "../../modules/skshaper",
117      ]
118    }
119
120    skia_source_set("text_editor") {
121      testonly = true
122      sources = [
123        "editor/App.cpp",
124        "editor/Cursor.cpp",
125        "editor/Editor.cpp",
126        "editor/Mouse.cpp",
127        "editor/Selection.cpp",
128        "editor/Texts.cpp",
129      ]
130      public_deps = [ "../..:sk_app" ]
131      deps = [ ":sktext" ]
132    }
133  }
134} else {
135  group("sktext") {
136  }
137  group("gm") {
138  }
139  group("tests") {
140  }
141  group("bench") {
142  }
143  group("samples") {
144  }
145}
146