1# Copyright (c) 2022-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")
15import("../light.gni")
16
17ohos_shared_library("liblight_interface_service_1.0") {
18  include_dirs = [
19    "../interfaces/include/",
20    ".",
21    "../interfaces/v1_0/",
22    "../utils/include",
23  ]
24
25  sources = [ "light_if_service.cpp" ]
26
27  cflags = [
28    "-Wall",
29    "-Wextra",
30    "-Werror",
31    "-fsigned-char",
32    "-fno-common",
33    "-fno-strict-aliasing",
34  ]
35
36  if (is_standard_system) {
37    external_deps = [
38      "drivers_interface_light:liblight_stub_1.0",
39      "hdf_core:libhdf_host",
40      "hilog:libhilog",
41      "hitrace:hitrace_meter",
42    ]
43    if (c_utils_enable) {
44      external_deps += [ "c_utils:utils" ]
45    }
46  } else {
47    external_deps = [ "hilog:libhilog" ]
48  }
49  external_deps += [ "ipc:ipc_single" ]
50
51  install_images = [ chipset_base_dir ]
52  subsystem_name = "hdf"
53  part_name = "drivers_peripheral_light"
54}
55
56ohos_shared_library("liblight_driver") {
57  include_dirs = [
58    "../interfaces/include/",
59    "../utils/include",
60  ]
61  sources = [ "light_if_driver.cpp" ]
62
63  cflags = [
64    "-Wall",
65    "-Wextra",
66    "-Werror",
67    "-fsigned-char",
68    "-fno-common",
69    "-fno-strict-aliasing",
70  ]
71
72  if (is_standard_system) {
73    external_deps = [
74      "drivers_interface_light:liblight_stub_1.0",
75      "hdf_core:libhdf_host",
76      "hdf_core:libhdf_ipc_adapter",
77      "hdf_core:libhdf_utils",
78      "hdf_core:libhdi",
79      "hilog:libhilog",
80      "ipc:ipc_single",
81    ]
82    if (c_utils_enable) {
83      external_deps += [ "c_utils:utils" ]
84    }
85  } else {
86    external_deps = [
87      "hilog:libhilog",
88      "ipc:ipc_single",
89    ]
90  }
91
92  shlib_type = "hdi"
93  install_images = [ chipset_base_dir ]
94  subsystem_name = "hdf"
95  part_name = "drivers_peripheral_light"
96}
97
98group("hdf_light_service") {
99  deps = [
100    ":liblight_driver",
101    ":liblight_interface_service_1.0",
102  ]
103}
104