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 "$graphic_2d_root/rosen/modules/render_service_base/include", 41 "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter", 42 "$graphic_2d_root/rosen/modules/2d_graphics/include", 43 "$graphic_2d_root/rosen/modules/2d_graphics/src", 44 "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export/rosen_text", 45 ] 46} 47 48ohos_source_set("libtexgine_source") { 49 if (is_ok) { 50 sources = [ 51 "src/font_config.cpp", 52 "src/font_parser.cpp", 53 "src/opentype_parser/cmap_table_parser.cpp", 54 "src/opentype_parser/name_table_parser.cpp", 55 "src/opentype_parser/opentype_basic_type.cpp", 56 "src/opentype_parser/post_table_parser.cpp", 57 "src/opentype_parser/ranges.cpp", 58 "src/utils/exlog.cpp", 59 "src/utils/logger.cpp", 60 ] 61 62 configs = [ 63 ":libtexgine_config", 64 "//build/config/compiler:exceptions", 65 "//build/config/compiler:rtti", 66 ] 67 68 public_configs = [ ":libtexgine_public_config" ] 69 70 platform = current_os 71 if (platform == "mingw") { 72 platform = "windows" 73 } 74 75 public_deps = [ "texgine_drawing:libtexgine_drawing" ] 76 77 defines = [] 78 if (defined(use_rosen_drawing) && use_rosen_drawing) { 79 defines += [ "USE_ROSEN_DRAWING" ] 80 if (ace_enable_gpu) { 81 defines += [ "ACE_ENABLE_GPU" ] 82 } 83 } 84 if (enable_text_gine) { 85 defines += [ "USE_GRAPHIC_TEXT_GINE" ] 86 } 87 external_deps = [ "bounds_checking_function:libsec_static" ] 88 89 if (platform == "ohos") { 90 defines += [ "BUILD_NON_SDK_VER" ] 91 92 if (logger_enable_scope) { 93 defines += [ "LOGGER_ENABLE_SCOPE" ] 94 } 95 96 if (texgine_enable_debug_log) { 97 defines += [ "TEXGINE_ENABLE_DEBUGLOG" ] 98 } 99 100 external_deps += [ 101 "cJSON:cjson_static", 102 "c_utils:utils", 103 "hilog:libhilog", 104 "hitrace:hitrace_meter", 105 ] 106 107 public_deps += 108 [ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ] 109 } else { 110 if (platform == "mac") { 111 defines += [ "BUILD_SDK_MAC" ] 112 public_deps += [ 113 "$graphic_2d_root/rosen/build/harfbuzz:rosen_libharfbuzz_$platform", 114 ] 115 } else { 116 public_deps += 117 [ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ] 118 } 119 external_deps += [ "cJSON:cjson" ] 120 } 121 } 122 123 part_name = "graphic_2d" 124 subsystem_name = "graphic" 125} 126 127ohos_shared_library("libtexgine") { 128 deps = [ ":libtexgine_source" ] 129 130 platform = current_os 131 if (platform == "mingw") { 132 platform = "windows" 133 } 134 135 #the texengine process is only enabled_ Text_ Engine is valid if it is true 136 if (enable_text_gine) { 137 if (platform == "ohos") { 138 deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ] 139 } else { 140 deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics_new" ] 141 } 142 deps += [ "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client" ] 143 } 144 innerapi_tags = [ "platformsdk" ] 145 part_name = "graphic_2d" 146 subsystem_name = "graphic" 147} 148## Build libtexgine.so }}} 149