Add vendor_available: true to libbuildverison

This allows using libbuildversion in Cuttlefish, which builds many
binaries for both vendor and host.

On vendor executables, this gets the build id from the
ro.vendor.build.version.incremental property.

Bug: 206843934
Test: m -j
Change-Id: I9ab11b42de3f1febf282f107c3e137592097d3c0
This commit is contained in:
A. Cody Schuffelen 2021-12-06 16:20:24 -08:00
parent 2a7092927c
commit 580b93c3e8
2 changed files with 5 additions and 0 deletions

View file

@ -19,4 +19,5 @@ cc_library_static {
"//apex_available:platform",
"//apex_available:anyapex",
],
vendor_available: true,
}

View file

@ -36,7 +36,11 @@ std::string GetBuildNumber() {
return soong_build_number;
}
#ifdef __ANDROID_VENDOR__
const prop_info* pi = __system_property_find("ro.vendor.build.version.incremental");
#else
const prop_info* pi = __system_property_find("ro.build.version.incremental");
#endif
if (pi == nullptr) return "";
std::string property_value;