• 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
14import("//build/lite/config/component/lite_component.gni")
15import("//test/xts/device_attest_lite/build/devattestconfig.gni")
16
17if (os_level != "mini") {
18  CFLAGS_COMMON = [
19    "-ftrapv",
20    "-Werror",
21    "-Wextra",
22    "-Wshadow",
23    "-fstack-protector-all",
24    "-Wformat=2",
25    "-Wfloat-equal",
26    "-Wdate-time",
27  ]
28
29  INCLUDE_COMMON = [
30    "small/include",
31    "${devattest_path}/common",
32    "${devattest_path}/common/log",
33    "${devattest_path}/services/core/include",
34    "${devattest_path}/interfaces/innerkits",
35    "//utils/native/lite/include",
36    "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
37    "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
38    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
39  ]
40
41  # L1 server
42  shared_library("devattest_server") {
43    sources = [
44      "small/src/service/attest_framework_feature.c",
45      "small/src/service/attest_framework_server.c",
46    ]
47    cflags = CFLAGS_COMMON
48    cflags += [ "-fPIC" ]
49    ldflags = [ "-pthread" ]
50    include_dirs = INCLUDE_COMMON
51    include_dirs += [ "${devattest_path}/services/core" ]
52    deps = [
53      "${devattest_path}/services/core:devattest_core",
54      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
55      "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
56    ]
57  }
58
59  # L1 client
60  shared_library("devattest_client") {
61    sources = [ "small/src/client/attest_framework_client_proxy.c" ]
62    cflags = CFLAGS_COMMON
63    cflags += [ "-fPIC" ]
64    ldflags = [ "-pthread" ]
65    include_dirs = INCLUDE_COMMON
66    deps = [
67      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
68      "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
69    ]
70  }
71
72  # L1 service bin
73  executable("devattest_service") {
74    sources = [ "small/src/service/attest_framework_service.c" ]
75    cflags = CFLAGS_COMMON
76    ldflags = [ "-pthread" ]
77    include_dirs = INCLUDE_COMMON
78    include_dirs += [ "${devattest_path}/services/core/include/utils" ]
79    deps = [
80      ":devattest_server",
81      "${devattest_path}/services/core:devattest_core",
82      "//foundation/systemabilitymgr/samgr_lite/samgr:samgr",
83    ]
84  }
85} else {
86  #L0 Empty module
87  group("devattest_client") {
88  }
89
90  # L0 interface
91  static_library("devattest_sdk") {
92    if (os_level == "mini") {
93      sources = [ "mini/src/attest_framework_client_mini.c" ]
94      include_dirs = [
95        "${devattest_path}/common",
96        "${devattest_path}/common/mini",
97        "${devattest_path}/interfaces/innerkits",
98        "${devattest_path}/services/core",
99      ]
100      deps = [ "${devattest_path}/services/core:devattest_core" ]
101    }
102  }
103}
104