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_2d/graphic_config.gni") 16 17is_ok = true 18 19## Build libtexgine.so {{{ 20config("libtexgine_config") { 21 visibility = [ ":*" ] 22 23 cflags = [ 24 "-Wall", 25 "-Werror", 26 "-g3", 27 "-std=c++17", 28 ] 29 30 include_dirs = [ 31 "src", 32 "export", 33 ] 34} 35 36config("libtexgine_public_config") { 37 include_dirs = [ 38 "export", 39 "texgine_drawing", 40 "//third_party/skia/third_party/externals/harfbuzz/src", 41 "//third_party/icu/icu4c/source/common", 42 "$graphic_2d_root/rosen/modules/render_service_base/include", 43 "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter", 44 "$graphic_2d_root/rosen/modules/2d_graphics/include", 45 "$graphic_2d_root/rosen/modules/2d_graphics/src", 46 "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export/rosen_text", 47 ] 48} 49 50ohos_source_set("libtexgine_source") { 51 if (is_ok) { 52 sources = [ 53 "export/symbol_animation/symbol_node_build.cpp", 54 "export/symbol_engine/hm_symbol_run.cpp", 55 "export/symbol_engine/hm_symbol_txt.cpp", 56 "src/bidi_processer.cpp", 57 "src/char_groups.cpp", 58 "src/dynamic_file_font_provider.cpp", 59 "src/dynamic_font_provider.cpp", 60 "src/dynamic_font_style_set.cpp", 61 "src/font_collection.cpp", 62 "src/font_config.cpp", 63 "src/font_manager.cpp", 64 "src/font_parser.cpp", 65 "src/font_providers.cpp", 66 "src/font_styles.cpp", 67 "src/init.cpp", 68 "src/line_breaker.cpp", 69 "src/measurer.cpp", 70 "src/measurer_impl.cpp", 71 "src/mock.cpp", 72 "src/opentype_parser/cmap_parser.cpp", 73 "src/opentype_parser/cmap_table_parser.cpp", 74 "src/opentype_parser/name_table_parser.cpp", 75 "src/opentype_parser/opentype_basic_type.cpp", 76 "src/opentype_parser/post_table_parser.cpp", 77 "src/opentype_parser/ranges.cpp", 78 "src/shaper.cpp", 79 "src/system_font_provider.cpp", 80 "src/texgine_exception.cpp", 81 "src/text_breaker.cpp", 82 "src/text_converter.cpp", 83 "src/text_merger.cpp", 84 "src/text_reverser.cpp", 85 "src/text_shaper.cpp", 86 "src/text_span.cpp", 87 "src/text_style.cpp", 88 "src/theme_font_provider.cpp", 89 "src/typeface.cpp", 90 "src/typography_builder_impl.cpp", 91 "src/typography_impl.cpp", 92 "src/typography_style.cpp", 93 "src/typography_types.cpp", 94 "src/utils/exlog.cpp", 95 "src/utils/logger.cpp", 96 "src/utils/memory_reporter.cpp", 97 "src/utils/trace_ohos.cpp", 98 "src/variant_font_style_set.cpp", 99 "src/variant_span.cpp", 100 "src/word_breaker.cpp", 101 ] 102 103 configs = [ 104 ":libtexgine_config", 105 "//build/config/compiler:exceptions", 106 ] 107 108 public_configs = [ ":libtexgine_public_config" ] 109 110 platform = current_os 111 if (platform == "mingw") { 112 platform = "windows" 113 } 114 115 public_deps = [ "texgine_drawing:libtexgine_drawing" ] 116 defines = [] 117 if (is_arkui_x) { 118 defines += [ "CROSS_PLATFORM" ] 119 public_deps += [ "//third_party/jsoncpp:jsoncpp_static" ] 120 } else { 121 public_deps += [ "//third_party/jsoncpp:jsoncpp" ] 122 } 123 if (defined(use_rosen_drawing) && use_rosen_drawing) { 124 defines += [ "USE_ROSEN_DRAWING" ] 125 if (ace_enable_gpu) { 126 defines += [ "ACE_ENABLE_GPU" ] 127 } 128 } 129 if (enable_text_gine) { 130 defines += [ "USE_GRAPHIC_TEXT_GINE" ] 131 } 132 deps = [ "//third_party/bounds_checking_function:libsec_static" ] 133 include_dirs = [ "//third_party/bounds_checking_function/include" ] 134 135 if (platform == "ohos") { 136 defines += [ "BUILD_NON_SDK_VER" ] 137 138 if (logger_enable_scope) { 139 defines += [ "LOGGER_ENABLE_SCOPE" ] 140 } 141 142 if (texgine_enable_debug_log) { 143 defines += [ "TEXGINE_ENABLE_DEBUGLOG" ] 144 } 145 146 external_deps = [ 147 "c_utils:utils", 148 "hilog:libhilog", 149 "hitrace:hitrace_meter", 150 ] 151 152 public_deps += 153 [ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ] 154 } else { 155 sources -= [ "src/utils/trace_ohos.cpp" ] 156 if (platform == "mac") { 157 defines += [ "BUILD_SDK_MAC" ] 158 public_deps += [ 159 "$graphic_2d_root/rosen/build/harfbuzz:rosen_libharfbuzz_$platform", 160 ] 161 } else { 162 public_deps += 163 [ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ] 164 } 165 } 166 if (platform == "android") { 167 defines += [ "BUILD_SDK_ANDROID" ] 168 } 169 if (platform == "ios") { 170 defines += [ "BUILD_SDK_IOS" ] 171 } 172 } 173 part_name = "graphic_2d" 174 subsystem_name = "graphic" 175} 176 177ohos_shared_library("libtexgine") { 178 public_deps = [ ":libtexgine_source" ] 179 180 platform = current_os 181 if (platform == "mingw") { 182 platform = "windows" 183 } 184 185 #the texengine process is only enabled_ Text_ Engine is valid if it is true 186 if (enable_text_gine) { 187 if (platform == "ohos") { 188 deps = [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ] 189 } else { 190 deps = [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics_new" ] 191 } 192 deps += [ "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client" ] 193 } 194 innerapi_tags = [ "platformsdk" ] 195 part_name = "graphic_2d" 196 subsystem_name = "graphic" 197} 198## Build libtexgine.so }}} 199