blob: ca80b9b34e3ce30b95899fa73c597283b73c27d9 [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",
Nikita Ioffe10c87182020-10-20 16:07:01 +010017 min_sdk_version: "30",
Jooyung Hanc7c45302020-04-23 15:25:04 +090018 shared_libs: ["liblog"],
19 // static c++/libbase for smaller size
Anton Hanssonda4972f2020-01-08 09:48:18 +000020 stl: "c++_static",
Anton Hanssonb1a217c2020-11-30 11:43:05 +000021 static_libs: [
22 "libbase",
23 "libmodules-utils-build",
Anton Hanssondddcb572020-11-24 09:32:14 +000024 "libprotobuf-cpp-lite",
Anton Hansson502b7752021-01-06 12:16:54 +000025 "libsdk_proto"
Anton Hanssonb1a217c2020-11-30 11:43:05 +000026 ],
Anton Hanssonda4972f2020-01-08 09:48:18 +000027}
28
Anton Hanssondddcb572020-11-24 09:32:14 +000029cc_library {
30 name: "libderive_sdk",
Anton Hansson502b7752021-01-06 12:16:54 +000031 srcs: ["derive_sdk.cpp"],
Anton Hanssondddcb572020-11-24 09:32:14 +000032 defaults: ["derive_sdk-defaults"],
33 apex_available: ["com.android.sdkext"],
34}
35
36cc_defaults {
37 name: "derive_sdk_binary-defaults",
38 defaults: ["derive_sdk-defaults"],
39 srcs: ["main.cpp"],
40 static_libs: ["libderive_sdk"],
41
42}
Anton Hansson36e2b132019-12-19 12:10:53 +000043cc_binary {
44 name: "derive_sdk",
Anton Hanssondddcb572020-11-24 09:32:14 +000045 defaults: ["derive_sdk_binary-defaults"],
46 apex_available: ["com.android.sdkext"],
Anton Hansson36e2b132019-12-19 12:10:53 +000047}
48
49// Work around testing using a 64-bit test suite on 32-bit test device by
50// using a prefer32 version of derive_sdk in testing.
51cc_binary {
52 name: "derive_sdk_prefer32",
Anton Hanssondddcb572020-11-24 09:32:14 +000053 defaults: ["derive_sdk_binary-defaults"],
Anton Hansson36e2b132019-12-19 12:10:53 +000054 compile_multilib: "prefer32",
55 stem: "derive_sdk",
Anton Hanssondddcb572020-11-24 09:32:14 +000056 apex_available: ["test_com.android.sdkext"],
Colin Crossc9d98212020-04-08 15:57:57 -070057 installable: false,
Anton Hansson36e2b132019-12-19 12:10:53 +000058}
59
Anton Hanssondddcb572020-11-24 09:32:14 +000060cc_test {
61 name: "derive_sdk_test",
62 defaults: ["derive_sdk-defaults"],
Anton Hansson502b7752021-01-06 12:16:54 +000063 srcs: ["derive_sdk_test.cpp"],
Anton Hanssondddcb572020-11-24 09:32:14 +000064 require_root: true,
65 static_libs: ["libderive_sdk"],
66 test_suites: ["device-tests"],
67}
68
Anton Hanssonda4972f2020-01-08 09:48:18 +000069prebuilt_etc {
70 name: "derive_sdk.rc",
71 src: "derive_sdk.rc",
72 installable: false,
73}