# Copyright (c) 2021 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/arkui/ace_engine/ace_config.gni") import("//third_party/flutter/flutter_config.gni") config("libsfntly_compile_flags") { cflags_cc = [ "-std=c++14", "-fno-exceptions", "-fno-rtti", "-fvisibility-inlines-hidden", ] cflags = [ "-w", "-fstrict-aliasing", "-fdata-sections", "-ffunction-sections", "-gline-tables-only", "-funwind-tables", "-Wno-unused-parameter", "-fvisibility=hidden", ] } config("libsfntly_configs") { include_dirs = [ "$flutter_root/skia/third_party/externals/sfntly/cpp/src" ] } template("ace_libsfntly") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { part_name = flutter_part subsystem_name = flutter_subsystem license_file = "$flutter_root/skia/third_party/externals/sfntly/cpp/COPYING.txt" defines += invoker.defines defines += [ "SFNTLY_NO_EXCEPTION", "U_USING_ICU_NAMESPACE=0", "SK_USING_THIRD_PARTY_ICU", ] configs = [ ":libsfntly_compile_flags" ] public_configs = [ ":libsfntly_configs" ] if (platform == "android") { configs += [ "$ace_root/build:reduce_eh_frame_config" ] } sources = [ "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sample/chromium/font_subsetter.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sample/chromium/subsetter_impl.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/byte_array.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/font_data.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/font_input_stream.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/font_output_stream.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/growable_memory_byte_array.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/memory_byte_array.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/readable_font_data.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/data/writable_font_data.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/font.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/font_factory.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/port/file_input_stream.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/port/lock.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/port/memory_input_stream.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/port/memory_output_stream.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/big_glyph_metrics.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/bitmap_glyph.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/bitmap_glyph_info.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/bitmap_size_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/composite_bitmap_glyph.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/ebdt_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/eblc_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/ebsc_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/glyph_metrics.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/index_sub_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/index_sub_table_format1.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/index_sub_table_format2.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/index_sub_table_format3.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/index_sub_table_format4.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/index_sub_table_format5.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/simple_bitmap_glyph.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/bitmap/small_glyph_metrics.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/byte_array_table_builder.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/cmap_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/font_header_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/horizontal_device_metrics_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/horizontal_header_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/horizontal_metrics_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/maximum_profile_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/name_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/core/os2_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/font_data_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/generic_table_builder.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/header.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/subtable.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/table_based_table_builder.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/truetype/glyph_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/table/truetype/loca_table.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/tag.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/tools/subsetter/glyph_table_subsetter.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/tools/subsetter/subsetter.cc", "$flutter_root/skia/third_party/externals/sfntly/cpp/src/sfntly/tools/subsetter/table_subsetter_impl.cc", ] if (platform == "windows") { libs = [ "pthread" ] } deps = [ "$ace_flutter_engine_root/icu:ace_libicu_$platform" ] } } foreach(item, ace_platforms) { ace_libsfntly("ace_libsfntly_" + item.name) { platform = item.name defines = [] config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines = config.defines } } }