• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7* http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14*/
15
16import { FileTemp } from "../../gen/datatype";
17
18export let driverInterfaceGn4_1: FileTemp = {
19  name: 'BUILD.gn',
20  content: `
21  # Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
22# Licensed under the Apache License, Version 2.0 (the "License");
23# you may not use this file except in compliance with the License.
24# You may obtain a copy of the License at
25#
26#     http://www.apache.org/licenses/LICENSE-2.0
27#
28# Unless required by applicable law or agreed to in writing, software
29# distributed under the License is distributed on an "AS IS" BASIS,
30# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31# See the License for the specific language governing permissions and
32# limitations under the License.
33
34HDF_CORE_PATH = "../../../hdf_core"
35import("//build/ohos.gni")
36import("$HDF_CORE_PATH/adapter/uhdf2/uhdf.gni")
37
38ohos_shared_library("lib[driverName]_interface_service_1.0") {
39  include_dirs = [
40    ".",
41    "../utils/interface",
42    "../hal/include"
43  ]
44
45  sources = [ "[driverName]_interface_service.cpp"]
46  deps = [ "../hal:hdi_[driverName]" ]
47
48  cflags = [
49    "-Wall",
50    "-Wextra",
51    "-Werror",
52    "-fsigned-char",
53    "-fno-common",
54    "-fno-strict-aliasing",
55  ]
56
57  if (is_standard_system) {
58    external_deps = [
59      "c_utils:utils",
60      "drivers_interface_[driverName]:[driverName]_idl_headers",
61      "hdf_core:libhdf_host",
62      "hilog:libhilog",
63      "hitrace:hitrace_meter",
64    ]
65  } else {
66    external_deps = [ "hilog:libhilog" ]
67  }
68  external_deps += [ "ipc:ipc_single" ]
69
70  install_images = [ chipset_base_dir ]
71  subsystem_name = "hdf"
72  part_name = "drivers_peripheral_[driverName]"
73}
74
75ohos_shared_library("lib[driverName]_driver") {
76  include_dirs = [
77  ]
78  sources = [ "[driverName]_interface_driver.cpp" ]
79
80  cflags = [
81    "-Wall",
82    "-Wextra",
83    "-Werror",
84    "-fsigned-char",
85    "-fno-common",
86    "-fno-strict-aliasing",
87  ]
88
89  if (is_standard_system) {
90    external_deps = [
91      "c_utils:utils",
92      "drivers_interface_[driverName]:lib[driverName]_stub_1.0",
93      "hdf_core:libhdf_host",
94      "hdf_core:libhdf_ipc_adapter",
95      "hdf_core:libhdf_utils",
96      "hdf_core:libhdi",
97      "hilog:libhilog",
98      "ipc:ipc_single",
99    ]
100  } else {
101    external_deps = [
102      "hilog:libhilog",
103      "ipc:ipc_single",
104    ]
105  }
106
107  shlib_type = "hdi"
108  install_images = [ chipset_base_dir ]
109  subsystem_name = "hdf"
110  part_name = "drivers_peripheral_[driverName]"
111}
112
113group("hdf_[driverName]_service") {
114  deps = [
115    ":lib[driverName]_driver",
116    ":lib[driverName]_interface_service_1.0",
117  ]
118}
119  `
120}