blob: dc4e352af04b7659b5a10219612fe35225b9c08e [file] [log] [blame]
Anton Hanssonda4972f2020-01-08 09:48:18 +00001// Copyright (C) 2019 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
Anton Hansson36e2b132019-12-19 12:10:53 +000015cc_defaults {
16 name: "derive_sdk-defaults",
Anton Hanssonda4972f2020-01-08 09:48:18 +000017 proto: {
18 type: "lite",
Colin Cross0c88d802020-04-07 16:50:32 +000019 static: true,
Anton Hanssonda4972f2020-01-08 09:48:18 +000020 },
Nikita Ioffe10c87182020-10-20 16:07:01 +010021 min_sdk_version: "30",
Jooyung Hanc7c45302020-04-23 15:25:04 +090022 shared_libs: ["liblog"],
23 // static c++/libbase for smaller size
Anton Hanssonda4972f2020-01-08 09:48:18 +000024 stl: "c++_static",
Anton Hanssonb1a217c2020-11-30 11:43:05 +000025 static_libs: [
26 "libbase",
27 "libmodules-utils-build",
Anton Hanssondddcb572020-11-24 09:32:14 +000028 "libprotobuf-cpp-lite",
Anton Hanssonb1a217c2020-11-30 11:43:05 +000029 ],
Anton Hanssonda4972f2020-01-08 09:48:18 +000030}
31
Anton Hanssondddcb572020-11-24 09:32:14 +000032cc_library {
33 name: "libderive_sdk",
34 srcs: [
35 "derive_sdk.cpp",
36 "sdk.proto",
37 ],
38 defaults: ["derive_sdk-defaults"],
39 apex_available: ["com.android.sdkext"],
40}
41
42cc_defaults {
43 name: "derive_sdk_binary-defaults",
44 defaults: ["derive_sdk-defaults"],
45 srcs: ["main.cpp"],
46 static_libs: ["libderive_sdk"],
47
48}
Anton Hansson36e2b132019-12-19 12:10:53 +000049cc_binary {
50 name: "derive_sdk",
Anton Hanssondddcb572020-11-24 09:32:14 +000051 defaults: ["derive_sdk_binary-defaults"],
52 apex_available: ["com.android.sdkext"],
Anton Hansson36e2b132019-12-19 12:10:53 +000053}
54
55// Work around testing using a 64-bit test suite on 32-bit test device by
56// using a prefer32 version of derive_sdk in testing.
57cc_binary {
58 name: "derive_sdk_prefer32",
Anton Hanssondddcb572020-11-24 09:32:14 +000059 defaults: ["derive_sdk_binary-defaults"],
Anton Hansson36e2b132019-12-19 12:10:53 +000060 compile_multilib: "prefer32",
61 stem: "derive_sdk",
Anton Hanssondddcb572020-11-24 09:32:14 +000062 apex_available: ["test_com.android.sdkext"],
Colin Crossc9d98212020-04-08 15:57:57 -070063 installable: false,
Anton Hansson36e2b132019-12-19 12:10:53 +000064}
65
Anton Hanssondddcb572020-11-24 09:32:14 +000066cc_test {
67 name: "derive_sdk_test",
68 defaults: ["derive_sdk-defaults"],
69 srcs: [
70 "derive_sdk_test.cpp",
71 "sdk.proto",
72 ],
73 require_root: true,
74 static_libs: ["libderive_sdk"],
75 test_suites: ["device-tests"],
76}
77
Anton Hanssonda4972f2020-01-08 09:48:18 +000078prebuilt_etc {
79 name: "derive_sdk.rc",
80 src: "derive_sdk.rc",
81 installable: false,
82}