From 1e06998be23d85db36f92be4c0e795a73a059e3b Mon Sep 17 00:00:00 2001 From: zhushengle Date: Wed, 28 Sep 2022 17:53:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=96=E8=AF=91=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81UniProton=E5=86=85=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #I5TGKH Signed-off-by: zhushengle Change-Id: I18278f6efdd9682f0b3aac651a37321f30be73e1 --- BUILD.gn | 6 ++++++ config/BUILD.gn | 5 +++++ config/BUILDCONFIG.gn | 5 +++-- config/component/lite_component.gni | 6 ++++-- ohos_var.gni | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 1c04a37..6bfed8c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -90,6 +90,12 @@ group("ohos") { "//kernel/liteos_m:build_kernel_image") { deps += [ component_target ] } + } else if (product_configed_component.component == + "uniproton") { + if (component_target != + "//kernel/uniproton:build_kernel_image") { + deps += [ component_target ] + } } else { deps += [ component_target ] } diff --git a/config/BUILD.gn b/config/BUILD.gn index b101f43..24b77d5 100644 --- a/config/BUILD.gn +++ b/config/BUILD.gn @@ -37,6 +37,11 @@ config("kernel_macros") { "__LITEOS__", "__LITEOS_M__", ] + } else if (ohos_kernel_type == "uniproton") { + defines = [ + "__uniproton__", + "__UNIPROTON__", + ] } else if (ohos_kernel_type == "linux") { defines = [ "__linux__", diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn index e53cddf..e123274 100755 --- a/config/BUILDCONFIG.gn +++ b/config/BUILDCONFIG.gn @@ -41,7 +41,8 @@ if (defined(board_configed_sysroot) && board_configed_sysroot != "") { } # Only gcc available for liteos_m. -if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "linux") { +if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "uniproton" || + ohos_kernel_type == "linux") { use_board_toolchain = true } @@ -154,7 +155,7 @@ default_shared_library_configs = default_target_configs + [ "//build/lite/config:shared_library_config" ] default_static_library_configs = default_target_configs default_executable_configs = default_static_library_configs -if (ohos_kernel_type != "liteos_m") { +if (ohos_kernel_type != "liteos_m" && ohos_kernel_type != "uniproton") { default_static_library_configs += [ "//build/lite/config:static_pie_config" ] default_executable_configs += [ "//build/lite/config:static_pie_config" ] default_executable_configs += [ "//build/lite/config:pie_executable_config" ] diff --git a/config/component/lite_component.gni b/config/component/lite_component.gni index 9bcbdee..ee32141 100644 --- a/config/component/lite_component.gni +++ b/config/component/lite_component.gni @@ -19,7 +19,8 @@ template("lite_library") { target_type = invoker.target_type shared_lib = target_type == "shared_library" - if (shared_lib && ohos_kernel_type == "liteos_m") { + if (shared_lib && + (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "uniproton")) { group(target_name) { if (defined(invoker.sources)) { assert(invoker.sources != "") @@ -57,7 +58,8 @@ template("lite_library") { if (shared_lib) { cflags += [ "-fPIC" ] cflags_cc += [ "-fPIC" ] - } else if (!shared_lib && ohos_kernel_type != "liteos_m") { + } else if (!shared_lib && (ohos_kernel_type != "liteos_m" && + ohos_kernel_type != "uniproton")) { cflags += [ "-fPIE" ] cflags_cc += [ "-fPIE" ] } diff --git a/ohos_var.gni b/ohos_var.gni index 4c9f72c..5be6fba 100755 --- a/ohos_var.gni +++ b/ohos_var.gni @@ -64,7 +64,7 @@ if (product_config_path != "") { board_name = product_config.board device_company = product_config.device_company - # Supported kernel: "liteos_a", "liteos_m", "linux" + # Supported kernel: "liteos_a", "liteos_m", "linux", "uniproton" ohos_kernel_type = product_config.kernel_type if (defined(product_config.kernel_is_prebuilt)) { ohos_kernel_is_prebuilt = product_config.kernel_is_prebuilt