• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/graphic/graphic_3d/lume/lume_config.gni")
16
17config("lume_3dtext_api") {
18  include_dirs = [ "api" ]
19  configs = [
20    "${LUME_CORE_PATH}:lume_base_api",
21    "${LUME_CORE_PATH}:lume_engine_api",
22    "${LUME_RENDER_PATH}:lume_render_api",
23    "${LUME_CORE3D_PATH}:lume_3d_api",
24    "${LUME_FONT_PATH}:lume_font_api",
25  ]
26}
27config("lume_3dtext_config") {
28  defines = [
29    "__OHOS_PLATFORM__",
30    "USE_STB_IMAGE=1",
31    "TEXT3D_ENABLE_EXTRUDING=0",
32    "CORE_PLUGIN=1",
33    "CORE_USE_COMPILER_GENERATED_STATIC_LIST=1",
34    "CORE_PERF_ENABLED=0",
35    "RENDER_HAS_VULKAN_BACKEND=1",
36    "RENDER_HAS_GLES_BACKEND=1",
37    "RENDER_HAS_GL_BACKEND=0",
38    "RENDER_PERF_ENABLED=0",
39    "RENDER_DEBUG_MARKERS_ENABLED=0",
40    "RENDER_HAS_EXPERIMENTAL=0",
41  ]
42  cflags = [
43    "-Wno-unused-function",
44    "-Wno-unused-parameter",
45    "-Wno-sign-compare",
46    "-Wno-unused-variable",
47    "-Wno-unused-private-field",
48    "-Wno-tautological-unsigned-zero-compare",
49    "-Wno-logical-op-parentheses",
50    "-Wno-unused-local-typedef",
51    "-fvisibility=hidden",
52    "-ffunction-sections",
53    "-fdata-sections",
54    "-Wno-ignored-qualifiers",
55  ]
56  cflags_cc = [
57    "-std=c++17",
58    "-Wno-overloaded-virtual",
59    "-Wno-thread-safety-attributes",
60    "-Wno-missing-braces",
61  ]
62}
63
64ohos_source_set("lume_3dtext_src") {
65  configs = [
66    ":lume_3dtext_api",
67    ":lume_3dtext_config",
68    "${LUME_CORE_PATH}:lume_component_help_config",
69  ]
70
71  sources = [
72    "src/ecs/components/text_component_manager.cpp",
73    "src/ecs/systems/text_system.cpp",
74    "src/plugin/plugin.cpp",
75    "version.cpp"
76  ]
77
78  include_dirs = [
79    "src"
80  ]
81
82  deps = [
83  ]
84  external_deps = [ "c_utils:utils" ]
85  part_name = "graphic_3d"
86  subsystem_name = "graphic"
87}
88
89lume_compile_shader("lume_3dtext_compile_shader") {
90  script = "${LUME_CORE_PATH}/tools/CompilerShader.sh"
91  outputs = [ "$target_gen_dir" ]
92  tool_path = "$target_gen_dir/../LumeBinaryCompile/LumeShaderCompiler"
93  dest_gen_path = "$target_gen_dir/assets"
94  asset_path = rebase_path("./assets/text_3d", root_build_dir)
95  shader_path = "${dest_gen_path}/shaders"
96  include_path = rebase_path("api", root_build_dir)
97  render_include_path = "${LUME_PATH}/${RENDER_DIR_NAME}/api/"
98  compileShader_deps =
99      [ "${LUME_BINARY_PATH}/LumeShaderCompiler:lume_binary_shader_compile" ]
100  if (ohos_indep_compiler_enable) {
101    tool_path = "//prebuilts/graphics_3d/AGPBinaryCompile"
102    compileShader_deps -= [
103      "${LUME_BINARY_PATH}/LumeShaderCompiler:lume_binary_shader_compile",
104    ]
105  }
106}
107
108lume_rofs("lume_3dtext_rofs") {
109  base_name = "lume_3dtext"
110  output_obj = ""
111  if (target_cpu == "arm") {
112    output_obj = "${base_name}_32.o"
113  }
114
115  if (target_cpu == "arm64") {
116    output_obj = "${base_name}_64.o"
117  }
118
119  if (target_cpu == "x86") {
120    output_obj = "${base_name}_x32.o"
121  }
122
123  if (target_cpu == "x64") {
124    output_obj = "${base_name}_x64.o"
125  }
126
127  outputs = "${target_gen_dir}/assets/${output_obj}"
128
129  tool_path = "$target_gen_dir/../LumeBinaryCompile/lumeassetcompiler"
130  root = "/"
131  bin_name = "BINARY_DATA_FOR_TEXT3D"
132  size_name = "SIZE_OF_DATA_FOR_TEXT3D"
133  script = "${LUME_CORE_PATH}/tools/CompilerAsset.sh"
134  copy_path = "$target_gen_dir/assets"
135  compileShader_deps = [
136    ":lume_3dtext_compile_shader",
137    "${LUME_BINARY_PATH}/lumeassetcompiler:lume_binary_assets_compile",
138  ]
139  if (ohos_indep_compiler_enable) {
140    tool_path = "//prebuilts/graphics_3d/AGPBinaryCompile/"
141    compileShader_deps -= [
142      "${LUME_BINARY_PATH}/lumeassetcompiler:lume_binary_assets_compile",
143    ]
144  }
145  file_extension = "\".spv;.json;.lsb;.shader;.shadergs;.shadervid;.shaderpl;.rng;.gl;.gles\""
146}
147
148source_set("lume_3dtext_rofs_obj") {
149  base_name = "lume_3dtext"
150  output_obj = ""
151  if (target_cpu == "arm") {
152    output_obj = "${base_name}_32.o"
153  }
154
155  if (target_cpu == "arm64") {
156    output_obj = "${base_name}_64.o"
157  }
158
159  if (target_cpu == "x86") {
160    output_obj = "${base_name}_x32.o"
161  }
162
163  if (target_cpu == "x64") {
164    output_obj = "${base_name}_x64.o"
165  }
166
167  sources = [ "${target_gen_dir}/assets/${output_obj}" ]
168  deps = [ ":lume_3dtext_rofs" ]
169}
170
171ohos_shared_library("libPluginAGP3DText") {
172  deps = [
173    ":lume_3dtext_rofs_obj",
174    ":lume_3dtext_src",
175  ]
176  relative_install_dir = "graphics3d"
177  part_name = "graphic_3d"
178  subsystem_name = "graphic"
179}
180