• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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
14import("//build/ohos.gni")
15import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
16
17HDF_FRAMEWORKS = "//drivers/hdf_core/framework"
18
19config("libhdf_platform_pub_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "$hdf_framework_path/include/core",
24    "$hdf_framework_path/include/utils",
25    "$hdf_framework_path/include/osal",
26    "$hdf_framework_path/utils/include",
27    "$hdf_framework_path/include/platform",
28    "$hdf_framework_path/support/platform/include/i2c",
29    "$hdf_framework_path/support/platform/include/spi",
30    "$hdf_uhdf_path/osal/include",
31    "$hdf_uhdf_path/utils/include",
32  ]
33}
34
35ohos_shared_library("libhdf_platform") {
36  public_configs = [ ":libhdf_platform_pub_config" ]
37  sources = [
38    "$HDF_FRAMEWORKS/support/platform/src/adc/adc_if_u.c",
39    "$HDF_FRAMEWORKS/support/platform/src/fwk/platform_listener_u.c",
40    "$HDF_FRAMEWORKS/support/platform/src/gpio/gpio_if_u.c",
41    "$HDF_FRAMEWORKS/support/platform/src/i2c/i2c_if_u.c",
42    "$HDF_FRAMEWORKS/support/platform/src/pwm/pwm_if_u.c",
43    "$HDF_FRAMEWORKS/support/platform/src/rtc/rtc_base.c",
44    "$HDF_FRAMEWORKS/support/platform/src/rtc/rtc_if_u.c",
45    "$HDF_FRAMEWORKS/support/platform/src/spi/spi_if_u.c",
46    "$HDF_FRAMEWORKS/support/platform/src/timer/timer_if_u.c",
47    "$HDF_FRAMEWORKS/support/platform/src/uart/uart_if_u.c",
48    "$HDF_FRAMEWORKS/support/platform/src/watchdog/watchdog_if_u.c",
49  ]
50
51  include_dirs = [
52    "$HDF_FRAMEWORKS/support/platform/include",
53    "$HDF_FRAMEWORKS/support/platform/include/fwk",
54  ]
55
56  deps = [ "//drivers/hdf_core/adapter/uhdf2/utils:libhdf_utils" ]
57
58  defines = [ "__USER__" ]
59
60  if (is_standard_system) {
61    external_deps = [
62      "c_utils:utils",
63      "hiviewdfx_hilog_native:libhilog",
64    ]
65  } else {
66    external_deps = [ "hilog:libhilog" ]
67  }
68
69  cflags = [
70    "-Wall",
71    "-Wextra",
72    "-Werror",
73    "-fsigned-char",
74    "-fno-common",
75    "-fno-strict-aliasing",
76  ]
77
78  install_images = [ chipset_base_dir ]
79  subsystem_name = "hdf"
80  part_name = "hdf_core"
81}
82