Bob Badour | 77c910d | 2021-06-07 22:20:50 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2021 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | package { |
Alan Stokes | 8704861 | 2024-02-08 17:08:31 +0000 | [diff] [blame] | 17 | default_team: "trendy_team_virtualization", |
Alan Stokes | 94475b8 | 2023-10-25 15:54:21 +0100 | [diff] [blame] | 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
Bob Badour | 77c910d | 2021-06-07 22:20:50 -0700 | [diff] [blame] | 19 | } |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 20 | |
Inseob Kim | 812497f | 2024-07-25 17:08:28 +0900 | [diff] [blame] | 21 | rust_defaults { |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 22 | name: "avf_build_flags_rust", |
Inseob Kim | 812497f | 2024-07-25 17:08:28 +0900 | [diff] [blame] | 23 | cfgs: select(release_flag("RELEASE_AVF_ENABLE_DEVICE_ASSIGNMENT"), { |
| 24 | true: ["device_assignment"], |
| 25 | default: [], |
| 26 | }) + select(release_flag("RELEASE_AVF_ENABLE_DICE_CHANGES"), { |
| 27 | true: ["dice_changes"], |
| 28 | default: [], |
| 29 | }) + select(release_flag("RELEASE_AVF_ENABLE_LLPVM_CHANGES"), { |
| 30 | true: ["llpvm_changes"], |
| 31 | default: [], |
| 32 | }) + select(release_flag("RELEASE_AVF_ENABLE_MULTI_TENANT_MICRODROID_VM"), { |
| 33 | true: ["multi_tenant"], |
| 34 | default: [], |
| 35 | }) + select(release_flag("RELEASE_AVF_ENABLE_NETWORK"), { |
| 36 | true: ["network"], |
| 37 | default: [], |
| 38 | }) + select(release_flag("RELEASE_AVF_ENABLE_REMOTE_ATTESTATION"), { |
| 39 | true: ["remote_attestation"], |
| 40 | default: [], |
| 41 | }) + select(release_flag("RELEASE_AVF_ENABLE_VENDOR_MODULES"), { |
| 42 | true: ["vendor_modules"], |
| 43 | default: [], |
| 44 | }) + select(release_flag("RELEASE_AVF_ENABLE_VIRT_CPUFREQ"), { |
| 45 | true: ["virt_cpufreq"], |
| 46 | default: [], |
| 47 | }) + select(release_flag("RELEASE_AVF_SUPPORT_CUSTOM_VM_WITH_PARAVIRTUALIZED_DEVICES"), { |
| 48 | true: ["paravirtualized_devices"], |
| 49 | default: [], |
| 50 | }), |
Nikita Ioffe | 3973d38 | 2023-08-31 17:53:25 +0100 | [diff] [blame] | 51 | } |
Jaewan Kim | 0df5fb1 | 2023-09-24 23:33:54 +0900 | [diff] [blame] | 52 | |
Inseob Kim | 812497f | 2024-07-25 17:08:28 +0900 | [diff] [blame] | 53 | cc_defaults { |
Nikita Ioffe | 38b9e71 | 2024-02-08 15:55:07 +0000 | [diff] [blame] | 54 | name: "avf_build_flags_cc", |
Inseob Kim | 812497f | 2024-07-25 17:08:28 +0900 | [diff] [blame] | 55 | cflags: select(release_flag("RELEASE_AVF_ENABLE_DICE_CHANGES"), { |
| 56 | true: ["-DAVF_OPEN_DICE_CHANGES=1"], |
| 57 | default: [], |
| 58 | }) + select(release_flag("RELEASE_AVF_ENABLE_VENDOR_MODULES"), { |
| 59 | true: ["-DAVF_ENABLE_VENDOR_MODULES=1"], |
| 60 | default: [], |
| 61 | }) + select(release_flag("RELEASE_AVF_ENABLE_VIRT_CPUFREQ"), { |
| 62 | true: ["-DAVF_ENABLE_VIRT_CPUFREQ=1"], |
| 63 | default: [], |
| 64 | }), |
Nikita Ioffe | 38b9e71 | 2024-02-08 15:55:07 +0000 | [diff] [blame] | 65 | } |
| 66 | |
Jaewan Kim | 0df5fb1 | 2023-09-24 23:33:54 +0900 | [diff] [blame] | 67 | genrule_defaults { |
| 68 | name: "dts_to_dtb", |
| 69 | tools: ["dtc"], |
Jaewan Kim | a232ed0 | 2024-02-25 16:08:14 +0000 | [diff] [blame] | 70 | cmd: "FILES=($(in)) && $(location dtc) -@ -I dts -O dtb $${FILES[-1]} -o $(out)", |
Jaewan Kim | 0df5fb1 | 2023-09-24 23:33:54 +0900 | [diff] [blame] | 71 | } |
Nikita Ioffe | e3a049f | 2024-02-15 15:47:23 +0000 | [diff] [blame] | 72 | |
| 73 | // This is a temporary workaround until b/309090563 is implemented. |
| 74 | aconfig_declarations { |
| 75 | name: "avf_aconfig_flags", |
| 76 | package: "com.android.system.virtualmachine.flags", |
Yu Liu | 6c8ce02 | 2024-03-28 17:30:05 +0000 | [diff] [blame] | 77 | container: "com.android.virt", |
Nikita Ioffe | e3a049f | 2024-02-15 15:47:23 +0000 | [diff] [blame] | 78 | srcs: [ |
| 79 | "avf_flags.aconfig", |
| 80 | ], |
| 81 | } |
| 82 | |
| 83 | java_aconfig_library { |
| 84 | name: "avf_aconfig_flags_java", |
| 85 | aconfig_declarations: "avf_aconfig_flags", |
| 86 | sdk_version: "module_current", |
| 87 | apex_available: ["com.android.virt"], |
| 88 | } |