blob: b2af69e5cf6e33dfce6397a19aec747e747de81f [file] [log] [blame]
Bob Badour77c910d2021-06-07 22:20:50 -07001//
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
16package {
Alan Stokes87048612024-02-08 17:08:31 +000017 default_team: "trendy_team_virtualization",
Alan Stokes94475b82023-10-25 15:54:21 +010018 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour77c910d2021-06-07 22:20:50 -070019}
Nikita Ioffe3973d382023-08-31 17:53:25 +010020
21soong_config_module_type {
22 name: "avf_flag_aware_rust_defaults",
23 module_type: "rust_defaults",
24 config_namespace: "ANDROID",
25 bool_variables: [
Nikita Ioffe94a8a182023-11-16 16:37:48 +000026 "release_avf_enable_device_assignment",
Alan Stokes7f27c0d2023-09-07 16:22:58 +010027 "release_avf_enable_dice_changes",
Shikha Panwar95084df2023-07-22 11:47:45 +000028 "release_avf_enable_llpvm_changes",
Nikita Ioffe3973d382023-08-31 17:53:25 +010029 "release_avf_enable_multi_tenant_microdroid_vm",
Seungjae Yoo529d53c2024-05-14 14:36:18 +090030 "release_avf_enable_network",
Alice Wange9ac2db2023-09-08 15:13:13 +000031 "release_avf_enable_remote_attestation",
Nikita Ioffe631717e2023-09-05 13:38:07 +010032 "release_avf_enable_vendor_modules",
David Daie6f5bb02024-01-25 19:17:02 -080033 "release_avf_enable_virt_cpufreq",
Jeongik Cha798401c2024-04-11 21:54:49 +090034 "release_avf_support_custom_vm_with_paravirtualized_devices",
Nikita Ioffe3973d382023-08-31 17:53:25 +010035 ],
36 properties: [
37 "cfgs",
38 ],
39}
40
41avf_flag_aware_rust_defaults {
42 name: "avf_build_flags_rust",
43 soong_config_variables: {
Nikita Ioffe94a8a182023-11-16 16:37:48 +000044 release_avf_enable_device_assignment: {
45 cfgs: ["device_assignment"],
46 },
Alan Stokes7f27c0d2023-09-07 16:22:58 +010047 release_avf_enable_dice_changes: {
48 cfgs: ["dice_changes"],
49 },
Shikha Panwar95084df2023-07-22 11:47:45 +000050 release_avf_enable_llpvm_changes: {
51 cfgs: ["llpvm_changes"],
52 },
Nikita Ioffe3973d382023-08-31 17:53:25 +010053 release_avf_enable_multi_tenant_microdroid_vm: {
Alan Stokes27f3ef02023-09-29 15:09:35 +010054 cfgs: ["multi_tenant"],
Nikita Ioffe3973d382023-08-31 17:53:25 +010055 },
Seungjae Yoo529d53c2024-05-14 14:36:18 +090056 release_avf_enable_network: {
57 cfgs: ["network"],
58 },
Alice Wange9ac2db2023-09-08 15:13:13 +000059 release_avf_enable_remote_attestation: {
60 cfgs: ["remote_attestation"],
61 },
Nikita Ioffe631717e2023-09-05 13:38:07 +010062 release_avf_enable_vendor_modules: {
63 cfgs: ["vendor_modules"],
64 },
David Daie6f5bb02024-01-25 19:17:02 -080065 release_avf_enable_virt_cpufreq: {
66 cfgs: ["virt_cpufreq"],
67 },
Jeongik Cha798401c2024-04-11 21:54:49 +090068 release_avf_support_custom_vm_with_paravirtualized_devices: {
69 cfgs: ["paravirtualized_devices"],
70 },
Nikita Ioffe3973d382023-08-31 17:53:25 +010071 },
72}
Jaewan Kim0df5fb12023-09-24 23:33:54 +090073
Nikita Ioffe38b9e712024-02-08 15:55:07 +000074soong_config_module_type {
75 name: "avf_flag_aware_cc_defaults",
76 module_type: "cc_defaults",
77 config_namespace: "ANDROID",
78 bool_variables: [
Nikita Ioffefd109532024-03-04 13:58:01 +000079 "release_avf_enable_dice_changes",
Seungjae Yoob6e4f1d2024-06-17 15:13:12 +090080 "release_avf_enable_network",
Seungjae Yoo329f2862024-04-08 11:21:53 +090081 "release_avf_enable_vendor_modules",
Nikita Ioffe38b9e712024-02-08 15:55:07 +000082 "release_avf_enable_virt_cpufreq",
83 ],
84 properties: [
85 "cflags",
86 ],
87}
88
89avf_flag_aware_cc_defaults {
90 name: "avf_build_flags_cc",
91 soong_config_variables: {
Nikita Ioffefd109532024-03-04 13:58:01 +000092 release_avf_enable_dice_changes: {
93 cflags: ["-DAVF_OPEN_DICE_CHANGES=1"],
94 },
Seungjae Yoob6e4f1d2024-06-17 15:13:12 +090095 release_avf_enable_network: {
96 cflags: ["-DAVF_ENABLE_NETWORK=1"],
97 },
Seungjae Yoo329f2862024-04-08 11:21:53 +090098 release_avf_enable_vendor_modules: {
99 cflags: ["-DAVF_ENABLE_VENDOR_MODULES=1"],
100 },
Nikita Ioffe38b9e712024-02-08 15:55:07 +0000101 release_avf_enable_virt_cpufreq: {
102 cflags: ["-DAVF_ENABLE_VIRT_CPUFREQ=1"],
103 },
104 },
105}
106
Jaewan Kim0df5fb12023-09-24 23:33:54 +0900107genrule_defaults {
108 name: "dts_to_dtb",
109 tools: ["dtc"],
Jaewan Kima232ed02024-02-25 16:08:14 +0000110 cmd: "FILES=($(in)) && $(location dtc) -@ -I dts -O dtb $${FILES[-1]} -o $(out)",
Jaewan Kim0df5fb12023-09-24 23:33:54 +0900111}
Nikita Ioffee3a049f2024-02-15 15:47:23 +0000112
113// This is a temporary workaround until b/309090563 is implemented.
114aconfig_declarations {
115 name: "avf_aconfig_flags",
116 package: "com.android.system.virtualmachine.flags",
Yu Liu6c8ce022024-03-28 17:30:05 +0000117 container: "com.android.virt",
Nikita Ioffee3a049f2024-02-15 15:47:23 +0000118 srcs: [
119 "avf_flags.aconfig",
120 ],
121}
122
123java_aconfig_library {
124 name: "avf_aconfig_flags_java",
125 aconfig_declarations: "avf_aconfig_flags",
126 sdk_version: "module_current",
127 apex_available: ["com.android.virt"],
128}