blob: 43ec7c71f8a9a9e2ac591ec12a135dd414c77f4f [file] [log] [blame]
// Copyright 2017 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
cc_defaults {
name: "trunks_defaults",
cflags: [
"-Wall",
"-Werror",
"-Wno-unused-parameter",
"-DUSE_BINDER_IPC",
"-fvisibility=hidden",
],
shared_libs: [
"libbinder",
"libbinderwrapper",
"libbrillo",
"libbrillo-binder",
"libchrome",
"libchrome-crypto",
"libcrypto",
"libprotobuf-cpp-lite",
"libutils",
],
include_dirs: [
"system/tpm",
],
}
cc_library_static {
name: "libtrunks_generated",
defaults: ["trunks_defaults"],
srcs: [
"interface.proto",
"aidl/android/trunks/ITrunks.aidl",
"aidl/android/trunks/ITrunksClient.aidl",
],
proto: {
export_proto_headers: true,
},
aidl: {
local_include_dirs: ["aidl"],
export_aidl_headers: true,
},
}
cc_library_static {
name: "libtrunks_common",
defaults: ["trunks_defaults"],
srcs: [
"background_command_transceiver.cc",
"blob_parser.cc",
"error_codes.cc",
"hmac_authorization_delegate.cc",
"hmac_session_impl.cc",
"password_authorization_delegate.cc",
"policy_session_impl.cc",
"scoped_key_handle.cc",
"session_manager_impl.cc",
"tpm_generated.cc",
"tpm_state_impl.cc",
"tpm_utility_impl.cc",
"trunks_factory_impl.cc",
],
static_libs: [
"libtrunks_generated",
],
}
cc_binary {
name: "trunksd",
defaults: ["trunks_defaults"],
srcs: [
"resource_manager.cc",
"tpm_handle.cc",
"tpm_simulator_handle.cc",
"trunks_binder_service.cc",
"trunksd.cc",
],
required: [
"trunksd-seccomp.policy",
],
init_rc: [
"trunksd.rc",
],
shared_libs: [
"libbrillo-minijail",
"libminijail",
],
static_libs: [
"libtrunks_generated",
"libtrunks_common",
],
}
cc_library_shared {
name: "libtrunks",
defaults: ["trunks_defaults"],
srcs: [
"trunks_binder_proxy.cc",
],
include_dirs: [
"system/tpm",
],
shared_libs: [
"libbrillo-minijail",
"libminijail",
],
whole_static_libs: [
"libtrunks_generated",
"libtrunks_common",
]
}
cc_binary {
name: "trunks_client",
defaults: ["trunks_defaults"],
srcs: [
"trunks_client.cc",
"trunks_client_test.cc",
],
shared_libs: [
"libbrillo-minijail",
"libminijail",
"libtrunks",
],
}
cc_library_static {
name: "libtrunks_test",
defaults: ["trunks_defaults"],
shared_libs: [
"libbrillo-minijail",
"libminijail",
],
srcs: [
"mock_authorization_delegate.cc",
"mock_blob_parser.cc",
"mock_command_transceiver.cc",
"mock_hmac_session.cc",
"mock_policy_session.cc",
"mock_session_manager.cc",
"mock_tpm.cc",
"mock_tpm_state.cc",
"mock_tpm_utility.cc",
"trunks_factory_for_test.cc",
],
static_libs: ["libgmock"],
}
cc_test {
name: "trunks_test",
defaults: ["trunks_defaults"],
shared_libs: [
"libbrillo-minijail",
"libminijail",
],
srcs: [
"mock_authorization_delegate.cc",
"mock_blob_parser.cc",
"mock_command_transceiver.cc",
"mock_hmac_session.cc",
"mock_policy_session.cc",
"mock_session_manager.cc",
"mock_tpm.cc",
"mock_tpm_state.cc",
"mock_tpm_utility.cc",
"trunks_factory_for_test.cc",
],
static_libs: [
"libBionicGtestMain",
"libgmock",
"libtrunks_common",
"libtrunks_generated",
"libtrunks_test",
],
}