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