• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/taihe_idl/taihe.gni")
17
18copy_taihe_idl("copy_driverExtensionContext") {
19  sources = [ "idl/DriverExtensionContext.taihe" ]
20  #external_deps = []
21}
22
23subsystem_name = "hdf"
24part_name = "external_device_manager"
25taihe_application_file_path = "$taihe_file_path/out/$subsystem_name/$part_name"
26taihe_generated_file_path =
27    "$taihe_file_path/out/$subsystem_name/$part_name/application"
28native_path = "../../../../services/native"
29
30ohos_taihe("run_taihe") {
31  taihe_generated_file_path = "$taihe_generated_file_path"
32  deps = [ ":copy_driverExtensionContext" ]
33  outputs = [
34    "$taihe_generated_file_path/src/DriverExtensionContext.ani.cpp",
35    "$taihe_generated_file_path/src/DriverExtensionContext.abi.c",
36  ]
37}
38
39taihe_shared_library("DriverExtensionContext_native") {
40  sanitize = {
41    integer_overflow = true
42    ubsan = true
43    boundary_sanitize = true
44    cfi = true
45    cfi_cross_dso = true
46    debug = false
47  }
48  taihe_generated_file_path = "$taihe_generated_file_path"
49  part_name = "$part_name"
50  subsystem_name = "$subsystem_name"
51  sources = get_target_outputs(":run_taihe")
52  include_dirs = [
53    "include",
54    "$native_path/driver_extension/include",
55  ]
56  sources += [
57    "$native_path/driver_extension/src/driver_extension_context.cpp",
58    "src/DriverExtensionContext.impl.cpp",
59    "src/ani_constructor.cpp",
60  ]
61
62  deps = [ ":run_taihe" ]
63
64  external_deps = [
65    "ability_runtime:ability_connect_callback_stub",
66    "ability_runtime:ability_context_native",
67    "ability_runtime:ability_manager",
68    "ability_runtime:abilitykit_native",
69    "ability_runtime:ani_common",
70    "ability_runtime:app_context",
71    "ability_runtime:extensionkit_native",
72    "ability_runtime:napi_common",
73    "ability_runtime:runtime",
74    "bundle_framework:bms_ani_common",
75    "c_utils:utils",
76    "hilog:libhilog",
77    "hitrace:hitrace_meter",
78    "ipc:ipc_core",
79    "ipc:ipc_napi",
80    "ipc:rpc_ani",
81    "runtime_core:ani",
82  ]
83}
84
85generate_static_abc("driverExtensionContext_abc") {
86  base_url = "$taihe_application_file_path"
87  files = [ "$taihe_generated_file_path/DriverExtensionContext.ets" ]
88  is_boot_abc = "True"
89  device_dst_file = "/system/framework/driverExtensionContext_abc.abc"
90  dependencies = [ ":run_taihe" ]
91}
92
93ohos_prebuilt_etc("driverExtensionContext_etc") {
94  source = "$target_out_dir/driverExtensionContext_abc.abc"
95  module_install_dir = "framework"
96  part_name = "$part_name"
97  subsystem_name = "$subsystem_name"
98  deps = [ ":driverExtensionContext_abc" ]
99}
100
101group("driverExtensionContext_taihe") {
102  deps = [
103    ":DriverExtensionContext_native",
104    ":driverExtensionContext_etc",
105  ]
106  #deps = [":run_taihe"]
107}
108