1# Copyright (c) 2023 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")
15
16config("ability_config") {
17  visibility = [ ":*" ]
18  cflags = []
19  if (target_cpu == "arm") {
20    cflags += [ "-DBINDER_IPC_32BIT" ]
21  }
22}
23
24ohos_shared_library("driver_extension") {
25  include_dirs = [ "include" ]
26
27  sources = [
28    "src/driver_extension.cpp",
29    "src/driver_extension_context.cpp",
30    "src/js_driver_extension.cpp",
31    "src/js_driver_extension_context.cpp",
32  ]
33
34  external_deps = [
35    "ability_base:want",
36    "ability_runtime:ability_connect_callback_stub",
37    "ability_runtime:ability_context_native",
38    "ability_runtime:ability_manager",
39    "ability_runtime:abilitykit_native",
40    "ability_runtime:app_context",
41    "ability_runtime:extensionkit_native",
42    "ability_runtime:napi_common",
43    "ability_runtime:runtime",
44    "c_utils:utils",
45    "eventhandler:libeventhandler",
46    "hilog:libhilog",
47    "hitrace:hitrace_meter",
48    "ipc:ipc_core",
49    "ipc:ipc_napi",
50    "napi:ace_napi",
51  ]
52  cflags_cc = [
53    "-fno-asynchronous-unwind-tables",
54    "-fno-unwind-tables",
55    "-Os",
56  ]
57
58  subsystem_name = "hdf"
59  part_name = "external_device_manager"
60}
61
62ohos_shared_library("driver_extension_module") {
63  include_dirs = [ "include" ]
64
65  sources = [ "src/driver_extension_module_loader.cpp" ]
66
67  configs = [ ":ability_config" ]
68
69  deps = [ ":driver_extension" ]
70
71  external_deps = [
72    "ability_runtime:ability_manager",
73    "ability_runtime:extensionkit_native",
74    "napi:ace_napi",
75  ]
76
77  relative_install_dir = "extensionability/"
78  subsystem_name = "hdf"
79  part_name = "external_device_manager"
80}
81