From 83e7cc5a7f4582c919c99a0459a500a263b57824 Mon Sep 17 00:00:00 2001 From: Aleks Rozman Date: Wed, 20 Nov 2024 22:48:19 +0000 Subject: [PATCH] Build lyric from source if prebuilt directory is missing. On select branches, like the camera-stability, the prebuilt directory is missing so we want to make sure that it is building from source even if the flags tell us that a prebuilt should be used. Bug: 380099804 Change-Id: I8832451c1f7ff6d6de3c2991e9f63317966a2f83 Test: Make on camera-stability-dev and verify warning Flag: EXEMPT (not applicable) --- camera/lyric.mk | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/camera/lyric.mk b/camera/lyric.mk index c886138..0ec1d6d 100644 --- a/camera/lyric.mk +++ b/camera/lyric.mk @@ -20,8 +20,20 @@ endif # All shipping releases will switch to prebuilts (trunk+) # if this condition is not true, then build from source. -ifneq ($(RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT),true) +# Fallback if the prebuilts directory does not exist, then we must +# build from source no matter what, so we log a warning +ifeq ($(RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT),true) + ifeq ($(wildcard vendor/google/services/LyricCameraHAL/prebuilt),) + $(warning Lyric prebuilt directory is missing, it will be built from source) + BUILD_LYRIC_FROM_SOURCE := true + else + BUILD_LYRIC_FROM_SOURCE := false + endif +else + BUILD_LYRIC_FROM_SOURCE := true +endif # RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT +ifeq ($(BUILD_LYRIC_FROM_SOURCE),true) PRODUCT_SOONG_NAMESPACES += \ vendor/google/camera \ vendor/google/camera/google_3a/libs_v4 \ @@ -41,7 +53,7 @@ PRODUCT_SOONG_NAMESPACES += \ # Calibration tool for debug builds PRODUCT_PACKAGES_DEBUG += tarasque_test PRODUCT_PACKAGES_DEBUG += ProtoCalibGenerator -endif # RELEASE_PIXEL_CAMERA_ENABLE_PREBUILT check +endif # BUILD_LYRIC_FROM_SOURCE # Init-time log settings for Google 3A PRODUCT_PACKAGES += libg3a_standalone_gabc_rc