diff --git a/config.gni b/config.gni index 66c0e219f83a7364766bc286f60feedbf3650fc1..37a3563b832ed69c3fcb6530187c333b513c1e23 100644 --- a/config.gni +++ b/config.gni @@ -18,4 +18,7 @@ declare_args() { # enable samgr_lite adapt to rpc on mini system. enable_ohos_systemabilitymgr_samgr_lite_rpc_mini = false + + # enable samgr_lite customize implementation + enable_ohos_systemabilitymgr_samgr_lite_customize_implementation = false } diff --git a/samgr/BUILD.gn b/samgr/BUILD.gn index 3e22d9026efa364d54ac3c93604c9ae9df2c7bb9..d1665a1d2935a86f0fda0450a9cb3a06b8473bf9 100644 --- a/samgr/BUILD.gn +++ b/samgr/BUILD.gn @@ -29,13 +29,13 @@ config("samgr_public") { "adapter", "registry", "//commonlibrary/utils_lite/include", - "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry", - "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr", + "../interfaces/kits/registry", + "../interfaces/kits/samgr", ] } if (ohos_kernel_type == "liteos_m") { - static_library("samgr") { + static_library("samgr_static") { sources = [ "registry/service_registry.c", "source/samgr_lite.c", @@ -47,32 +47,34 @@ if (ohos_kernel_type == "liteos_m") { [ "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" ] public_deps = [ - "//foundation/systemabilitymgr/samgr_lite/samgr/adapter:samgr_adapter", - "//foundation/systemabilitymgr/samgr_lite/samgr/source:samgr_source", + "adapter:samgr_adapter", + "source:samgr_source", ] if (enable_ohos_systemabilitymgr_samgr_lite_rpc_mini) { defines += [ "MINI_SAMGR_LITE_RPC" ] include_dirs += - [ "//foundation/systemabilitymgr/samgr_lite/samgr_endpoint/source" ] + [ "../samgr_endpoint/source" ] public_deps += [ "//foundation/communication/ipc/interfaces/innerkits/c/dbinder:dbinder", ] } } + + group("samgr") { + if (enable_ohos_systemabilitymgr_samgr_lite_customize_implementation) { + public_configs = [ ":samgr_public" ] + } else { + public_deps = [ ":samgr_static" ] + } + } } if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") { shared_library("samgr") { sources = [ "source/samgr_lite.c" ] - cflags = [ - "-fPIC", - "-Wall", - ] - public_configs = [ ":samgr_public" ] - include_dirs = [ "//third_party/bounds_checking_function/include", "//third_party/cJSON",