Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5b59967 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix BOARD_SYSTEMSDK_VERSIONS checks" am: 7bd2d13c

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

Change-Id: I9fda76d7ddf8cd478c7fd1ca4bfeff9dd8f540ab
parents 88fac99a 7bd2d13c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -121,14 +121,26 @@ $(strip $(call _math_check_valid,$(1)) $(call _math_check_valid,$(2)) \
  $(lastword $(filter $(1) $(2),$(__MATH_NUMBERS))))
endef

# Returns the lesser of $1 or $2.
define math_min
$(strip $(call _math_check_valid,$(1)) $(call _math_check_valid,$(2)) \
  $(firstword $(filter $(1) $(2),$(__MATH_NUMBERS))))
endef

$(call math-expect-error,(call math_max),Argument missing)
$(call math-expect-error,(call math_max,1),Argument missing)
$(call math-expect-error,(call math_max,1 2,3),Multiple words in a single argument: 1 2)
$(call math-expect-error,(call math_min,1,2 3),Multiple words in a single argument: 2 3)
$(call math-expect,(call math_max,0,1),1)
$(call math-expect,(call math_max,1,0),1)
$(call math-expect,(call math_max,1,1),1)
$(call math-expect,(call math_max,5,42),42)
$(call math-expect,(call math_max,42,5),42)
$(call math-expect,(call math_min,0,1),0)
$(call math-expect,(call math_min,1,0),0)
$(call math-expect,(call math_min,1,1),1)
$(call math-expect,(call math_min,7,32),7)
$(call math-expect,(call math_min,32,7),7)

define math_gt_or_eq
$(if $(filter $(1),$(call math_max,$(1),$(2))),true)
+9 −6
Original line number Diff line number Diff line
@@ -761,13 +761,16 @@ else
endif
.KATI_READONLY := BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES

min_systemsdk_version := $(firstword $(BOARD_API_LEVEL) $(BOARD_SHIPPING_API_LEVEL) $(PRODUCT_SHIPPING_API_LEVEL))
ifneq (,$(min_systemsdk_version))
ifdef PRODUCT_SHIPPING_API_LEVEL
  board_api_level := $(firstword $(BOARD_API_LEVEL) $(BOARD_SHIPPING_API_LEVEL))
  ifneq (,$(board_api_level))
    min_systemsdk_version := $(call math_min,$(board_api_level),$(PRODUCT_SHIPPING_API_LEVEL))
  else
    min_systemsdk_version := $(PRODUCT_SHIPPING_API_LEVEL)
  endif
  ifneq ($(call numbers_less_than,$(min_systemsdk_version),$(BOARD_SYSTEMSDK_VERSIONS)),)
    $(error BOARD_SYSTEMSDK_VERSIONS ($(BOARD_SYSTEMSDK_VERSIONS)) must all be greater than or equal to BOARD_API_LEVEL, BOARD_SHIPPING_API_LEVEL or PRODUCT_SHIPPING_API_LEVEL ($(min_systemsdk_version)))
  endif
endif
ifdef PRODUCT_SHIPPING_API_LEVEL
  ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),28),)
    ifneq ($(TARGET_IS_64_BIT), true)
      ifneq ($(TARGET_USES_64_BIT_BINDER), true)