1# Copyright (c) 2021 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
14if (ohos_kernel_type == "liteos_m") {
15  static_library("hota") {
16    sources = [
17      "//base/update/sys_installer_lite/frameworks/source/updater/hota_updater.c",
18      "//base/update/sys_installer_lite/frameworks/source/verify/app_rsa.c",
19      "//base/update/sys_installer_lite/frameworks/source/verify/app_sha256.c",
20      "//base/update/sys_installer_lite/frameworks/source/verify/hota_verify.c",
21    ]
22    include_dirs = [
23      "//base/update/sys_installer_lite/interfaces/kits",
24      "//base/update/sys_installer_lite/hals",
25      "//base/update/sys_installer_lite/frameworks/test/dload",
26      "//base/update/sys_installer_lite/frameworks/source/verify",
27      "//commonlibrary/utils_lite/include",
28      "//kernel/liteos_m/kal/cmsis",
29      "//base/startup/init/interfaces/innerkits/include/syspara",
30      "//third_party/bounds_checking_function/include",
31      "//third_party/mbedtls/include",
32      "$ohos_third_party_dir/lwip_sack/include",
33    ]
34    if (board_toolchain_type != "iccarm") {
35      cflags = [ "-Wno-unused-variable" ]
36    }
37    deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
38    deps += [ "$ohos_board_adapter_dir/hals/update:hal_update_static" ]
39  }
40} else {
41  shared_library("hota") {
42    sources = [
43      "//base/update/sys_installer_lite/frameworks/source/updater/hota_updater.c",
44      "//base/update/sys_installer_lite/frameworks/source/verify/app_rsa.c",
45      "//base/update/sys_installer_lite/frameworks/source/verify/app_sha256.c",
46      "//base/update/sys_installer_lite/frameworks/source/verify/hota_verify.c",
47    ]
48    include_dirs = [
49      "//base/update/sys_installer_lite/interfaces/kits",
50      "//base/update/sys_installer_lite/hals",
51      "//base/update/sys_installer_lite/frameworks/test/dload",
52      "//base/update/sys_installer_lite/frameworks/source/verify",
53      "//commonlibrary/utils_lite/include",
54      "//kernel/liteos_m/kal/cmsis",
55      "//base/startup/init/interfaces/innerkits/include/syspara",
56      "//third_party/bounds_checking_function/include",
57      "//third_party/mbedtls/include",
58      "$ohos_third_party_dir/lwip_sack/include",
59    ]
60    cflags = [
61      "-Wno-unused-variable",
62      "-DDYNAMIC_LOAD_HAL",
63    ]
64    deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
65    ldflags = [ "-lhal_update" ]
66    deps += [ "$ohos_board_adapter_dir/update:hal_update" ]
67  }
68}
69