1# Copyright (c) 2020 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("../config.gni")
15
16if (!enable_ohos_systemabilitymgr_samgr_lite_rpc_mini) {
17  config("endpoint_public") {
18    include_dirs = [
19      "../samgr/adapter",
20      "//commonlibrary/utils_lite/include",
21      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
22      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry",
23      "//third_party/bounds_checking_function/include",
24      "//base/security/permission_lite/services/ipc_auth/include",
25    ]
26  }
27
28  config("endpoint_internal") {
29    include_dirs = [
30      "./source",
31      "../samgr/registry",
32    ]
33  }
34
35  source_set("endpoint_source") {
36    sources = [
37      "source/client_factory.c",
38      "source/default_client_rpc.c",
39      "source/default_client_small_adapter.c",
40      "source/endpoint_rpc.c",
41      "source/samgr_small_ipc_adapter.c",
42      "source/token_bucket.c",
43    ]
44
45    cflags = [
46      "-fPIC",
47      "-Wall",
48    ]
49    cflags += [ "-Wno-int-conversion" ]
50
51    if (ohos_kernel_type == "linux") {
52      defines = [
53        "_GNU_SOURCE",
54        "LITE_LINUX_BINDER_IPC",
55      ]
56    }
57
58    configs += [ ":endpoint_internal" ]
59
60    public_configs = [ ":endpoint_public" ]
61
62    public_deps = [
63      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
64      "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
65      "//third_party/bounds_checking_function:libsec_shared",
66    ]
67  }
68
69  source_set("store_source") {
70    sources = [ "source/sa_store.c" ]
71
72    cflags = [
73      "-fPIC",
74      "-Wall",
75    ]
76
77    configs += [ ":endpoint_internal" ]
78
79    public_configs = [ ":endpoint_public" ]
80
81    public_deps = [
82      "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
83      "//third_party/bounds_checking_function:libsec_shared",
84    ]
85  }
86} else {
87  defines = [ "MINI_SAMGR_LITE_RPC" ]
88  config("endpoint_public") {
89    include_dirs = [
90      "../samgr/adapter",
91      "//commonlibrary/utils_lite/include",
92      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
93      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry",
94      "//third_party/bounds_checking_function/include",
95      "//base/security/permission_lite/services/ipc_auth/include",
96    ]
97  }
98
99  config("endpoint_internal") {
100    include_dirs = [
101      "./source",
102      "../samgr/registry",
103      "//foundation/systemabilitymgr/samgr_lite/samgr_server/source",
104      "//base/security/permission_lite/interfaces/innerkits",
105      "//base/security/permission_lite/services/pms_base/include",
106    ]
107  }
108
109  source_set("endpoint_source") {
110    sources = [
111      "source/client_factory.c",
112      "source/default_client_mini_adapter.c",
113      "source/default_client_rpc.c",
114      "source/endpoint_rpc.c",
115      "source/samgr_mini_ipc_adapter.c",
116      "source/token_bucket.c",
117    ]
118
119    if (ohos_kernel_type == "linux") {
120      defines = [
121        "_GNU_SOURCE",
122        "LITE_LINUX_BINDER_IPC",
123      ]
124    }
125
126    configs += [ ":endpoint_internal" ]
127
128    public_configs = [ ":endpoint_public" ]
129
130    public_deps = [
131      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static",
132      "//foundation/communication/ipc/interfaces/innerkits/c/dbinder:dbinder",
133    ]
134  }
135
136  source_set("store_source") {
137    sources = [ "source/sa_store.c" ]
138
139    configs += [ ":endpoint_internal" ]
140    public_configs = [ ":endpoint_public" ]
141    public_deps = [
142      "//foundation/communication/ipc/interfaces/innerkits/c/dbinder:dbinder",
143    ]
144  }
145}
146