aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJustin Yun <justinyun@google.com>2021-11-09 23:09:52 +0900
committerJustin Yun <justinyun@google.com>2021-11-10 00:34:17 +0000
commite81ec6960a64077cb46983499e80bdcc2dc316e2 (patch)
tree5e9b0401212ca764df0dd9a1da02d3f109b179f8 /common
parenta42119256857128eb49a60a1d77864c206ea3e7b (diff)
downloadbuild-e81ec6960a64077cb46983499e80bdcc2dc316e2.tar.gz
Fix BOARD_SYSTEMSDK_VERSIONS checks
BOARD_SYSTEMSDK_VERSIONS must be greater than or equal to the minimum of PRODUCT_SHIPPING_API_LEVEL and BOARD_API_LEVEL. If BOARD_API_LEVEL is not defined, read BOARD_SHIPPING_API_LEVEL. If both board api levels are not defined, compare only with PRODUCT_SHIPPING_API_LEVEL. Bug: 204964200 Bug: 201489975 Bug: 202919753 Test: manual test with different settings Change-Id: I36fa0b2fed3bca9ebe1baad46ee1dbe8cb1414e3
Diffstat (limited to 'common')
-rw-r--r--common/math.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/math.mk b/common/math.mk
index ec15f88ee0..0271ea8b03 100644
--- a/common/math.mk
+++ b/common/math.mk
@@ -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)