# Copyright (c) 2022 Huawei Device Co., Ltd.. All rights reserved. # 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/arkui/ace_engine/ace_config.gni") config("thirdparty_lib_txt_rosen_config") { cflags_cc = [ "-Wno-implicit-fallthrough", # "-fvisibility-inlines-hidden", "-Os", ] } if (defined(use_new_skia) && use_new_skia) { txt_root = "$flutter_root/txt" } else { txt_root = "$flutter_root/engine/flutter/third_party/txt" } template("thirdparty_lib_txt_rosen") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { defines += invoker.defines cflags_cc += invoker.cflags_cc public_configs = [ "$ace_flutter_engine_root/icu:icu_config_$platform" ] configs = [ "$ace_flutter_engine_root:flutter_config", ":thirdparty_lib_txt_rosen_config", ] if (platform == "android") { configs += [ "$ace_root/build:reduce_eh_frame_config" ] } include_dirs = [ "$flutter_root/engine" ] sources = [ "$txt_root/src/log/log.cc", "$txt_root/src/minikin/CmapCoverage.cpp", "$txt_root/src/minikin/Emoji.cpp", "$txt_root/src/minikin/FontCollection.cpp", "$txt_root/src/minikin/FontFamily.cpp", "$txt_root/src/minikin/FontLanguage.cpp", "$txt_root/src/minikin/FontLanguageListCache.cpp", "$txt_root/src/minikin/FontUtils.cpp", "$txt_root/src/minikin/GraphemeBreak.cpp", "$txt_root/src/minikin/HbFontCache.cpp", "$txt_root/src/minikin/Hyphenator.cpp", "$txt_root/src/minikin/Layout.cpp", "$txt_root/src/minikin/LayoutUtils.cpp", "$txt_root/src/minikin/LineBreaker.cpp", "$txt_root/src/minikin/Measurement.cpp", "$txt_root/src/minikin/MinikinFont.cpp", "$txt_root/src/minikin/MinikinInternal.cpp", "$txt_root/src/minikin/SparseBitSet.cpp", "$txt_root/src/minikin/WordBreaker.cpp", "$txt_root/src/txt/asset_font_manager.cc", "$txt_root/src/txt/font_asset_provider.cc", "$txt_root/src/txt/font_collection.cc", "$txt_root/src/txt/font_features.cc", "$txt_root/src/txt/font_skia.cc", "$txt_root/src/txt/paint_record.cc", "$txt_root/src/txt/paragraph_builder.cc", "$txt_root/src/txt/paragraph_builder_txt.cc", "$txt_root/src/txt/paragraph_style.cc", "$txt_root/src/txt/paragraph_txt.cc", "$txt_root/src/txt/placeholder_run.cc", "$txt_root/src/txt/styled_runs.cc", "$txt_root/src/txt/test_font_manager.cc", "$txt_root/src/txt/text_decoration.cc", "$txt_root/src/txt/text_shadow.cc", "$txt_root/src/txt/text_style.cc", "$txt_root/src/txt/typeface_font_asset_provider.cc", "$txt_root/src/utils/JenkinsHash.cpp", ] deps = [ "$ace_flutter_engine_root:flutter_engine_fml_$platform" ] external_deps = [ "hilog:libhilog" ] if (defined(use_new_skia) && use_new_skia) { public_deps = [ "//third_party/skia:skia_$platform" ] } else { public_deps = [ "$ace_flutter_engine_root/skia:ace_skia_$platform" ] } if (platform == "ohos") { if (defined(oem_commercial_build) && oem_commercial_build) { sources += [ "$txt_root/src/txt/platform_android.cc" ] } else { sources += [ "$txt_root/src/txt/platform_ohos.cc" ] } } else if (platform == "windows") { sources += [ "$txt_root/src/txt/platform.cc" ] } else if (platform == "mac") { sources += [ "$txt_root/src/txt/platform_mac.mm" ] } else if (platform == "android") { sources += [ "$txt_root/src/txt/platform_android.cc" ] } part_name = "graphic_2d" subsystem_name = "graphic" } } foreach(item, ace_platforms) { thirdparty_lib_txt_rosen("thirdparty_lib_txt_rosen_" + item.name) { platform = item.name defines = [] cflags_cc = [] config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines = config.defines } if (defined(config.cflags_cc)) { cflags_cc = config.cflags_cc } } }