Fix PDK build
This commit disables "perfetto", "perfetto_integrationtests", and
"perfetto_unittests" in PDK builds because they depend on "libandroid"
or "libservices" which are not in PDK builds as well.
Test: Build a target (described in http://b/72961456) with
`platform.zip` built from master FSK source tree.
Bug: 72961456
Change-Id: Id754c322fefa75d37c5acc55ef52b0efeb4f6e8a
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
index 8cb7e39..a7dafc5 100755
--- a/tools/gen_android_bp
+++ b/tools/gen_android_bp
@@ -78,6 +78,12 @@
# Compiler defines which are passed through to the blueprint.
define_whitelist = r'^GOOGLE_PROTO.*$'
+# Shared libraries which are not in PDK.
+library_not_in_pdk = {
+ 'libandroid',
+ 'libservices',
+}
+
def enable_gmock(module):
module.static_libs.append('libgmock')
@@ -178,6 +184,12 @@
self._output_field(output, 'defaults')
self._output_field(output, 'cflags')
self._output_field(output, 'local_include_dirs')
+ if any(name in library_not_in_pdk for name in self.shared_libs):
+ output.append(' product_variables: {')
+ output.append(' pdk: {')
+ output.append(' enabled: false,')
+ output.append(' },')
+ output.append(' },')
output.append('}')
output.append('')
@@ -186,7 +198,7 @@
if not value:
return
if isinstance(value, set):
- value = sorted(value)
+ value = sorted(value)
if isinstance(value, list):
output.append(' %s: [' % name)
for item in sorted(value) if sort else value: