• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//build/lite/config/component/lite_component.gni")
15import("//build/lite/ndk/ndk.gni")
16
17if (ohos_kernel_type == "liteos_a") {
18  shared_library("liteipc_adapter") {
19    sources = [
20      "frameworks/liteipc/src/liteipc_adapter.c",
21      "frameworks/liteipc/src/serializer.c",
22    ]
23    cflags = [ "-fPIC" ]
24    cflags += [ "-Wall" ]
25    ldflags = [ "-lrt" ]
26    cflags_cc = cflags
27    public_configs = [ ":liteipc_external_library_config" ]
28    include_dirs = [
29      "frameworks/liteipc/include",
30      "//third_party/bounds_checking_function/include",
31    ]
32    public_deps = [ "//third_party/bounds_checking_function/:libsec_shared" ]
33    deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ]
34  }
35  config("liteipc_external_library_config") {
36    include_dirs = [
37      "//foundation/communication/ipc_lite/interfaces/kits",
38      "//utils/native/lite/include",
39    ]
40  }
41} else {
42  shared_library("liteipc_adapter") {
43    sources = [
44      "frameworks/liteipc/src/serializer.c",
45      "frameworks/liteipc_linux/src/liteipc_adapter.c",
46    ]
47    public_configs = [ ":liteipc_external_library_config" ]
48    include_dirs = [
49      "frameworks/liteipc_linux/include",
50      "frameworks/liteipc/include",
51      "//third_party/bounds_checking_function/include",
52    ]
53    ldflags = [
54      "-lstdc++",
55      "-lpthread",
56      "-lrt",
57    ]
58    deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ]
59    public_deps = [ "//third_party/bounds_checking_function/:libsec_shared" ]
60    defines = [ "LITE_LINUX_BINDER_IPC" ]
61    configs -= [ "//build/lite/config:clang_opt" ]
62  }
63  config("liteipc_external_library_config") {
64    include_dirs = [
65      "//foundation/communication/ipc_lite/interfaces/kits",
66      "//utils/native/lite/include",
67    ]
68  }
69}
70
71lite_component("liteipc") {
72  features = [ ":liteipc_adapter" ]
73}
74
75ndk_lib("liteipc_ndk") {
76  lib_extension = ".so"
77  deps = [ ":liteipc_adapter" ]
78  head_files = [ "//foundation/communication/ipc_lite/interfaces/kits" ]
79}
80