提交 748e73ca 编写于 作者: M mucor

fix(mbedtls): mbedtls l0 support

close: #I3UBJA
Signed-off-by: Nmucor <mucorwang@gmail.com>
上级 4943b33f
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/component/lite_component.gni")
import("//build/lite/ndk/ndk.gni") import("//build/lite/ndk/ndk.gni")
mbedtls_sources = [] mbedtls_sources = [
mbedtls_sources += [
"library/aes.c", "library/aes.c",
"library/aesni.c", "library/aesni.c",
"library/arc4.c", "library/arc4.c",
...@@ -88,28 +87,47 @@ mbedtls_sources += [ ...@@ -88,28 +87,47 @@ mbedtls_sources += [
"library/xtea.c", "library/xtea.c",
] ]
defines = []
config("mbedtls_config") { config("mbedtls_config") {
include_dirs = [ "./include" ] include_dirs = [ "./include", "./include/mbedtls" ]
if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "liteos_a") {
defines += [ "__unix__" ]
}
} }
shared_library("mbedtls_shared") { lite_library("mbedtls_shared") {
sources = mbedtls_sources target_type = "shared_library"
output_name = "mbedtls"
public_configs = [ ":mbedtls_config" ] public_configs = [ ":mbedtls_config" ]
output_name = "mbedtls"
sources = mbedtls_sources
} }
static_library("mbedtls_static") { lite_library("mbedtls_static") {
sources = mbedtls_sources target_type = "static_library"
output_name = "mbedtls"
public_configs = [ ":mbedtls_config" ] public_configs = [ ":mbedtls_config" ]
if (ohos_kernel_type == "liteos_m") {
public_deps = [ "//kernel/liteos_m/kal/posix" ]
include_dirs = [ "//kernel/liteos_m/kal/posix/include", ]
}
output_name = "mbedtls"
sources = mbedtls_sources
} }
group("mbedtls") { group("mbedtls") {
if (ohos_kernel_type == "liteos_m") {
deps = [ ":mbedtls_static" ]
} else {
deps = [ ":mbedtls_shared" ] deps = [ ":mbedtls_shared" ]
}
} }
ndk_lib("mbedtls_ndk") { ndk_lib("mbedtls_ndk") {
if (ohos_kernel_type == "liteos_m") {
lib_extension = ".a"
} else {
lib_extension = ".so" lib_extension = ".so"
}
deps = [ ":mbedtls" ] deps = [ ":mbedtls" ]
head_files = [ "include" ] head_files = [ "include" ]
} }
...@@ -122,7 +140,10 @@ if (ohos_build_type == "debug") { ...@@ -122,7 +140,10 @@ if (ohos_build_type == "debug") {
"./configs", # The directory where the custom configuration file is "./configs", # The directory where the custom configuration file is
# located # located
] ]
defines = [ "MBEDTLS_CONFIG_FILE=<config_rsa_aes_cbc.h>" ] defines = [
"MBEDTLS_CONFIG_FILE=<config_rsa_aes_cbc.h>",
"__unix__",
]
ldflags = [ ldflags = [
"-s", "-s",
"-w", "-w",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册