1 Star 0 Fork 27

sig-ci-test/third_party_libjpeg-turbo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.gn 4.17 KB
一键复制 编辑 原始数据 按行查看 历史
dongzhengkuan 提交于 2023-06-12 07:07 . update BUILD.gn.
# Copyright (c) 2023 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")
}
jpeg_sources = [
"jcapimin.c",
"jcapistd.c",
"jccoefct.c",
"jccolor.c",
"jcdctmgr.c",
"jchuff.c",
"jcicc.c",
"jcinit.c",
"jcmainct.c",
"jcmarker.c",
"jcmaster.c",
"jcomapi.c",
"jcparam.c",
"jcphuff.c",
"jcprepct.c",
"jcsample.c",
"jctrans.c",
"jdapimin.c",
"jdapistd.c",
"jdatadst.c",
"jdatasrc.c",
"jdcoefct.c",
"jdcolor.c",
"jddctmgr.c",
"jdhuff.c",
"jdicc.c",
"jdinput.c",
"jdmainct.c",
"jdmarker.c",
"jdmaster.c",
"jdmerge.c",
"jdphuff.c",
"jdpostct.c",
"jdsample.c",
"jdtrans.c",
"jerror.c",
"jfdctflt.c",
"jfdctfst.c",
"jfdctint.c",
"jidctflt.c",
"jidctfst.c",
"jidctint.c",
"jidctred.c",
"jmemmgr.c",
"jmemnobs.c",
"jquant1.c",
"jquant2.c",
"jutils.c",
]
include_dirs = []
define_config = []
cflags = []
mkernel = defined(ohos_kernel_type) && ohos_kernel_type == "liteos_m"
if (mkernel || is_win) {
jpeg_sources += [ "jsimd_none.c" ]
define_config += [
"NO_PUTENV",
"NO_GETENV",
]
} else if (current_cpu == "arm" || current_cpu == "arm64") {
jpeg_sources += [
"simd/arm/jcgray-neon.c",
"simd/arm/jcphuff-neon.c",
"simd/arm/jcsample-neon.c",
"simd/arm/jdmerge-neon.c",
"simd/arm/jdsample-neon.c",
"simd/arm/jfdctfst-neon.c",
"simd/arm/jidctred-neon.c",
"simd/arm/jquanti-neon.c",
]
# NEON_INTRINSICS as default
jpeg_sources += [
"simd/arm/jccolor-neon.c",
"simd/arm/jidctfst-neon.c",
"simd/arm/jidctint-neon.c",
]
define_config += [ "NEON_INTRINSICS" ]
cflags += [ "-DNEON_INTRINSICS" ]
include_dirs += [ "//third_party/libjpeg-turbo/simd/arm" ]
if (current_cpu == "arm") {
jpeg_sources += [
"simd/arm/aarch32/jchuff-neon.c",
"simd/arm/aarch32/jsimd.c",
"simd/arm/jdcolor-neon.c",
"simd/arm/jfdctint-neon.c",
]
cflags += [
"-mfpu=neon",
"-mfloat-abi=softfp",
]
} else {
jpeg_sources += [
"simd/arm/aarch64/jchuff-neon.c",
"simd/arm/aarch64/jsimd.c",
"simd/arm/jdcolor-neon.c",
"simd/arm/jfdctint-neon.c",
]
}
} else {
jpeg_sources += [ "jsimd_none.c" ]
}
if (!defined(ohos_lite)) {
jpeg_sources += [
# enable arith codec
"jaricom.c",
"jcarith.c",
"jdarith.c",
"jdatadst-tj.c",
"jdatasrc-tj.c",
"rdbmp.c",
"rdppm.c",
"transupp.c",
# enable turbo
"turbojpeg.c",
"wrbmp.c",
"wrppm.c",
]
define_config += [
"C_ARITH_CODING_SUPPORTED=1", #Support arithmetic encoding
"D_ARITH_CODING_SUPPORTED=1", #Support arithmetic decoding
"BMP_SUPPORTED=1", #Support arithmetic decoding
"PPM_SUPPORTED=1", #Support arithmetic decoding
]
}
config("turbojpeg_config") {
include_dirs += [ "//third_party/libjpeg-turbo" ]
defines = define_config
}
if (defined(ohos_lite)) {
lite_library("libjpeg") {
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
} else {
target_type = "shared_library"
}
sources = jpeg_sources
public_configs = [ ":turbojpeg_config" ]
if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
cflags += [
"--diag_suppress",
"Pa181,Pe301,Pe546",
]
cflags_cc = cflags
}
}
} else {
ohos_static_library("turbojpeg_static") {
sources = jpeg_sources
public_configs = [ ":turbojpeg_config" ]
}
ohos_shared_library("turbojpeg") {
sources = jpeg_sources
public_configs = [ ":turbojpeg_config" ]
part_name = "libjpeg-turbo"
subsystem_name = "thirdparty"
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sig-ci-test/third_party_libjpeg-turbo.git
[email protected]:sig-ci-test/third_party_libjpeg-turbo.git
sig-ci-test
third_party_libjpeg-turbo
third_party_libjpeg-turbo
master

搜索帮助