Introduced WEBRTC_ANDROID_PLATFORM_BUILD and make test app build on all platforms

BUG=
TEST=build on all platforms
Review URL: https://webrtc-codereview.appspot.com/446012

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1907 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/src/modules/audio_processing/Android.mk b/src/modules/audio_processing/Android.mk
index c03c1b0..7b2a499 100644
--- a/src/modules/audio_processing/Android.mk
+++ b/src/modules/audio_processing/Android.mk
@@ -33,7 +33,9 @@
 # Flags passed to both C and C++ files.
 LOCAL_CFLAGS := \
     $(MY_WEBRTC_COMMON_DEFS) \
-    '-DWEBRTC_NS_FIXED'
+    '-DWEBRTC_NS_FIXED' \
+    '-DWEBRTC_ANDROID_PLATFORM_BUILD' \
+    '-DWEBRTC_AUDIOPROC_DEBUG_DUMP'
 #   floating point
 #   -DWEBRTC_NS_FLOAT'
 
@@ -59,3 +61,89 @@
 include external/stlport/libstlport.mk
 endif
 include $(BUILD_STATIC_LIBRARY)
+
+# apm process test app
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_SRC_FILES:= \
+    $(call all-proto-files-under, .) \
+    test/process_test.cc
+
+# Flags passed to both C and C++ files.
+LOCAL_CFLAGS := \
+    $(MY_WEBRTC_COMMON_DEFS) \
+    '-DWEBRTC_ANDROID_PLATFORM_BUILD' \
+    '-DWEBRTC_AUDIOPROC_DEBUG_DUMP'
+
+LOCAL_C_INCLUDES := \
+    $(LOCAL_PATH)/include \
+    $(LOCAL_PATH)/../interface \
+    $(LOCAL_PATH)/../.. \
+    $(LOCAL_PATH)/../../system_wrappers/interface \
+    external/gtest/include
+
+LOCAL_STATIC_LIBRARIES := \
+    libgtest \
+    libprotobuf-cpp-2.3.0-lite
+
+LOCAL_SHARED_LIBRARIES := \
+    libutils \
+    libstlport \
+    libwebrtc_audio_preprocessing
+
+LOCAL_MODULE:= webrtc_audioproc
+
+ifdef NDK_ROOT
+include $(BUILD_EXECUTABLE)
+else
+include external/stlport/libstlport.mk
+include $(BUILD_NATIVE_TEST)
+endif
+
+# apm unit test app
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_SRC_FILES:= \
+    $(call all-proto-files-under, test) \
+    test/unit_test.cc \
+    ../../../test/testsupport/fileutils.cc
+
+# Flags passed to both C and C++ files.
+LOCAL_CFLAGS := \
+    $(MY_WEBRTC_COMMON_DEFS) \
+    '-DWEBRTC_AUDIOPROC_FIXED_PROFILE' \
+    '-DWEBRTC_ANDROID_PLATFORM_BUILD' \
+    '-DWEBRTC_AUDIOPROC_DEBUG_DUMP'
+
+LOCAL_C_INCLUDES := \
+    $(LOCAL_PATH)/include \
+    $(LOCAL_PATH)/../interface \
+    $(LOCAL_PATH)/../.. \
+    $(LOCAL_PATH)/../../../test \
+    $(LOCAL_PATH)/../../system_wrappers/interface \
+    $(LOCAL_PATH)/../../common_audio/signal_processing/include \
+    external/gtest/include \
+    external/protobuf/src
+
+LOCAL_STATIC_LIBRARIES := \
+    libgtest \
+    libprotobuf-cpp-2.3.0-lite
+
+LOCAL_SHARED_LIBRARIES := \
+    libstlport \
+    libwebrtc_audio_preprocessing
+
+LOCAL_MODULE:= webrtc_audioproc_unittest
+
+ifdef NDK_ROOT
+include $(BUILD_EXECUTABLE)
+else
+include external/stlport/libstlport.mk
+include $(BUILD_NATIVE_TEST)
+endif
diff --git a/src/modules/audio_processing/audio_processing_impl.cc b/src/modules/audio_processing/audio_processing_impl.cc
index 2dea0e9..f1f2f48 100644
--- a/src/modules/audio_processing/audio_processing_impl.cc
+++ b/src/modules/audio_processing/audio_processing_impl.cc
@@ -28,7 +28,7 @@
 
 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
 // Files generated at build-time by the protobuf compiler.
-#ifdef WEBRTC_ANDROID
+#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
 #include "external/webrtc/src/modules/audio_processing/debug.pb.h"
 #else
 #include "webrtc/audio_processing/debug.pb.h"
diff --git a/src/modules/audio_processing/test/process_test.cc b/src/modules/audio_processing/test/process_test.cc
index d4841c7..7ebf8ad 100644
--- a/src/modules/audio_processing/test/process_test.cc
+++ b/src/modules/audio_processing/test/process_test.cc
@@ -21,9 +21,11 @@
 #include "module_common_types.h"
 #include "scoped_ptr.h"
 #include "tick_util.h"
-
+#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
+#include "external/webrtc/src/modules/audio_processing/debug.pb.h"
+#else
 #include "webrtc/audio_processing/debug.pb.h"
-
+#endif
 
 using webrtc::AudioFrame;
 using webrtc::AudioProcessing;
diff --git a/src/modules/audio_processing/test/unit_test.cc b/src/modules/audio_processing/test/unit_test.cc
index 573fd8d..00161a6 100644
--- a/src/modules/audio_processing/test/unit_test.cc
+++ b/src/modules/audio_processing/test/unit_test.cc
@@ -20,8 +20,11 @@
 #include "testsupport/fileutils.h"
 #include "thread_wrapper.h"
 #include "trace.h"
+#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
+#include "external/webrtc/src/modules/audio_processing/test/unittest.pb.h"
+#else
 #include "webrtc/audio_processing/unittest.pb.h"
-
+#endif
 
 #if (defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)) || \
     (defined(WEBRTC_LINUX) && defined(WEBRTC_ARCH_X86_64) && !defined(NDEBUG))