1# Copyright (C) 2022 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16LOCAL_DIR := $(GET_LOCAL_DIR)
17
18MODULE := $(LOCAL_DIR)
19
20MANIFEST := $(LOCAL_DIR)/manifest.json
21
22MODULE_SRCS += \
23	$(LOCAL_DIR)/lib.rs \
24
25MODULE_CRATE_NAME := secretkeeper
26
27MODULE_LIBRARY_DEPS += \
28	trusty/user/base/lib/authgraph-rust/boringssl \
29	trusty/user/base/lib/authgraph-rust/core \
30	trusty/user/base/lib/authgraph-rust/wire \
31	trusty/user/base/lib/secretkeeper/comm \
32	trusty/user/base/lib/secretkeeper/core \
33	trusty/user/base/lib/secretkeeper/dice_policy \
34	$(call FIND_CRATE,coset) \
35	$(call FIND_CRATE,log) \
36	trusty/user/base/lib/storage/rust \
37	trusty/user/base/lib/tipc/rust \
38	trusty/user/base/lib/trusty-log \
39	trusty/user/base/lib/trusty-std \
40
41MODULE_RUST_TESTS := true
42
43# The port tests are built and installed regardless of whether the Secretkeeper TA
44# is enabled, so set a config value to allow tests that involve the TA to be skipped.
45ifeq (true,$(call TOBOOL,$(SECRETKEEPER_ENABLED)))
46     MODULE_RUSTFLAGS += --cfg 'secretkeeper_enabled'
47endif
48
49MODULE_RUST_USE_CLIPPY := true
50
51include make/library.mk
52