• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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/ohos.gni")
15import("../../../begetd.gni")
16
17ohos_shared_library("cj_device_info_ffi") {
18  sanitize = {
19    cfi = true
20    cfi_cross_dso = true
21    debug = false
22  }
23  include_dirs = [
24    "src_deviceinfo",
25    "${init_innerkits_path}/syspara",
26  ]
27
28  if (!defined(defines)) {
29    defines = []
30  }
31
32  if (product_name != "ohos-sdk") {
33    sources = [
34      "src_deviceinfo/device_info.cpp",
35      "src_deviceinfo/device_info_ffi.cpp",
36    ]
37
38    deps = [
39      "${init_innerkits_path}:libbeget_proxy",
40      "${init_innerkits_path}:libbegetutil",
41    ]
42
43    external_deps = [
44      "bounds_checking_function:libsec_shared",
45      "bundle_framework:appexecfwk_core",
46      "c_utils:utils",
47      "hilog:libhilog",
48      "ipc:ipc_single",
49      "napi:cj_bind_ffi",
50      "samgr:samgr_proxy",
51    ]
52
53    if (defined(global_parts_info) &&
54        defined(global_parts_info.bundlemanager_bundle_framework)) {
55      external_deps += [ "bundle_framework:appexecfwk_base" ]
56      defines += [ "DEPENDENT_APPEXECFWK_BASE" ]
57    }
58  } else {
59    defines += [ "PREVIEWER" ]
60    sources = [ "src_deviceinfo/device_info_mock.cpp" ]
61  }
62
63  if (current_os == "ohos") {
64    defines += [ "OHOS_PLATFORM" ]
65  }
66
67  if (current_os == "mingw") {
68    defines += [ "WINDOWS_PLATFORM" ]
69  }
70
71  innerapi_tags = [ "platformsdk" ]
72  subsystem_name = "startup"
73  part_name = "init"
74}
75
76ohos_shared_library("cj_system_parameter_enhance_ffi") {
77  include_dirs = [ "src_enhance" ]
78  sanitize = {
79    cfi = true
80    cfi_cross_dso = true
81    debug = false
82  }
83
84  symlink_target_name = [ "libsystemparameterv9.z.so" ]
85
86  if (!defined(defines)) {
87    defines = []
88  }
89
90  if (product_name != "ohos-sdk") {
91    sources = [ "src_enhance/system_parameter_ffi.cpp" ]
92
93    deps = [
94      "../../innerkits:libbeget_proxy",
95      "../../innerkits:libbegetutil",
96    ]
97
98    external_deps = [
99      "c_utils:utils",
100      "napi:cj_bind_ffi",
101    ]
102  } else {
103    defines += [ "PREVIEWER" ]
104    sources = [ "src_enhance/system_parameter_mock.cpp" ]
105  }
106
107  if (current_os == "ohos") {
108    defines += [ "OHOS_PLATFORM" ]
109  }
110
111  if (current_os == "mingw") {
112    defines += [ "WINDOWS_PLATFORM" ]
113  }
114
115  innerapi_tags = [ "platformsdk" ]
116  subsystem_name = "startup"
117  part_name = "init"
118}
119