Switch to use rs_version.mk for consistency.
Change-Id: Ia19bb2f56653b10741d8b508c3dc3f93ce1c1495
diff --git a/Android.mk b/Android.mk
index bd465d6..5427f3b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -21,6 +21,8 @@
LIBBCC_ROOT_PATH := $(LOCAL_PATH)
include $(LIBBCC_ROOT_PATH)/libbcc.mk
+include frameworks/compile/slang/rs_version.mk
+
#=====================================================================
# Whole Static Library to Be Linked In
#=====================================================================
diff --git a/bcinfo/Android.mk b/bcinfo/Android.mk
index 07989a8..09c231b 100644
--- a/bcinfo/Android.mk
+++ b/bcinfo/Android.mk
@@ -22,18 +22,11 @@
local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS
endif
-ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
- BCINFO_API_VERSION := $(PLATFORM_SDK_VERSION)
-else
- # Increment by 1 whenever this is not a final release build, since we want to
- # be able to see the RS version number change during development.
- # See build/core/version_defaults.mk for more information about this.
- BCINFO_API_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
-endif
-local_cflags_for_libbcinfo += -DBCINFO_API_VERSION=$(BCINFO_API_VERSION)
-
LOCAL_PATH := $(call my-dir)
+include frameworks/compile/slang/rs_version.mk
+local_cflags_for_libbcinfo += $(RS_VERSION_DEFINE)
+
libbcinfo_SRC_FILES := \
BitcodeTranslator.cpp \
BitcodeWrapper.cpp \
diff --git a/bcinfo/BitcodeTranslator.cpp b/bcinfo/BitcodeTranslator.cpp
index 506a12a..d4cb732 100644
--- a/bcinfo/BitcodeTranslator.cpp
+++ b/bcinfo/BitcodeTranslator.cpp
@@ -55,7 +55,7 @@
* 16 - Ice Cream Sandwich MR2
*/
static const unsigned int kMinimumAPIVersion = 11;
-static const unsigned int kMaximumAPIVersion = BCINFO_API_VERSION;
+static const unsigned int kMaximumAPIVersion = RS_VERSION;
static const unsigned int kCurrentAPIVersion = 10000;
/**
diff --git a/bcinfo/MetadataExtractor.cpp b/bcinfo/MetadataExtractor.cpp
index e6730a7..b4ee86d 100644
--- a/bcinfo/MetadataExtractor.cpp
+++ b/bcinfo/MetadataExtractor.cpp
@@ -83,7 +83,7 @@
mPragmaCount(0), mPragmaKeyList(NULL), mPragmaValueList(NULL),
mObjectSlotCount(0), mObjectSlotList(NULL),
mRSFloatPrecision(RS_FP_Full) {
- mCompilerVersion = 0;
+ mCompilerVersion = RS_VERSION; // Default to the actual current version.
mOptimizationLevel = 3;
}
diff --git a/libbcc-device-build.mk b/libbcc-device-build.mk
index 639a0d6..5324e15 100644
--- a/libbcc-device-build.mk
+++ b/libbcc-device-build.mk
@@ -21,6 +21,7 @@
-Wno-unused-parameter \
-Werror \
-DTARGET_BUILD \
+ $(RS_VERSION_DEFINE) \
$(LOCAL_CFLAGS)
ifeq ($(TARGET_BUILD_VARIANT),eng)
diff --git a/libbcc-host-build.mk b/libbcc-host-build.mk
index 39c6117..78fe64c 100644
--- a/libbcc-host-build.mk
+++ b/libbcc-host-build.mk
@@ -21,6 +21,7 @@
-Wno-unused-parameter \
-Werror \
-D__HOST__ \
+ $(RS_VERSION_DEFINE) \
$(LOCAL_CFLAGS)
ifeq ($(TARGET_BUILD_VARIANT),eng)