1// Copyright (C) 2020 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// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE 16// CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE 17// DEPENDING ON IT IN YOUR PROJECT. *** 18package { 19 default_applicable_licenses: ["external_ms-tpm-20-ref_license"], 20} 21 22// Added automatically by a large-scale-change that took the approach of 23// 'apply every license found to every target'. While this makes sure we respect 24// every license restriction, it may not be entirely correct. 25// 26// e.g. GPL in an MIT project might only apply to the contrib/ directory. 27// 28// Please consider splitting the single license below into multiple licenses, 29// taking care not to lose any license_kind information, and overriding the 30// default license using the 'licenses: [...]' property on targets as needed. 31// 32// For unused files, consider creating a 'fileGroup' with "//visibility:private" 33// to attach the license to, and including a comment whether the files may be 34// used in the current project. 35// See: http://go/android-license-faq 36license { 37 name: "external_ms-tpm-20-ref_license", 38 visibility: [":__subpackages__"], 39 license_kinds: [ 40 "SPDX-license-identifier-BSD", 41 "SPDX-license-identifier-GPL-2.0", 42 "SPDX-license-identifier-MIT", 43 "legacy_by_exception_only", // by exception only 44 ], 45 license_text: [ 46 "LICENSE", 47 ], 48} 49 50cc_defaults { 51 name: "ms-tpm-20-ref-defaults", 52 local_include_dirs: [ 53 "TPMCmd/Platform/include", 54 "TPMCmd/Platform/include/prototypes", 55 "TPMCmd/Simulator/include", 56 "TPMCmd/Simulator/include/prototypes", 57 "TPMCmd/tpm/include", 58 "TPMCmd/tpm/include/Ossl", 59 "TPMCmd/tpm/include/prototypes", 60 ], 61 device_supported: false, 62 host_supported: true, 63 shared_libs: [ 64 "libcrypto", 65 ], 66 cflags: [ 67 "-DMAX_SYM_DATA=256", 68 "-DDEBUG=YES", 69 "-DUSE_DEBUG_RNG=NO", 70 "-DALG_CAMELLIA=ALG_NO", 71 "-Wno-cast-function-type-mismatch", 72 "-Wno-empty-body", 73 "-Wno-logical-op-parentheses", 74 "-Wno-missing-field-initializers", 75 "-Wno-typedef-redefinition", 76 "-Wno-unused-parameter", 77 ], 78 target: { 79 darwin: { 80 enabled: true, 81 }, 82 }, 83} 84 85cc_library_static { 86 name: "ms-tpm-20-ref-lib", 87 srcs: [ 88 "TPMCmd/Platform/src/*.c", 89 "TPMCmd/Simulator/src/TPMCmdp.c", 90 "TPMCmd/Simulator/src/TcpServer.c", 91 "TPMCmd/tpm/src/command/**/*.c", 92 "TPMCmd/tpm/src/crypt/*.c", 93 "TPMCmd/tpm/src/crypt/ossl/*.c", 94 "TPMCmd/tpm/src/events/*.c", 95 "TPMCmd/tpm/src/main/*.c", 96 "TPMCmd/tpm/src/subsystem/*.c", 97 "TPMCmd/tpm/src/support/*.c", 98 "TPMCmd/tpm/src/X509/*.c", 99 ], 100 export_include_dirs: [ 101 "TPMCmd/Platform/include", 102 "TPMCmd/Platform/include/prototypes", 103 "TPMCmd/Simulator/include", 104 "TPMCmd/Simulator/include/prototypes", 105 "TPMCmd/tpm/include", 106 "TPMCmd/tpm/include/Ossl", 107 "TPMCmd/tpm/include/prototypes", 108 ], 109 target: { 110 windows: { 111 enabled: true, 112 cflags: [ 113 "-Wno-unknown-pragmas", 114 ], 115 host_ldlibs: [ 116 "-lws2_32", 117 ], 118 }, 119 }, 120 defaults: [ "ms-tpm-20-ref-defaults" ], 121} 122 123cc_binary_host { 124 name: "ms-tpm-20-ref", 125 srcs: [ 126 "TPMCmd/Simulator/src/TPMCmds.c", 127 ], 128 static_libs: [ 129 "ms-tpm-20-ref-lib", 130 ], 131 defaults: [ "ms-tpm-20-ref-defaults" ], 132} 133