2021-06-01 16:32:44 +00:00
|
|
|
# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
|
|
|
|
|
|
|
|
import("//build/ohos.gni")
|
|
|
|
|
|
|
|
if (target_cpu == "arm") {
|
2021-10-11 08:06:56 +00:00
|
|
|
config("ffi_config") {
|
|
|
|
visibility = [ ":*" ]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
include_dirs = [
|
|
|
|
".",
|
|
|
|
"./include",
|
|
|
|
"./src/arm",
|
|
|
|
]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
cflags = [
|
|
|
|
"-DTARGET=ARM",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-implicit-function-declaration",
|
|
|
|
"-Wno-extern-initializer",
|
|
|
|
]
|
|
|
|
}
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
ohos_source_set("ffi_source") {
|
|
|
|
sources = [
|
|
|
|
"src/arm/ffi.c",
|
|
|
|
"src/arm/sysv.S",
|
|
|
|
"src/closures.c",
|
|
|
|
"src/java_raw_api.c",
|
|
|
|
"src/prep_cif.c",
|
|
|
|
"src/raw_api.c",
|
|
|
|
"src/types.c",
|
|
|
|
]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2022-06-20 13:08:17 +00:00
|
|
|
configs = [ ":ffi_config" ]
|
|
|
|
}
|
|
|
|
} else if (target_cpu == "x86_64") {
|
|
|
|
config("ffi_config") {
|
|
|
|
visibility = [ ":*" ]
|
|
|
|
|
|
|
|
include_dirs = [
|
|
|
|
".",
|
|
|
|
"./include",
|
|
|
|
"./src/x86",
|
|
|
|
]
|
|
|
|
|
|
|
|
cflags = [
|
|
|
|
"-DTARGET=X86_64",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-implicit-function-declaration",
|
|
|
|
"-Wno-extern-initializer",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
ohos_source_set("ffi_source") {
|
|
|
|
sources = [
|
|
|
|
"src/closures.c",
|
|
|
|
"src/java_raw_api.c",
|
|
|
|
"src/prep_cif.c",
|
|
|
|
"src/raw_api.c",
|
|
|
|
"src/types.c",
|
2022-06-20 13:21:51 +00:00
|
|
|
"src/x86/ffi64.c",
|
|
|
|
"src/x86/unix64.S",
|
2022-06-20 13:08:17 +00:00
|
|
|
]
|
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
configs = [ ":ffi_config" ]
|
|
|
|
}
|
2021-06-01 16:32:44 +00:00
|
|
|
} else {
|
2021-10-11 08:06:56 +00:00
|
|
|
config("ffi_config") {
|
|
|
|
visibility = [ ":*" ]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
include_dirs = [
|
|
|
|
".",
|
|
|
|
"./include",
|
|
|
|
"./src/aarch64",
|
|
|
|
]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
cflags = [
|
|
|
|
"-DTARGET=AARCH64",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-implicit-function-declaration",
|
|
|
|
"-Wno-extern-initializer",
|
|
|
|
]
|
|
|
|
}
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
ohos_source_set("ffi_source") {
|
|
|
|
sources = [
|
|
|
|
"src/aarch64/ffi.c",
|
|
|
|
"src/aarch64/sysv.S",
|
|
|
|
"src/closures.c",
|
|
|
|
"src/java_raw_api.c",
|
|
|
|
"src/prep_cif.c",
|
|
|
|
"src/raw_api.c",
|
|
|
|
"src/types.c",
|
|
|
|
]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
configs = [ ":ffi_config" ]
|
|
|
|
}
|
2021-06-01 16:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
config("ffi_public_config") {
|
2021-10-11 08:06:56 +00:00
|
|
|
include_dirs = [ "include" ]
|
2021-06-01 16:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ohos_shared_library("ffi") {
|
2021-10-11 08:06:56 +00:00
|
|
|
deps = [ ":ffi_source" ]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2021-10-11 08:06:56 +00:00
|
|
|
public_configs = [ ":ffi_public_config" ]
|
2021-06-01 16:32:44 +00:00
|
|
|
|
2022-07-12 10:55:32 +00:00
|
|
|
part_name = "multimedia_player_framework"
|
2021-10-11 08:06:56 +00:00
|
|
|
subsystem_name = "multimedia"
|
2021-06-01 16:32:44 +00:00
|
|
|
}
|