From 3ebb6151ccb9048f9b422fa68f154fc7fbcd788d Mon Sep 17 00:00:00 2001 From: p00452466 Date: Sat, 5 Dec 2020 01:33:31 +0800 Subject: [PATCH] Description:add Change kernel type from liteos_riscv to liteos_m Reviewed-by:liubeibei Change-Id: Ib690ae4bf2a3db4f6104879ec29867eaa6b4cbd0 --- BUILD.gn | 62 ++++++++++---------- communication/broadcast/BUILD.gn | 2 +- samgr/BUILD.gn | 88 ++++++++++++++-------------- samgr/adapter/BUILD.gn | 6 +- samgr/source/BUILD.gn | 98 ++++++++++++++++---------------- 5 files changed, 124 insertions(+), 132 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 6c54db1..50da77b 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -14,44 +14,42 @@ import("//build/lite/config/component/lite_component.gni") import("//build/lite/ndk/ndk.gni") lite_component("samgr") { - features = [ - "samgr", - "communication/broadcast", - ] + features = [ + "samgr", + "communication/broadcast", + ] - if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux"){ - features += [ - "samgr_server:server", - "samgr_client:client", - ] - } + if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { + features += [ + "samgr_server:server", + "samgr_client:client", + ] + } } ndk_lib("samgr_lite_ndk") { - if(ohos_kernel_type == "liteos_riscv" || ohos_kernel_type == "liteos_m") { - lib_extension = ".a" - } else if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { - lib_extension = ".so" - } - deps = [ - "samgr", - "communication/broadcast", + if (ohos_kernel_type == "liteos_m") { + lib_extension = ".a" + } else if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { + lib_extension = ".so" + } + deps = [ + "communication/broadcast", + "samgr", + ] + head_files = [ + "//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr", + "//foundation/distributedschedule/interfaces/kits/samgr_lite/communication/broadcast", + ] + if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { + deps += [ "samgr_server:server" ] + head_files += [ + "//foundation/distributedschedule/interfaces/kits/samgr_lite/registry", ] - head_files = [ - "//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr", - "//foundation/distributedschedule/interfaces/kits/samgr_lite/communication/broadcast", - ] - if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux"){ - deps += [ - "samgr_server:server", - ] - head_files += ["//foundation/distributedschedule/interfaces/kits/samgr_lite/registry"] - } + } } generate_notice_file("samgr_notice_file") { - module_name = "samgr" - module_source_dir_list = [ - "//third_party/bounds_checking_function" - ] + module_name = "samgr" + module_source_dir_list = [ "//third_party/bounds_checking_function" ] } diff --git a/communication/broadcast/BUILD.gn b/communication/broadcast/BUILD.gn index 2e2c567..4a4d44e 100755 --- a/communication/broadcast/BUILD.gn +++ b/communication/broadcast/BUILD.gn @@ -20,7 +20,7 @@ config("broadcast_public") { ] } -if (ohos_kernel_type == "liteos_riscv" || ohos_kernel_type == "liteos_m") { +if (ohos_kernel_type == "liteos_m") { static_library("broadcast") { sources = [ "source/broadcast_service.c", diff --git a/samgr/BUILD.gn b/samgr/BUILD.gn index ba813e7..14e7d27 100755 --- a/samgr/BUILD.gn +++ b/samgr/BUILD.gn @@ -11,65 +11,63 @@ # See the License for the specific language governing permissions and # limitations under the License. config("external_settings_shared") { - defines = ["LAYER_INIT_SHARED_LIB"] + defines = [ "LAYER_INIT_SHARED_LIB" ] } config("samgr_public") { - include_dirs = [ - "adapter", - "registry", - "//foundation/distributedschedule/interfaces/kits/samgr_lite/registry", - "//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr", - "//utils/native/lite/include", - ] + include_dirs = [ + "adapter", + "registry", + "//foundation/distributedschedule/interfaces/kits/samgr_lite/registry", + "//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr", + "//utils/native/lite/include", + ] } -if (ohos_kernel_type == "liteos_riscv" || ohos_kernel_type == "liteos_m") { - static_library("samgr") { - sources = [ - "source/samgr_lite.c", - "registry/service_registry.c", - ] +if (ohos_kernel_type == "liteos_m") { + static_library("samgr") { + sources = [ + "registry/service_registry.c", + "source/samgr_lite.c", + ] - public_configs = [":samgr_public"] - cflags = [ "-Wall" ] + public_configs = [ ":samgr_public" ] + cflags = [ "-Wall" ] - include_dirs = [ - "//base/hiviewdfx/interfaces/kits/hilog_lite", - "//kernel/liteos_m/components/cmsis", - ] + include_dirs = [ + "//base/hiviewdfx/interfaces/kits/hilog_lite", + "//kernel/liteos_m/components/cmsis", + ] - public_deps = [ - "//foundation/distributedschedule/services/samgr_lite/samgr/adapter:samgr_adapter", - "//foundation/distributedschedule/services/samgr_lite/samgr/source:samgr_source" - ] - } + public_deps = [ + "//foundation/distributedschedule/services/samgr_lite/samgr/adapter:samgr_adapter", + "//foundation/distributedschedule/services/samgr_lite/samgr/source:samgr_source", + ] + } } if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { - shared_library("samgr") { - sources = [ - "source/samgr_lite.c", - ] + shared_library("samgr") { + sources = [ "source/samgr_lite.c" ] - cflags = [ - "-fPIC", - "-Wall" - ] + cflags = [ + "-fPIC", + "-Wall", + ] - public_configs = [":samgr_public"] + public_configs = [ ":samgr_public" ] - include_dirs = [ - "//kernel/liteos_a/kernel/include/", - "//third_party/bounds_checking_function/include", - ] + include_dirs = [ + "//kernel/liteos_a/kernel/include/", + "//third_party/bounds_checking_function/include", + ] - public_deps = [ - "//foundation/distributedschedule/services/samgr_lite/samgr/source:samgr_source", - "//foundation/distributedschedule/services/samgr_lite/samgr_client:client", - "//foundation/communication/frameworks/ipc_lite:liteipc_adapter", - ] + public_deps = [ + "//foundation/communication/frameworks/ipc_lite:liteipc_adapter", + "//foundation/distributedschedule/services/samgr_lite/samgr/source:samgr_source", + "//foundation/distributedschedule/services/samgr_lite/samgr_client:client", + ] - public_configs += [":external_settings_shared"] - } + public_configs += [ ":external_settings_shared" ] + } } diff --git a/samgr/adapter/BUILD.gn b/samgr/adapter/BUILD.gn index 6801cf5..067dad5 100755 --- a/samgr/adapter/BUILD.gn +++ b/samgr/adapter/BUILD.gn @@ -19,7 +19,7 @@ config("samgr_adapter_public") { ] } -if (ohos_kernel_type == "liteos_riscv" || ohos_kernel_type == "liteos_m") { +if (ohos_kernel_type == "liteos_m") { static_library("samgr_adapter") { sources = [ "cmsis/memory_adapter.c", @@ -56,9 +56,7 @@ if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { "-fPIC", "-Wall", ] - public_deps = [ - "//third_party/bounds_checking_function:libsec_shared", - ] + public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] defines = [ "_GNU_SOURCE" ] if (ohos_kernel_type == "linux") { defines += [ "SAMGR_LINUX_ADAPTER" ] diff --git a/samgr/source/BUILD.gn b/samgr/source/BUILD.gn index a228b94..79c1b26 100755 --- a/samgr/source/BUILD.gn +++ b/samgr/source/BUILD.gn @@ -12,66 +12,64 @@ # limitations under the License. config("samgr_source_public") { - include_dirs = [ - "../adapter", - "../registry", - "//foundation/distributedschedule/interfaces/kits/samgr_lite/registry", - "//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr", - "//utils/native/lite/include", - ] + include_dirs = [ + "../adapter", + "../registry", + "//foundation/distributedschedule/interfaces/kits/samgr_lite/registry", + "//foundation/distributedschedule/interfaces/kits/samgr_lite/samgr", + "//utils/native/lite/include", + ] } -if (ohos_kernel_type == "liteos_riscv" || ohos_kernel_type == "liteos_m") { - static_library("samgr_source") { - sources = [ - "common.c", - "iunknown.c", - "feature.c", - "service.c", - "message.c", - "task_manager.c", - ] +if (ohos_kernel_type == "liteos_m") { + static_library("samgr_source") { + sources = [ + "common.c", + "feature.c", + "iunknown.c", + "message.c", + "service.c", + "task_manager.c", + ] - public_configs = [":samgr_source_public"] - cflags = [ "-Wall" ] + public_configs = [ ":samgr_source_public" ] + cflags = [ "-Wall" ] - public_deps = [ - "//foundation/distributedschedule/services/samgr_lite/samgr/adapter:samgr_adapter" - ] + public_deps = [ "//foundation/distributedschedule/services/samgr_lite/samgr/adapter:samgr_adapter" ] - include_dirs = [ - "//base/hiviewdfx/interfaces/kits/hilog_lite", - "//kernel/liteos_m/components/cmsis", - ] - } + include_dirs = [ + "//base/hiviewdfx/interfaces/kits/hilog_lite", + "//kernel/liteos_m/components/cmsis", + ] + } } if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { - source_set("samgr_source") { - sources = [ - "common.c", - "iunknown.c", - "feature.c", - "service.c", - "message.c", - "task_manager.c", - ] + source_set("samgr_source") { + sources = [ + "common.c", + "feature.c", + "iunknown.c", + "message.c", + "service.c", + "task_manager.c", + ] - cflags = [ - "-fPIC", - "-Wall" - ] + cflags = [ + "-fPIC", + "-Wall", + ] - public_configs = [":samgr_source_public"] + public_configs = [ ":samgr_source_public" ] - public_deps = [ - "//foundation/distributedschedule/services/samgr_lite/samgr/adapter:samgr_adapter", - "//base/hiviewdfx/frameworks/hilog_lite/featured:hilog_shared", - ] + public_deps = [ + "//base/hiviewdfx/frameworks/hilog_lite/featured:hilog_shared", + "//foundation/distributedschedule/services/samgr_lite/samgr/adapter:samgr_adapter", + ] - include_dirs = [ - "//kernel/liteos_a/kernel/include/", - "//third_party/bounds_checking_function/include", - ] - } + include_dirs = [ + "//kernel/liteos_a/kernel/include/", + "//third_party/bounds_checking_function/include", + ] + } }