From 7351d4d698da7f163ee3a0e831b42faa92f26ebf Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Tue, 16 Sep 2014 18:48:53 +0000 Subject: [PATCH] Add a gyp target for producing a voice engine merged library. This is based on webrtc/build/merge_libs.gyp, with a dependency on voice_engine.gyp instead and suitable name changes. Executing: $ rm -rf out/ $ ./webrtc/build/gyp_webrtc -Denable_video=0 -Denable_protobuf=0 -Drelease_optimize=s webrtc/build/merge_libs_voice.gyp $ ninja -C out/Release merged_lib_voice results in a minimially sized voice engine lib at: out/Release/librtc_voice_merged.a Linux: 6.4 MB Mac: 3.7 MB R=braveyao@webrtc.org Review URL: https://webrtc-codereview.appspot.com/23659004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7199 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/build/merge_libs.gyp | 6 ++-- webrtc/build/merge_libs_voice.gyp | 48 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 webrtc/build/merge_libs_voice.gyp diff --git a/webrtc/build/merge_libs.gyp b/webrtc/build/merge_libs.gyp index d257c99168..d661002966 100644 --- a/webrtc/build/merge_libs.gyp +++ b/webrtc/build/merge_libs.gyp @@ -10,9 +10,6 @@ 'includes': ['common.gypi',], 'variables': { 'merge_libs_dependencies': [ - '../webrtc.gyp:webrtc', - '../sound/sound.gyp:rtc_sound', - '../libjingle/xmllite/xmllite.gyp:rtc_xmllite', ], }, 'targets': [ @@ -21,6 +18,9 @@ 'type': 'executable', 'dependencies': [ '<@(merge_libs_dependencies)', + '../webrtc.gyp:webrtc', + '../sound/sound.gyp:rtc_sound', + '../libjingle/xmllite/xmllite.gyp:rtc_xmllite', ], 'sources': ['no_op.cc',], }, diff --git a/webrtc/build/merge_libs_voice.gyp b/webrtc/build/merge_libs_voice.gyp new file mode 100644 index 0000000000..10e305900a --- /dev/null +++ b/webrtc/build/merge_libs_voice.gyp @@ -0,0 +1,48 @@ +# Copyright (c) 2014 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. + +{ + 'includes': ['common.gypi',], + 'variables': { + 'merge_libs_dependencies': [ + ], + }, + 'targets': [ + { + 'target_name': 'no_op_voice', + 'type': 'executable', + 'dependencies': [ + '<@(merge_libs_dependencies)', + '../voice_engine/voice_engine.gyp:voice_engine' + ], + 'sources': ['no_op.cc',], + }, + { + 'target_name': 'merged_lib_voice', + 'type': 'none', + 'dependencies': [ + 'no_op_voice', + ], + 'actions': [ + { + 'variables': { + 'output_lib_name': 'rtc_voice_merged', + 'output_lib': '<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(output_lib_name)<(STATIC_LIB_SUFFIX)', + }, + 'action_name': 'merge_libs_voice', + 'inputs': ['<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)no_op_voice<(EXECUTABLE_SUFFIX)'], + 'outputs': ['<(output_lib)'], + 'action': ['python', + 'merge_libs.py', + '<(PRODUCT_DIR)', + '<(output_lib)',], + }, + ], + }, + ], +}