# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/graphic/graphic_2d/graphic_config.gni") is_ok = true ## Build libtexgine.so {{{ config("libtexgine_config") { visibility = [ ":*" ] cflags = [ "-Wall", "-Werror", "-g3", "-std=c++17", ] include_dirs = [ "src", "export", ] } config("libtexgine_public_config") { include_dirs = [ "export", "texgine_drawing", "$graphic_2d_root/rosen/modules/render_service_base/include", "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter", "$graphic_2d_root/rosen/modules/2d_graphics/include", "$graphic_2d_root/rosen/modules/2d_graphics/src", "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export/rosen_text", ] if (is_arkui_x) { include_dirs += [ "//third_party/icu/icu4c/source/common" ] } } ohos_source_set("libtexgine_source") { if (is_ok) { sources = [ "src/font_config.cpp", "src/font_descriptor_cache.cpp", "src/font_descriptor_mgr.cpp", "src/font_parser.cpp", "src/opentype_parser/cmap_table_parser.cpp", "src/opentype_parser/name_table_parser.cpp", "src/opentype_parser/opentype_basic_type.cpp", "src/opentype_parser/post_table_parser.cpp", "src/opentype_parser/ranges.cpp", "src/utils/exlog.cpp", "src/utils/logger.cpp", ] configs = [ ":libtexgine_config", "//build/config/compiler:exceptions", "//build/config/compiler:rtti", ] public_configs = [ ":libtexgine_public_config" ] platform = current_os if (platform == "mingw") { platform = "windows" } public_deps = [ "texgine_drawing:libtexgine_drawing" ] defines = [] external_deps = [] if (is_arkui_x) { defines += [ "CROSS_PLATFORM" ] public_deps += [ "//third_party/jsoncpp:jsoncpp_static" ] } if (defined(use_rosen_drawing) && use_rosen_drawing) { defines += [ "USE_ROSEN_DRAWING" ] if (rs_enable_gpu) { defines += [ "RS_ENABLE_GPU" ] } } if (enable_text_gine) { defines += [ "USE_GRAPHIC_TEXT_GINE" ] } if (is_arkui_x) { deps = [ "//third_party/bounds_checking_function:libsec_static", "//third_party/cJSON:cjson_static", ] } else { external_deps += [ "bounds_checking_function:libsec_static" ] } if (platform == "ohos") { defines += [ "BUILD_NON_SDK_VER", "OHOS_TEXT_ENABLE", ] if (logger_enable_scope) { defines += [ "LOGGER_ENABLE_SCOPE" ] } if (texgine_enable_debug_log) { defines += [ "TEXGINE_ENABLE_DEBUGLOG" ] } external_deps += [ "cJSON:cjson_static", "c_utils:utils", "hilog:libhilog", "hitrace:hitrace_meter", ] public_deps += [ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ] } else { if (platform == "mac") { defines += [ "BUILD_SDK_MAC" ] public_deps += [ "$graphic_2d_root/rosen/build/harfbuzz:rosen_libharfbuzz_$platform", ] } else { public_deps += [ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ] } if (platform == "android") { defines += [ "BUILD_SDK_ANDROID" ] } if (platform == "ios") { defines += [ "BUILD_SDK_IOS" ] } external_deps += [ "cJSON:cjson" ] } } part_name = "graphic_2d" subsystem_name = "graphic" } ohos_shared_library("libtexgine") { deps = [ ":libtexgine_source" ] platform = current_os if (platform == "mingw") { platform = "windows" } #the texengine process is only enabled_ Text_ Engine is valid if it is true if (enable_text_gine) { if (platform == "ohos") { deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ] } else { deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics_new" ] } deps += [ "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client" ] } innerapi_tags = [ "platformsdk" ] part_name = "graphic_2d" subsystem_name = "graphic" } ## Build libtexgine.so }}}