Targets should not depend on protobuf when enable_protobuf=0.

BUG=webrtc:4741
R=henrik.lundin@webrtc.org, stefan@webrtc.org, ivoc@webrtc.org

Review URL: https://codereview.webrtc.org/1219333003.

Cr-Commit-Position: refs/heads/master@{#9539}
This commit is contained in:
André Susano Pinto
2015-07-03 17:53:13 +02:00
parent 894ad94302
commit 72a8cee425
2 changed files with 26 additions and 21 deletions

View File

@ -18,12 +18,14 @@
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
#include "webrtc/system_wrappers/interface/file_wrapper.h" #include "webrtc/system_wrappers/interface/file_wrapper.h"
#ifdef RTC_AUDIOCODING_DEBUG_DUMP
// Files generated at build-time by the protobuf compiler. // Files generated at build-time by the protobuf compiler.
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
#include "external/webrtc/webrtc/modules/audio_coding/dump.pb.h" #include "external/webrtc/webrtc/modules/audio_coding/dump.pb.h"
#else #else
#include "webrtc/audio_coding/dump.pb.h" #include "webrtc/audio_coding/dump.pb.h"
#endif #endif
#endif
namespace webrtc { namespace webrtc {
@ -213,13 +215,6 @@ void AcmDumpImpl::AddRecentEvent(const ACMDumpEvent& event) {
} }
} }
#endif // RTC_AUDIOCODING_DEBUG_DUMP
// AcmDump member functions.
rtc::scoped_ptr<AcmDump> AcmDump::Create() {
return rtc::scoped_ptr<AcmDump>(new AcmDumpImpl());
}
bool AcmDump::ParseAcmDump(const std::string& file_name, bool AcmDump::ParseAcmDump(const std::string& file_name,
ACMDumpEventStream* result) { ACMDumpEventStream* result) {
char tmp_buffer[1024]; char tmp_buffer[1024];
@ -236,4 +231,10 @@ bool AcmDump::ParseAcmDump(const std::string& file_name,
return result->ParseFromString(dump_buffer); return result->ParseFromString(dump_buffer);
} }
#endif // RTC_AUDIOCODING_DEBUG_DUMP
// AcmDump member functions.
rtc::scoped_ptr<AcmDump> AcmDump::Create() {
return rtc::scoped_ptr<AcmDump>(new AcmDumpImpl());
}
} // namespace webrtc } // namespace webrtc

View File

@ -78,6 +78,25 @@
'nack.h', 'nack.h',
], ],
}, },
{
'target_name': 'acm_dump',
'type': 'static_library',
'conditions': [
['enable_protobuf==1', {
'defines': ['RTC_AUDIOCODING_DEBUG_DUMP'],
'dependencies': ['acm_dump_proto'],
}
],
],
'sources': [
'acm_dump.h',
'acm_dump.cc'
],
},
],
'conditions': [
['enable_protobuf==1', {
'targets': [
{ {
'target_name': 'acm_dump_proto', 'target_name': 'acm_dump_proto',
'type': 'static_library', 'type': 'static_library',
@ -91,23 +110,8 @@
}, },
'includes': ['../../../../build/protoc.gypi',], 'includes': ['../../../../build/protoc.gypi',],
}, },
{ ]
'target_name': 'acm_dump', }],
'type': 'static_library',
'conditions': [
['enable_protobuf==1', {
'defines': ['RTC_AUDIOCODING_DEBUG_DUMP'],
}
],
],
'sources': [
'acm_dump.h',
'acm_dump.cc'
],
'dependencies': ['acm_dump_proto'],
},
],
'conditions': [
['include_tests==1', { ['include_tests==1', {
'targets': [ 'targets': [
{ {