Allow applications to target future API levels
E.g. if an application's default.properties targets android-10 then the build system will default it to the highest supported API level found in build/platforms (e.g. android-4 currently).
This commit is contained in:
@@ -69,11 +69,14 @@ ifndef APP_PLATFORM
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Check that the value of APP_PLATFORM corresponds to a known platform
|
||||||
|
# If not, we're going to use the max supported platform value.
|
||||||
|
#
|
||||||
_bad_platform := $(strip $(filter-out $(NDK_ALL_PLATFORMS),$(APP_PLATFORM)))
|
_bad_platform := $(strip $(filter-out $(NDK_ALL_PLATFORMS),$(APP_PLATFORM)))
|
||||||
ifdef _bad_platform
|
ifdef _bad_platform
|
||||||
$(call __ndk_info,Application $(_name) targets platform '$(_bad_platform)')
|
$(call __ndk_info,Application $(_name) targets unknown platform '$(_bad_platform)')
|
||||||
$(call __ndk_info,which is not supported by this release of the Android NDK)
|
APP_PLATFORM := android-$(NDK_MAX_PLATFORM_LEVEL)
|
||||||
$(call __ndk_error,Aborting...)
|
$(call __ndk_info,Switching to $(APP_PLATFORM))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# If APP_BUILD_SCRIPT is defined, check that the file exists.
|
# If APP_BUILD_SCRIPT is defined, check that the file exists.
|
||||||
|
|||||||
@@ -114,6 +114,18 @@ $(foreach _platform,$(NDK_ALL_PLATFORMS),\
|
|||||||
$(eval include $(BUILD_SYSTEM)/add-platform.mk)\
|
$(eval include $(BUILD_SYSTEM)/add-platform.mk)\
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# we're going to find the maximum platform number of the form android-<number>
|
||||||
|
# ignore others, which could correspond to special and experimental cases
|
||||||
|
NDK_ALL_PLATFORM_LEVELS := $(filter android-%,$(NDK_ALL_PLATFORMS))
|
||||||
|
NDK_ALL_PLATFORM_LEVELS := $(patsubst android-%,%,$(NDK_ALL_PLATFORM_LEVELS))
|
||||||
|
$(call ndk_log,Found stable platform levels: $(NDK_ALL_PLATFORM_LEVELS))
|
||||||
|
|
||||||
|
NDK_MAX_PLATFORM_LEVEL := 3
|
||||||
|
$(foreach level,$(NDK_ALL_PLATFORM_LEVELS),\
|
||||||
|
$(eval NDK_MAX_PLATFORM_LEVEL := $$(call max,$$(NDK_MAX_PLATFORM_LEVEL),$$(level)))\
|
||||||
|
)
|
||||||
|
$(call ndk_log,Found max platform level: $(NDK_MAX_PLATFORM_LEVEL))
|
||||||
|
|
||||||
# ====================================================================
|
# ====================================================================
|
||||||
#
|
#
|
||||||
# Read all application configuration files
|
# Read all application configuration files
|
||||||
|
|||||||
Reference in New Issue
Block a user