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