diff --git a/Android.mk b/Android.mk
index 4cfaa31693baadf927d5392e222b00948c8a588e..000144eb10fc0201b3ff5b6aec2946b2af54ae39 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,4 @@
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
 ifneq (, $(filter aarch64 arm64, $(TARGET_ARCH)))
     $(info TODOAArch64: $(LOCAL_PATH)/Android.mk: Enable build support for 64 bit)
 else
@@ -22,3 +23,4 @@ LOCAL_PATH := $(LOCAL_DIR_PATH)
 include $(LOCAL_PATH)/FMRecord/Android.mk
 endif # is-vendor-board-platform
 endif # TARGET_ARCH
+endif # BOARD_HAVE_QCOM_FM
diff --git a/FMRecord/Android.mk b/FMRecord/Android.mk
index 647b9419a6c5000ade91c63d06a46003951cd06d..b248bc34bb963432d51e99bdbd3cb6b4c142ef34 100644
--- a/FMRecord/Android.mk
+++ b/FMRecord/Android.mk
@@ -1,3 +1,4 @@
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
 ifneq (,$(filter $(QCOM_BOARD_PLATFORMS),$(TARGET_BOARD_PLATFORM)))
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
@@ -10,5 +11,5 @@ LOCAL_PACKAGE_NAME := FMRecord
 LOCAL_CERTIFICATE := platform
 LOCAL_PROGUARD_ENABLED := disabled
 include $(BUILD_PACKAGE)
-
 endif
+endif # BOARD_HAVE_QCOM_FM
diff --git a/jni/Android.mk b/jni/Android.mk
index c3b3a428b6278588669f10a281dd12afdfc08582..9a7882230e03908e3fd34fa225448aec9f46d587 100644
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -1,3 +1,4 @@
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
 ifneq (,$(filter $(QCOM_BOARD_PLATFORMS),$(TARGET_BOARD_PLATFORM)))
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
@@ -21,3 +22,4 @@ LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_SHARED_LIBRARY)
 endif # is-vendor-board-platform
+endif # BOARD_HAVE_QCOM_FM