Unset ENABLE_PREOPT when DISABLE_PREOPT is set

Instead of TARGET_BUILD_APPS, introduce DISABLE_PREOPT,
which is true when TARGET_BUILD_UNBUNDLED_IMAGE or TARGET_BUILD_APPS is set.

Test: TARGET_BUILD_UNBUNDLED_IMAGE=true m vendorimage and then
      check if there is no preopt
Bug: 160390776

Change-Id: Id27030e602a29ebd438678270db13744dd145143
This commit is contained in:
Jeongik Cha 2020-07-08 18:18:11 +09:00
parent d05b57a362
commit f26015449f
3 changed files with 8 additions and 4 deletions

View File

@ -526,13 +526,17 @@ endif
.KATI_READONLY := ALLOW_MISSING_DEPENDENCIES
TARGET_BUILD_USE_PREBUILT_SDKS :=
DISABLE_PREOPT :=
ifneq (,$(TARGET_BUILD_APPS)$(TARGET_BUILD_UNBUNDLED_IMAGE))
DISABLE_PREOPT := true
ifndef UNBUNDLED_BUILD_SDKS_FROM_SOURCE
TARGET_BUILD_USE_PREBUILT_SDKS := true
endif
endif
.KATI_READONLY := TARGET_BUILD_USE_PREBUILT_SDKS
.KATI_READONLY := \
TARGET_BUILD_USE_PREBUILT_SDKS \
DISABLE_PREOPT \
prebuilt_sdk_tools := prebuilts/sdk/tools
prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin

View File

@ -5,7 +5,7 @@ ifneq (true,$(filter true,$(WITH_DEXPREOPT)))
ENABLE_PREOPT :=
else ifneq (true,$(filter true,$(PRODUCT_USES_DEFAULT_ART_CONFIG)))
ENABLE_PREOPT :=
else ifneq (,$(TARGET_BUILD_APPS))
else ifeq (true,$(DISABLE_PREOPT))
ENABLE_PREOPT :=
endif

View File

@ -40,8 +40,8 @@ ifneq (,$(filter $(LOCAL_MODULE),$(DEXPREOPT_DISABLED_MODULES)))
LOCAL_DEX_PREOPT :=
endif
# Disable preopt for TARGET_BUILD_APPS
ifneq (,$(TARGET_BUILD_APPS))
# Disable preopt for DISABLE_PREOPT
ifeq (true,$(DISABLE_PREOPT))
LOCAL_DEX_PREOPT :=
endif