summaryrefslogtreecommitdiffstats
path: root/third_party/opus
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/opus')
-rw-r--r--third_party/opus/opus.gyp44
-rw-r--r--third_party/opus/overrides/include/opus_defines.h19
2 files changed, 48 insertions, 15 deletions
diff --git a/third_party/opus/opus.gyp b/third_party/opus/opus.gyp
index c11c9e1..ffd84c7 100644
--- a/third_party/opus/opus.gyp
+++ b/third_party/opus/opus.gyp
@@ -12,17 +12,41 @@
{
'target_name': 'opus',
'type': 'static_library',
+ 'defines': [
+ 'OPUS_BUILD',
+ 'WORDS_BIGENDIAN',
+ ],
+ 'conditions': [
+ ['OS!="win"', {
+ 'defines': [
+ 'HAVE_LRINT',
+ 'HAVE_LRINTF',
+ 'VAR_ARRAYS',
+ ],
+ }, {
+ 'defines': [
+ 'USE_ALLOCA',
+ 'inline=__inline',
+ ],
+ 'msvs_disabled_warnings': [
+ 4305, # Disable truncation warning in celt/pitch.c .
+ ],
+ }],
+ ],
'include_dirs': [
+ '../..',
+ 'overrides/include',
'src/celt',
'src/include',
'src/silk',
'src/silk/float',
],
- 'defines': [
- 'OPUS_BUILD',
- 'VAR_ARRAYS',
- 'WORDS_BIGENDIAN',
- ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ 'overrides/include',
+ 'src/include',
+ ],
+ },
'sources': [
'src/celt/_kiss_fft_guts.h',
'src/celt/arch.h',
@@ -129,8 +153,6 @@
'src/silk/float/scale_vector_FLP.c',
'src/silk/float/schur_FLP.c',
'src/silk/float/SigProc_FLP.h',
- 'src/silk/float/silk_float.vcxproj',
- 'src/silk/float/silk_float.vcxproj.filters',
'src/silk/float/solve_LS_FLP.c',
'src/silk/float/sort_FLP.c',
'src/silk/float/structs_FLP.h',
@@ -210,14 +232,6 @@
'src/src/opus_multistream.c',
'src/src/repacketizer.c',
],
- 'conditions': [
- ['os_posix == 1', {
- 'defines': [
- 'HAVE_LRINT',
- 'HAVE_LRINTF',
- ],
- }],
- ],
}, # target opus
]
}, { # use_system_opus != 0
diff --git a/third_party/opus/overrides/include/opus_defines.h b/third_party/opus/overrides/include/opus_defines.h
new file mode 100644
index 0000000..290bc91
--- /dev/null
+++ b/third_party/opus/overrides/include/opus_defines.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/stringize_macros.h"
+
+// HACK: This is a hack to make sure that we don't export opus symbols.
+// opus_defines.h sets OPUS_EXPORT only when OPUS_BUILD is defined.
+#if defined(OPUS_BUILD)
+#undef OPUS_BUILD
+#define OPUS_BUILD_DEFINED
+#endif // defined(OPUS_BUILD)
+
+#include "third_party/opus/src/include/opus_defines.h"
+
+#if defined(OPUS_BUILD_DEFINED)
+#undef OPUS_BUILD_DEFINED
+#define OPUS_BUILD
+#endif // defined(OPUS_BUILD_DEFINED)