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("//base/startup/init/begetd.gni") 14import("../config.gni") 15 16if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "uniproton") { 17 if (enable_ohos_startup_init_feature_begetctl_liteos == false) { 18 static_library("sysparam") { 19 include_dirs = [ 20 "//base/startup/syspara_lite/interfaces/kits", 21 "//commonlibrary/utils_lite/include", 22 "//base/startup/syspara_lite/frameworks/parameter/src", 23 "//base/startup/syspara_lite/hals", 24 "//third_party/mbedtls/include", 25 ] 26 sources = [ "parameter_common.c" ] 27 if (enable_ohos_startup_init_lite_use_posix_file_api) { 28 sources += [ "param_impl_posix/param_impl_posix.c" ] 29 } else { 30 sources += [ "param_impl_hal/param_impl_hal.c" ] 31 } 32 33 deps = [ "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam" ] 34 if (enable_ohos_startup_init_lite_use_thirdparty_mbedtls) { 35 deps += [ "//third_party/mbedtls:mbedtls" ] 36 } 37 38 if (enable_ohos_startup_init_lite_use_posix_file_api) { 39 deps += [ "//third_party/bounds_checking_function:libsec_static" ] 40 } 41 defines = [ 42 "INCREMENTAL_VERSION=\"${ohos_version}\"", 43 "BUILD_TYPE=\"${ohos_build_type}\"", 44 "BUILD_USER=\"${ohos_build_user}\"", 45 "BUILD_TIME=\"${ohos_build_time}\"", 46 "BUILD_HOST=\"${ohos_build_host}\"", 47 "BUILD_ROOTHASH=\"${ohos_build_roothash}\"", 48 "USE_MBEDTLS", 49 "DATA_PATH=\"${config_ohos_startup_syspara_lite_data_path}\"", 50 ] 51 } 52 } else { 53 group("sysparam") { 54 deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] 55 } 56 } 57} else { 58 shared_library("sysparam") { 59 public_deps = [ 60 "//base/startup/init/interfaces/innerkits:libbegetutil", 61 "//third_party/bounds_checking_function:libsec_shared", 62 ] 63 } 64} 65