Chromium Code Reviews| Index: third_party/opus/opus.gyp |
| diff --git a/third_party/opus/opus.gyp b/third_party/opus/opus.gyp |
| index 5fdeea6e230ea7176fcf06f392a8bf27107c2d58..1ee104d71332d0f88f4704db40bc5a1c89c87481 100644 |
| --- a/third_party/opus/opus.gyp |
| +++ b/third_party/opus/opus.gyp |
| @@ -31,6 +31,33 @@ |
| }], |
| ], |
| }, |
| + 'target_defaults': { |
| + 'target_conditions': [ |
| + ['_type=="executable"', { |
| + # All of the executable targets depend on 'opus'. Unfortunately the |
| + # 'dependencies' block cannot be inherited via 'target_defaults'. |
| + 'include_dirs': [ |
| + 'src/celt', |
| + 'src/silk', |
| + ], |
| + 'conditions': [ |
| + ['OS == "win"', { |
| + 'defines': [ |
| + 'inline=__inline', |
| + ], |
| + }], |
| + ['OS=="android"', { |
| + 'libraries': [ |
| + '-llog', |
| + ], |
| + }], |
| + ['clang==1', { |
| + 'cflags': [ '-Wno-absolute-value' ], |
| + }] |
| + ], |
| + }], |
| + ], |
| + }, |
| 'targets': [ |
| { |
| 'target_name': 'opus', |
| @@ -151,30 +178,9 @@ |
| 'dependencies': [ |
| 'opus' |
| ], |
| - 'conditions': [ |
| - ['OS == "win"', { |
| - 'defines': [ |
| - 'inline=__inline', |
| - ], |
| - }], |
| - ['OS=="android"', { |
| - 'link_settings': { |
| - 'libraries': [ |
| - '-llog', |
| - ], |
| - }, |
| - }], |
| - ['clang==1', { |
| - 'cflags': [ '-Wno-absolute-value' ], |
| - }] |
| - ], |
| 'sources': [ |
| 'src/src/opus_compare.c', |
| ], |
| - 'include_dirs': [ |
| - 'src/celt', |
| - 'src/silk', |
| - ], |
| }, # target opus_compare |
| { |
| 'target_name': 'opus_demo', |
| @@ -182,30 +188,63 @@ |
| 'dependencies': [ |
| 'opus' |
| ], |
| + 'sources': [ |
| + 'src/src/opus_demo.c', |
| + ], |
| + }, # target opus_demo |
| + { |
| + 'target_name': 'test_opus_api', |
| + 'type': 'executable', |
| + 'dependencies': [ |
| + 'opus' |
| + ], |
| + 'sources': [ |
| + 'src/tests/test_opus_api.c', |
| + ], |
| + }, # target test_opus_api |
| + { |
| + 'target_name': 'test_opus_encode', |
| + 'type': 'executable', |
| + 'dependencies': [ |
| + 'opus' |
| + ], |
| + 'sources': [ |
| + 'src/tests/test_opus_encode.c', |
| + ], |
| + }, # target test_opus_encode |
| + { |
| + 'target_name': 'test_opus_decode', |
| + 'type': 'executable', |
| + 'dependencies': [ |
| + 'opus' |
| + ], |
| + 'sources': [ |
| + 'src/tests/test_opus_decode.c', |
| + ], |
| + # test_opus_decode passes a null pointer to opus_decode() for an argument |
| + # marked as requiring a non-null value by the nonnull function attribute, |
| + # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid |
| + # a compilation error if -Werror is specified. |
| 'conditions': [ |
| - ['OS == "win"', { |
| - 'defines': [ |
| - 'inline=__inline', |
| - ], |
| + ['os_posix==1 and OS!="mac" and OS!="ios"', { |
| + 'cflags': ['-Wno-nonnull'], |
|
Sergey Ulanov
2015/02/02 19:04:38
Does this work with both gcc and clang?
wtc
2015/02/02 21:45:47
Yes, -Wnonnull and -Wno-nonnull work with both gcc
|
| }], |
| - ['OS=="android"', { |
| - 'link_settings': { |
| - 'libraries': [ |
| - '-llog', |
| - ], |
| + ['OS=="mac" or OS=="ios"', { |
| + 'xcode_settings': { |
| + 'WARNING_CFLAGS': ['-Wno-nonnull'], |
|
Sergey Ulanov
2015/02/02 19:04:38
Why do we need this in xcode_settings, but not in
wtc
2015/02/02 21:45:47
This is a limitation of GYP. On Mac, xcode_setting
wtc
2015/02/02 21:47:21
I forgot to add that Mark Mentovai confirmed this
|
| }, |
| }], |
| - ['clang==1', { |
| - 'cflags': [ '-Wno-absolute-value' ], |
| - }] |
| ], |
| - 'sources': [ |
| - 'src/src/opus_demo.c', |
| + }, # target test_opus_decode |
| + { |
| + 'target_name': 'test_opus_padding', |
| + 'type': 'executable', |
| + 'dependencies': [ |
| + 'opus' |
| ], |
| - 'include_dirs': [ |
| - 'src/celt', |
| - 'src/silk', |
| + 'sources': [ |
| + 'src/tests/test_opus_padding.c', |
| ], |
| - }, # target opus_demo |
| + }, # target test_opus_padding |
| ] |
| } |