Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 1 | // 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 | |
Bob Badour | a5a87a6 | 2021-02-22 12:24:10 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 19 | cc_defaults { |
| 20 | name: "derive_sdk-defaults", |
Nikita Ioffe | 10c8718 | 2020-10-20 16:07:01 +0100 | [diff] [blame] | 21 | min_sdk_version: "30", |
Jooyung Han | c7c4530 | 2020-04-23 15:25:04 +0900 | [diff] [blame] | 22 | shared_libs: ["liblog"], |
| 23 | // static c++/libbase for smaller size |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 24 | stl: "c++_static", |
Anton Hansson | b1a217c | 2020-11-30 11:43:05 +0000 | [diff] [blame] | 25 | static_libs: [ |
| 26 | "libbase", |
| 27 | "libmodules-utils-build", |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 28 | "libprotobuf-cpp-lite", |
Anton Hansson | 502b775 | 2021-01-06 12:16:54 +0000 | [diff] [blame] | 29 | "libsdk_proto" |
Anton Hansson | b1a217c | 2020-11-30 11:43:05 +0000 | [diff] [blame] | 30 | ], |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 33 | cc_library { |
| 34 | name: "libderive_sdk", |
Anton Hansson | 502b775 | 2021-01-06 12:16:54 +0000 | [diff] [blame] | 35 | srcs: ["derive_sdk.cpp"], |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 36 | defaults: ["derive_sdk-defaults"], |
| 37 | apex_available: ["com.android.sdkext"], |
| 38 | } |
| 39 | |
| 40 | cc_defaults { |
| 41 | name: "derive_sdk_binary-defaults", |
| 42 | defaults: ["derive_sdk-defaults"], |
| 43 | srcs: ["main.cpp"], |
| 44 | static_libs: ["libderive_sdk"], |
| 45 | |
| 46 | } |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 47 | cc_binary { |
| 48 | name: "derive_sdk", |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 49 | defaults: ["derive_sdk_binary-defaults"], |
| 50 | apex_available: ["com.android.sdkext"], |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | // Work around testing using a 64-bit test suite on 32-bit test device by |
| 54 | // using a prefer32 version of derive_sdk in testing. |
| 55 | cc_binary { |
| 56 | name: "derive_sdk_prefer32", |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 57 | defaults: ["derive_sdk_binary-defaults"], |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 58 | compile_multilib: "prefer32", |
| 59 | stem: "derive_sdk", |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 60 | apex_available: ["test_com.android.sdkext"], |
Colin Cross | c9d9821 | 2020-04-08 15:57:57 -0700 | [diff] [blame] | 61 | installable: false, |
Anton Hansson | 36e2b13 | 2019-12-19 12:10:53 +0000 | [diff] [blame] | 62 | } |
| 63 | |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 64 | cc_test { |
| 65 | name: "derive_sdk_test", |
| 66 | defaults: ["derive_sdk-defaults"], |
Anton Hansson | 502b775 | 2021-01-06 12:16:54 +0000 | [diff] [blame] | 67 | srcs: ["derive_sdk_test.cpp"], |
Anton Hansson | dddcb57 | 2020-11-24 09:32:14 +0000 | [diff] [blame] | 68 | require_root: true, |
| 69 | static_libs: ["libderive_sdk"], |
| 70 | test_suites: ["device-tests"], |
| 71 | } |
| 72 | |
Anton Hansson | da4972f | 2020-01-08 09:48:18 +0000 | [diff] [blame] | 73 | prebuilt_etc { |
| 74 | name: "derive_sdk.rc", |
| 75 | src: "derive_sdk.rc", |
| 76 | installable: false, |
| 77 | } |