Compile libupdate_engine_client even when dbus is disabled.
This patch enables libupdate_engine_client with the right backend
even when dbus is disabled.
Bug: None
TEST=`m` on edison-eng and aosp_arm-eng
Change-Id: Ifc6293cc748575800c923f5537c0865463101f32
diff --git a/Android.mk b/Android.mk
index 6e7d200..c6e5a4e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -572,8 +572,6 @@
LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
include $(BUILD_EXECUTABLE)
-ifeq ($(local_use_dbus),1)
-
# libupdate_engine_client
# ========================================================
include $(CLEAR_VARS)
@@ -582,9 +580,11 @@
-Wall \
-Werror \
-Wno-unused-parameter \
+ -DUSE_DBUS=$(local_use_dbus) \
-DUSE_BINDER=$(local_use_binder)
LOCAL_CLANG := true
LOCAL_CPP_EXTENSION := .cc
+# TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used.
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/client_library/include \
external/cros/system_api/dbus \
@@ -593,33 +593,35 @@
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
LOCAL_SHARED_LIBRARIES := \
libchrome \
- libchrome-dbus \
- libbrillo \
- libbrillo-dbus
-LOCAL_STATIC_LIBRARIES := \
- update_engine_client-dbus-proxies
+ libbrillo
LOCAL_SRC_FILES := \
client_library/client.cc \
update_status_utils.cc
+# We can only compile support for one IPC mechanism. If both "binder" and "dbus"
+# are defined, we prefer binder.
ifeq ($(local_use_binder),1)
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
-LOCAL_SRC_FILES += \
- client_library/client_binder.cc \
- parcelable_update_engine_status.cc \
- binder_bindings/android/brillo/IUpdateEngine.aidl \
- binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl
LOCAL_SHARED_LIBRARIES += \
libbinder \
libutils
+LOCAL_SRC_FILES += \
+ binder_bindings/android/brillo/IUpdateEngine.aidl \
+ binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
+ client_library/client_binder.cc \
+ parcelable_update_engine_status.cc
else # local_use_binder != 1
-LOCAL_SRC_FILES += client_library/client_dbus.cc
+LOCAL_STATIC_LIBRARIES := \
+ update_engine_client-dbus-proxies
+LOCAL_SHARED_LIBRARIES += \
+ libchrome-dbus \
+ libbrillo-dbus
+LOCAL_SRC_FILES += \
+ client_library/client_dbus.cc
endif # local_use_binder == 1
include $(BUILD_SHARED_LIBRARY)
-endif # local_use_dbus == 1
-
# Weave schema files
# ========================================================
include $(CLEAR_VARS)