• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#Copyright (c) 2022 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#
14
15import("//build/ohos.gni")
16
17LIGHT_ROOT_DIR = "//drivers/peripheral/light"
18
19if (defined(ohos_lite)) {
20  config("libhdi_light_pub_config") {
21    visibility = [ ":*" ]
22  }
23
24  FWK_ROOT_DIR = "//drivers/hdf_core/framework"
25  ohos_shared_library("hdi_light") {
26    output_extension = "z.so"
27    sources = [ "$LIGHT_ROOT_DIR/hal/src/light_controller.c" ]
28
29    include_dirs = [
30      "$LIGHT_ROOT_DIR/hal/include",
31      "$LIGHT_ROOT_DIR/interfaces/include",
32      "$FWK_ROOT_DIR/include",
33      "$FWK_ROOT_DIR/include/utils",
34      "$FWK_ROOT_DIR/include/osal",
35      "$FWK_ROOT_DIR/include/core",
36      "//third_party/bounds_checking_function/include",
37    ]
38
39    public_configs = [ ":libhdi_light_pub_config" ]
40    deps = [
41      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
42      "//third_party/bounds_checking_function:libsec_shared",
43    ]
44    external_deps = [ "hdf_core:libhdf_utils" ]
45
46    cflags = [
47      "-Wall",
48      "-Wextra",
49      "-Werror",
50      "-fsigned-char",
51      "-fno-common",
52      "-fno-strict-aliasing",
53    ]
54    install_images = [ chipset_base_dir ]
55    subsystem_name = "hdf"
56    part_name = "drivers_peripheral_light"
57  }
58} else {
59  config("libhdi_light_pub_config") {
60    visibility = [ ":*" ]
61    include_dirs = [ "$LIGHT_ROOT_DIR/interfaces/include" ]
62  }
63  ohos_shared_library("hdi_light") {
64    public_configs = [ ":libhdi_light_pub_config" ]
65    sources = [ "$LIGHT_ROOT_DIR/hal/src/light_controller.c" ]
66
67    include_dirs = [
68      "$LIGHT_ROOT_DIR/hal/include",
69      "//third_party/bounds_checking_function/include",
70    ]
71
72    cflags = [
73      "-Wall",
74      "-Wextra",
75      "-Werror",
76      "-fsigned-char",
77      "-fno-common",
78      "-fno-strict-aliasing",
79    ]
80    install_images = [ chipset_base_dir ]
81    subsystem_name = "hdf"
82    part_name = "drivers_peripheral_light"
83    if (is_standard_system) {
84      external_deps = [
85        "c_utils:utils",
86        "hdf_core:libhdf_utils",
87        "hiviewdfx_hilog_native:libhilog",
88      ]
89    } else {
90      external_deps = [ "hilog:libhilog" ]
91    }
92  }
93}
94