webrtc/android-webrtc.mk
andrew@webrtc.org c8d012fb32 Use -msse2 for SSE2 optimized code.
When targeting 32-bit Linux, we need to pass -msse2 to gcc to compile
SSE2 intrinsics. However, -msse2 also gives gcc license to automatically
generate SSE2 instructions wherever it pleases. This will crash our code
on processors without SSE2 support.

This change breaks the files with SSE2 intrinsics into separate targets,
such that we can limit the scope of -msse2 to where it's needed.

We no longer need to employ the WEBRTC_USE_SSE2 define; the build system
decides when SSE2 is supported and compiles the appropriate files.

TBR=bjornv@webrtc.org
TEST=audioproc (performance testing), audioproc_unittest, video_processing_unittests, build on Linux (targeting ia32/x64, with disable_sse2==0/1), Mac, Windows

Review URL: http://webrtc-codereview.appspot.com/352008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1425 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-01-13 19:43:09 +00:00

45 lines
1.6 KiB
Makefile

# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# These defines will apply to all source files
# Think again before changing it
MY_WEBRTC_COMMON_DEFS := \
'-DWEBRTC_TARGET_PC' \
'-DWEBRTC_LINUX' \
'-DWEBRTC_THREAD_RR' \
'-DWEBRTC_CLOCK_TYPE_REALTIME' \
'-DWEBRTC_ANDROID'
# The following macros are used by modules,
# we might need to re-organize them
# '-DWEBRTC_ANDROID_OPENSLES' [module audio_device]
# '-DNETEQ_VOICEENGINE_CODECS' [module audio_coding neteq]
# '-DWEBRTC_MODULE_UTILITY_VIDEO' [module media_file] [module utility]
ifeq ($(TARGET_ARCH),arm)
MY_WEBRTC_COMMON_DEFS += \
'-DWEBRTC_ARCH_ARM'
# '-DWEBRTC_DETECT_ARM_NEON' # only used in a build configuration without Neon
# TODO(kma): figure out if the above define could be moved to NDK build only.
# TODO(kma): test if the code under next two macros works with generic GCC compilers
ifeq ($(ARCH_ARM_HAVE_NEON),true)
MY_WEBRTC_COMMON_DEFS += \
'-DWEBRTC_ARCH_ARM_NEON'
MY_ARM_CFLAGS_NEON := \
-flax-vector-conversions
endif
ifneq (,$(filter '-DWEBRTC_DETECT_ARM_NEON' '-DWEBRTC_ARCH_ARM_NEON', \
$(MY_WEBRTC_COMMON_DEFS)))
WEBRTC_BUILD_NEON_LIBS := true
endif
ifeq ($(ARCH_ARM_HAVE_ARMV7A),true)
MY_WEBRTC_COMMON_DEFS += \
'-DWEBRTC_ARCH_ARM_V7A'
endif