mirror of
https://github.com/openharmony/third_party_lzma.git
synced 2026-07-01 02:07:13 -04:00
a653e5a5d1
Signed-off-by: zhou_xq <zhouxiaoqin4@huawei.com>
198 lines
4.4 KiB
Plaintext
198 lines
4.4 KiB
Plaintext
# 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/config/arm.gni")
|
|
import("//build/ohos.gni")
|
|
import("./lzma.gni")
|
|
|
|
config("lzma_config_common") {
|
|
include_dirs = [ "C" ]
|
|
cflags = [
|
|
"-DZ7_AFFINITY_DISABLE",
|
|
"-Wall",
|
|
"-Werror",
|
|
"-Wno-empty-body",
|
|
"-Wno-enum-conversion",
|
|
"-Wno-logical-op-parentheses",
|
|
"-Wno-self-assign",
|
|
"-Wno-implicit-function-declaration",
|
|
]
|
|
visibility = [ ":*" ]
|
|
}
|
|
|
|
config("lzma_config_host") {
|
|
defines = []
|
|
defines += [ "target_cpu=${target_cpu}" ]
|
|
defines += [ "host_toolchain=${host_toolchain}" ]
|
|
defines += [ "current_toolchain=${current_toolchain}" ]
|
|
defines += [ "default_toolchain=${default_toolchain}" ]
|
|
}
|
|
|
|
# on device
|
|
ohos_source_set("lzma_source_arm") {
|
|
configs = [ ":lzma_config_common" ]
|
|
public_configs = [ ":lzma_config_common" ]
|
|
|
|
include_dirs = [ "Asm/arm" ]
|
|
cflags = [ "-march=armv7-a" ]
|
|
ldflags = [ "-lpthread" ]
|
|
|
|
sources = common_c_source
|
|
}
|
|
ohos_source_set("lzma_source_riscv64") {
|
|
configs = [ ":lzma_config_common" ]
|
|
public_configs = [ ":lzma_config_common" ]
|
|
cflags = [ "-march=rv64gc" ]
|
|
sources = common_c_source
|
|
}
|
|
|
|
# on device
|
|
ohos_source_set("lzma_source_arm64") {
|
|
branch_protector_ret = "pac_ret"
|
|
configs = [ ":lzma_config_common" ]
|
|
public_configs = [ ":lzma_config_common" ]
|
|
|
|
include_dirs = [ "Asm/arm64" ]
|
|
cflags = [ "-march=armv8-a+crc" ]
|
|
|
|
sources = common_c_source
|
|
sources += arm64_asm_source
|
|
}
|
|
|
|
# on device
|
|
ohos_source_set("lzma_source_x86") {
|
|
configs = [ ":lzma_config_common" ]
|
|
public_configs = [ ":lzma_config_common" ]
|
|
|
|
include_dirs = [ "Asm/x86" ]
|
|
cflags = [ "-march=x86-64" ]
|
|
|
|
sources = common_c_source
|
|
}
|
|
|
|
# on host
|
|
ohos_source_set("lzma_source_arm_host") {
|
|
configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
public_configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
|
|
sources = common_c_source
|
|
}
|
|
|
|
# on host
|
|
ohos_source_set("lzma_source_x86_host") {
|
|
configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
public_configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
|
|
include_dirs = [ "Asm/x86" ]
|
|
|
|
sources = common_c_source
|
|
}
|
|
|
|
#on host
|
|
ohos_source_set("lzma_source_arm64_host") {
|
|
configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
public_configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
|
|
include_dirs = [ "Asm/arm64" ]
|
|
|
|
sources = common_c_source
|
|
sources += arm64_asm_source
|
|
}
|
|
|
|
#on host
|
|
ohos_source_set("lzma_source_riscv64_host") {
|
|
configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
public_configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
|
|
sources = common_c_source
|
|
}
|
|
|
|
# on device
|
|
ohos_shared_library("lzma_shared") {
|
|
branch_protector_ret = "pac_ret"
|
|
public_configs = [ ":lzma_config_common" ]
|
|
|
|
if (target_cpu == "arm") {
|
|
deps = [ ":lzma_source_arm" ]
|
|
} else if (target_cpu == "arm64") {
|
|
deps = [ ":lzma_source_arm64" ]
|
|
} else if (target_cpu == "riscv64") {
|
|
deps = [ ":lzma_source_riscv64" ]
|
|
} else if (target_cpu == "x86_64") {
|
|
deps = [ ":lzma_source_x86" ]
|
|
}
|
|
|
|
innerapi_tags = [
|
|
"chipsetsdk_sp_indirect",
|
|
"platformsdk_indirect",
|
|
]
|
|
output_name = "lzma"
|
|
install_images = [
|
|
"system",
|
|
"updater",
|
|
]
|
|
part_name = "lzma"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
#on host
|
|
ohos_static_library("lzma_static") {
|
|
public_configs = [
|
|
":lzma_config_common",
|
|
":lzma_config_host",
|
|
]
|
|
|
|
if (current_cpu == "arm") {
|
|
deps = [ ":lzma_source_arm_host" ]
|
|
} else if (current_cpu == "arm64") {
|
|
deps = [ ":lzma_source_arm64_host" ]
|
|
} else if (current_cpu == "x86_64" || current_cpu == "x64") {
|
|
deps = [ ":lzma_source_x86_host" ]
|
|
} else if (current_cpu == "riscv64") {
|
|
deps = [ ":lzma_source_riscv64_host" ]
|
|
}
|
|
|
|
part_name = "lzma"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
group("lzma") {
|
|
deps = [
|
|
":lzma_shared",
|
|
":lzma_static",
|
|
]
|
|
}
|