1 Star 0 Fork 86

dengkx/third_party_freetype

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.gn 4.99 KB
一键复制 编辑 原始数据 按行查看 历史
LK 提交于 2024-03-19 22:33 . 对libpng的静态依赖
# Copyright (c) 2020 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.
if (defined(ohos_lite)) {
import("//build/lite/config/component/lite_component.gni")
} else {
import("//build/ohos.gni")
}
config("freetype_config") {
defines = [ "FT2_BUILD_LIBRARY" ]
include_dirs = [ "${target_gen_dir}/freetype/include" ]
}
action("freetype_action") {
script = "//third_party/freetype/install.py"
outputs = [
"${target_gen_dir}/freetype/src/autofit/autofit.c",
"${target_gen_dir}/freetype/src/base/ftbase.c",
"${target_gen_dir}/freetype/src/base/ftbbox.c",
"${target_gen_dir}/freetype/src/base/ftbdf.c",
"${target_gen_dir}/freetype/src/base/ftbitmap.c",
"${target_gen_dir}/freetype/src/base/ftcid.c",
"${target_gen_dir}/freetype/src/base/ftdebug.c",
"${target_gen_dir}/freetype/src/base/ftfstype.c",
"${target_gen_dir}/freetype/src/base/ftgasp.c",
"${target_gen_dir}/freetype/src/base/ftglyph.c",
"${target_gen_dir}/freetype/src/base/ftgxval.c",
"${target_gen_dir}/freetype/src/base/ftinit.c",
"${target_gen_dir}/freetype/src/base/ftmm.c",
"${target_gen_dir}/freetype/src/base/ftotval.c",
"${target_gen_dir}/freetype/src/base/ftpatent.c",
"${target_gen_dir}/freetype/src/base/ftpfr.c",
"${target_gen_dir}/freetype/src/base/ftstroke.c",
"${target_gen_dir}/freetype/src/base/ftsynth.c",
"${target_gen_dir}/freetype/src/base/ftsystem.c",
"${target_gen_dir}/freetype/src/base/fttype1.c",
"${target_gen_dir}/freetype/src/base/ftwinfnt.c",
"${target_gen_dir}/freetype/src/bdf/bdf.c",
"${target_gen_dir}/freetype/src/cache/ftcache.c",
"${target_gen_dir}/freetype/src/cff/cff.c",
"${target_gen_dir}/freetype/src/cid/type1cid.c",
"${target_gen_dir}/freetype/src/gzip/ftgzip.c",
"${target_gen_dir}/freetype/src/lzw/ftlzw.c",
"${target_gen_dir}/freetype/src/pcf/pcf.c",
"${target_gen_dir}/freetype/src/pfr/pfr.c",
"${target_gen_dir}/freetype/src/psaux/psaux.c",
"${target_gen_dir}/freetype/src/pshinter/pshinter.c",
"${target_gen_dir}/freetype/src/psnames/psmodule.c",
"${target_gen_dir}/freetype/src/raster/raster.c",
"${target_gen_dir}/freetype/src/sdf/ftbsdf.c",
"${target_gen_dir}/freetype/src/sdf/ftsdf.c",
"${target_gen_dir}/freetype/src/sdf/ftsdfcommon.c",
"${target_gen_dir}/freetype/src/sdf/ftsdfrend.c",
"${target_gen_dir}/freetype/src/sfnt/sfnt.c",
"${target_gen_dir}/freetype/src/smooth/smooth.c",
"${target_gen_dir}/freetype/src/svg/ftsvg.c",
"${target_gen_dir}/freetype/src/truetype/truetype.c",
"${target_gen_dir}/freetype/src/type1/type1.c",
"${target_gen_dir}/freetype/src/type42/type42.c",
"${target_gen_dir}/freetype/src/winfonts/winfnt.c",
]
inputs = [ "//third_party/freetype/freetype-2.12.1.tar.xz" ]
freetype_path = rebase_path("${target_gen_dir}", root_build_dir)
freetype_source_path = rebase_path("//third_party/freetype", root_build_dir)
args = [
"--gen-dir",
"$freetype_path",
"--source-dir",
"$freetype_source_path",
]
}
if (defined(ohos_lite)) {
lite_library("freetype") {
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
} else {
target_type = "shared_library"
}
freetype_sources = get_target_outputs(":freetype_action")
deps = [ "//third_party/libpng:libpng" ]
sources = freetype_sources
include_dirs = [
"${target_gen_dir}/freetype/src/base",
"//third_party/libpng",
]
public_configs = [ ":freetype_config" ]
defines = [ "FT_CONFIG_OPTION_USE_PNG" ]
if (target_type == "static_library") {
deps += [ "//build/lite/config/component/zlib:zlib_static" ]
defines += [ "FT_CONFIG_OPTION_SYSTEM_ZLIB" ]
}
deps += [ ":freetype_action" ]
if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
cflags = [
"--diag_suppress",
"Pa082,Pa084,Pa128,Pe128,Pa134,Pa137,Pe550",
]
cflags_cc = cflags
}
}
lite_component("freetype_shared") {
features = [ ":freetype" ]
}
} else {
ohos_static_library("freetype_static") {
sources = get_target_outputs(":freetype_action")
include_dirs = [ "${target_gen_dir}/freetype/src/base" ]
public_configs = [ ":freetype_config" ]
deps = [
":freetype_action",
"//third_party/zlib:libz",
]
defines = [ "FT_CONFIG_OPTION_SYSTEM_ZLIB" ]
if (current_os == "ohos") {
external_deps = [ "libpng:libpng" ]
defines += [ "FT_CONFIG_OPTION_USE_PNG" ]
}
part_name = "freetype"
subsystem_name = "thirdparty"
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ksllh/third_party_freetype.git
git@gitee.com:ksllh/third_party_freetype.git
ksllh
third_party_freetype
third_party_freetype
master

搜索帮助