1# Copyright (c) 2022 Huawei Device Co., Ltd.. All rights reserved. 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/arkui/ace_engine/ace_config.gni") 16import("$graphic_2d_root/rosen/modules/2d_engine/rosen_text/config.gni") 17 18config("rosen_text_config") { 19 cflags_cc = [ 20 "-Wno-implicit-fallthrough", 21 "-Os", 22 ] 23 include_dirs = [ 24 "$rosen_2d_engine_root", 25 "//third_party_icu/icu4c/source/common", 26 ] 27 28 if (defined(use_new_skia) && use_new_skia) { 29 include_dirs += [ "$flutter_root/txt/src" ] 30 } else { 31 include_dirs += [ "$flutter_root/engine/flutter/third_party/txt/src" ] 32 } 33} 34 35template("rosen_text_properties") { 36 forward_variables_from(invoker, "*") 37 38 ohos_source_set(target_name) { 39 defines += invoker.defines 40 cflags_cc += invoker.cflags_cc 41 42 public_configs = [ 43 "$ace_flutter_engine_root/icu:icu_config_$platform", 44 "$ace_flutter_engine_root:flutter_config", 45 ":rosen_text_config", 46 ] 47 48 sources = [ 49 "font_collection_txt.cpp", 50 "placeholder_run.cpp", 51 "rosen_converter_txt.cpp", 52 "text_style.cpp", 53 "typography_create_txt.cpp", 54 "typography_style.cpp", 55 "typography_txt.cpp", 56 ] 57 58 public_deps = 59 [ "//third_party/flutter/build/libtxt:thirdparty_lib_txt_$current_os" ] 60 part_name = "graphic_2d" 61 subsystem_name = "graphic" 62 } 63} 64 65foreach(item, ace_platforms) { 66 rosen_text_properties("rosen_text_properties_" + item.name) { 67 platform = item.name 68 defines = [] 69 cflags_cc = [] 70 config = { 71 } 72 73 if (defined(item.config)) { 74 config = item.config 75 } 76 77 if (defined(config.defines)) { 78 defines = config.defines 79 } 80 81 if (defined(config.cflags_cc)) { 82 cflags_cc = config.cflags_cc 83 } 84 } 85} 86