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 #"CORE3D_PUBLIC=__attribute__((visibility(\"default\")))", 43 #"CORE_USE_COMPILER_GENERATED_STATIC_LIST=1", 44 #"CORE3D_SHARED_LIBRARY=1", 45 #"CORE3D_VALIDATION_ENABLED=0", 46 #"CORE3D_TESTS_ENABLED=0", 47 #"CORE3D_DEV_ENABLED=${CORE_DEV_ENABLED}", 48 #"CORE3D_PUBLIC=__attribute__((visibility(\"default\")))", 49 #"CORE_USE_COMPILER_GENERATED_STATIC_LIST=1", 50 #"CORE_STATIC_PLUGIN_HEADER=${CORE_STATIC_PLUGIN_HEADER }" 51 ] 52 cflags = [ 53 "-Wno-unused-function", 54 "-Wno-unused-parameter", 55 "-Wno-sign-compare", 56 "-Wno-unused-variable", 57 "-Wno-unused-private-field", 58 "-Wno-tautological-unsigned-zero-compare", 59 "-Wno-logical-op-parentheses", 60 "-Wno-unused-local-typedef", 61 "-fvisibility=hidden", 62 "-ffunction-sections", 63 "-fdata-sections", 64 "-Wno-ignored-qualifiers", 65 ] 66 cflags_cc = [ 67 "-std=c++17", 68 "-Wno-overloaded-virtual", 69 "-Wno-thread-safety-attributes", 70 "-Wno-missing-braces", 71 ] 72} 73 74ohos_source_set("lume_3dtext_src") { 75 configs = [ 76 ":lume_3dtext_api", 77 ":lume_3dtext_config", 78 79 #"${LUME_RENDER_PATH}:lume_render_api", 80 #"${LUME_CORE_PATH}:lume_base_api", 81 #"${LUME_CORE_PATH}:lume_engine_api", 82 "${LUME_CORE_PATH}:lume_component_help_config", 83 84 #"${LUME_SERIALIZER_PATH}:ecs_serializer_api", 85 #"${LUME_CORE_PATH}:lume_default" 86 ] 87 88 sources = [ 89 "src/ecs/components/text_component_manager.cpp", 90 "src/ecs/systems/text_system.cpp", 91 "src/plugin/plugin.cpp", 92 "version.cpp", 93 94 #"src/ecs/systems/text_system.h", 95 ] 96 97 include_dirs = [ 98 #"${LUME_BASE_PATH}/api", 99 #"${LUME_CORE_PATH}/api", 100 #"${LUME_RENDER_PATH}/api", 101 #"${LUME_CORE3D_PATH}/api", 102 #"${LUME_META_PATH}/include" 103 "src", 104 ] 105 106 deps = [ 107 #"${LUME_SERIALIZER_PATH}:EcsSerializer", 108 #"${LUME_META_PATH}:libPluginMetaObject", 109 #"${LUME_CORE_PATH}/ecshelper:libAGPEcshelper" 110 ] 111 external_deps = [ "c_utils:utils" ] 112 part_name = "graphic_3d" 113 subsystem_name = "graphic" 114} 115 116lume_compile_shader("lume_3dtext_compile_shader") { 117 script = "${LUME_CORE_PATH}/tools/CompilerShader.sh" 118 outputs = [ "$target_gen_dir" ] 119 tool_path = "$target_gen_dir/../LumeBinaryCompile/LumeShaderCompiler" 120 dest_gen_path = "$target_gen_dir/assets" 121 asset_path = rebase_path("./assets/text_3d", root_build_dir) 122 shader_path = "${dest_gen_path}/shaders" 123 include_path = rebase_path("api", root_build_dir) 124 render_include_path = "${LUME_PATH}/${RENDER_DIR_NAME}/api/" 125 compileShader_deps = 126 [ "${LUME_BINARY_PATH}/LumeShaderCompiler:lume_binary_shader_compile" ] 127} 128 129lume_rofs("lume_3dtext_rofs") { 130 base_name = "lume_3dtext" 131 output_obj = "" 132 if (target_cpu == "arm") { 133 output_obj = "${base_name}_32.o" 134 } 135 136 if (target_cpu == "arm64") { 137 output_obj = "${base_name}_64.o" 138 } 139 140 outputs = "${target_gen_dir}/assets/${output_obj}" 141 142 tool_path = "$target_gen_dir/../LumeBinaryCompile/lumeassetcompiler" 143 root = "/" 144 bin_name = "BINARY_DATA_FOR_TEXT3D" 145 size_name = "SIZE_OF_DATA_FOR_TEXT3D" 146 script = "${LUME_CORE_PATH}/tools/CompilerAsset.sh" 147 copy_path = "$target_gen_dir/assets" 148 compileShader_deps = [ 149 ":lume_3dtext_compile_shader", 150 "${LUME_BINARY_PATH}/lumeassetcompiler:lume_binary_assets_compile", 151 ] 152 file_extension = "\".spv;.json;.lsb;.shader;.shadergs;.shadervid;.shaderpl;.rng;.gl;.gles\"" 153} 154 155source_set("lume_3dtext_rofs_obj") { 156 base_name = "lume_3dtext" 157 output_obj = "" 158 if (target_cpu == "arm") { 159 output_obj = "${base_name}_32.o" 160 } 161 162 if (target_cpu == "arm64") { 163 output_obj = "${base_name}_64.o" 164 } 165 166 sources = [ "${target_gen_dir}/assets/${output_obj}" ] 167 deps = [ ":lume_3dtext_rofs" ] 168} 169 170ohos_shared_library("libPluginAGP3DText") { 171 deps = [ 172 ":lume_3dtext_rofs_obj", 173 ":lume_3dtext_src", 174 ] 175 relative_install_dir = "graphics3d" 176 part_name = "graphic_3d" 177 subsystem_name = "graphic" 178} 179