• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 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.
13import("../config.gni")
14
15if (ohos_kernel_type == "liteos_m") {
16  static_library("sysparam") {
17    include_dirs = [
18      "//base/startup/syspara_lite/interfaces/kits",
19      "//utils/native/lite/include",
20      "//base/startup/syspara_lite/frameworks/parameter/src",
21      "//base/startup/syspara_lite/hals",
22      "//third_party/mbedtls/include",
23    ]
24    sources = [ "parameter_common.c" ]
25    if (enable_ohos_startup_syspara_lite_use_posix_file_api) {
26      sources += [ "param_impl_posix/param_impl_posix.c" ]
27    } else {
28      sources += [ "param_impl_hal/param_impl_hal.c" ]
29    }
30
31    deps = [ "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam" ]
32    if (enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls) {
33      deps += [ "//third_party/mbedtls:mbedtls" ]
34    }
35
36    if (enable_ohos_startup_syspara_lite_use_posix_file_api) {
37      deps += [ "//third_party/bounds_checking_function:libsec_static" ]
38    }
39    defines = [
40      "INCREMENTAL_VERSION=\"${ohos_version}\"",
41      "BUILD_TYPE=\"${ohos_build_type}\"",
42      "BUILD_USER=\"${ohos_build_user}\"",
43      "BUILD_TIME=\"${ohos_build_time}\"",
44      "BUILD_HOST=\"${ohos_build_host}\"",
45      "BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
46      "USE_MBEDTLS",
47      "DATA_PATH=\"${config_ohos_startup_syspara_lite_data_path}\"",
48    ]
49  }
50} else {
51  shared_library("sysparam") {
52    cflags = [ "-Wall" ]
53    public_deps = [
54      "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam",
55      "//third_party/bounds_checking_function:libsec_shared",
56    ]
57    sources = [
58      "param_impl_posix/param_impl_posix.c",
59      "parameter_common.c",
60    ]
61    include_dirs = [
62      "//base/startup/syspara_lite/interfaces/kits",
63      "//utils/native/lite/include",
64      "//third_party/bounds_checking_function/include",
65      "//base/startup/syspara_lite/frameworks/parameter/src",
66      "//base/startup/syspara_lite/hals",
67      "//third_party/mbedtls/include",
68    ]
69    deps = [ "//third_party/mbedtls:mbedtls" ]
70    defines = [
71      "INCREMENTAL_VERSION=\"${ohos_version}\"",
72      "BUILD_TYPE=\"${ohos_build_type}\"",
73      "BUILD_USER=\"${ohos_build_user}\"",
74      "BUILD_TIME=\"${ohos_build_time}\"",
75      "BUILD_HOST=\"${ohos_build_host}\"",
76      "BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
77      "USE_MBEDTLS",
78    ]
79  }
80}
81