Merge "Define __ANDROID_VENDOR_API__" into main am: e4922b8796

Original change: https://android-review.googlesource.com/c/platform/build/+/2851329

Change-Id: I609ac123e62409720e956841580f09ab15f0f402
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-12-05 03:50:30 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 15 deletions

View File

@@ -289,25 +289,20 @@ ifeq ($(NATIVE_COVERAGE),true)
endif
ifneq ($(LOCAL_USE_VNDK),)
# Required VNDK version for vendor modules is BOARD_VNDK_VERSION.
my_api_level := $(BOARD_VNDK_VERSION)
ifeq ($(my_api_level),current)
# Build with current PLATFORM_VNDK_VERSION.
# If PLATFORM_VNDK_VERSION has a CODENAME, it will return
# __ANDROID_API_FUTURE__.
my_api_level := $(call codename-or-sdk-to-sdk,$(PLATFORM_VNDK_VERSION))
else
# Build with current BOARD_VNDK_VERSION.
my_api_level := $(call codename-or-sdk-to-sdk,$(BOARD_VNDK_VERSION))
endif
my_cflags += -D__ANDROID_VNDK__
ifneq ($(LOCAL_USE_VNDK_VENDOR),)
# Vendor modules have LOCAL_USE_VNDK_VENDOR when
# BOARD_VNDK_VERSION is defined.
# Vendor modules have LOCAL_USE_VNDK_VENDOR
my_cflags += -D__ANDROID_VENDOR__
ifeq ($(BOARD_API_LEVEL),)
# TODO(b/314036847): This is a fallback for UDC targets.
# This must be a build failure when UDC is no longer built from this source tree.
my_cflags += -D__ANDROID_VENDOR_API__=$(PLATFORM_SDK_VERSION)
else
my_cflags += -D__ANDROID_VENDOR_API__=$(BOARD_API_LEVEL)
endif
else ifneq ($(LOCAL_USE_VNDK_PRODUCT),)
# Product modules have LOCAL_USE_VNDK_PRODUCT when
# PRODUCT_PRODUCT_VNDK_VERSION is defined.
# Product modules have LOCAL_USE_VNDK_PRODUCT
my_cflags += -D__ANDROID_PRODUCT__
endif
endif

View File

@@ -147,6 +147,7 @@ $(call add_json_bool, SamplingPGO, $(filter true,$(SAMPLIN
$(call add_json_bool, ArtUseReadBarrier, $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER))))
$(call add_json_str, BtConfigIncludeDir, $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR))
$(call add_json_list, DeviceKernelHeaders, $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) $(TARGET_PRODUCT_KERNEL_HEADERS))
$(call add_json_str, VendorApiLevel, $(BOARD_API_LEVEL))
$(call add_json_str, DeviceVndkVersion, $(BOARD_VNDK_VERSION))
$(call add_json_str, Platform_vndk_version, $(PLATFORM_VNDK_VERSION))
$(call add_json_list, ExtraVndkVersions, $(PRODUCT_EXTRA_VNDK_VERSIONS))