Skip to content

Commit

Permalink
Template build, need to create proper webrtcjingle.gyp that works for…
Browse files Browse the repository at this point in the history
… building our project
  • Loading branch information
lukeweber committed Jul 23, 2012
1 parent d899d4a commit ea69294
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 1 deletion.
15 changes: 15 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ deps = {
"https://github.com/lukeweber/gyp-override.git@2b02678d",
}


hooks = [

{
# Create a supplement.gypi file under trunk/src. This file will be picked
# up by gyp and used to enable the standalone build.
"pattern": ".",
"action": ["python", "trunk/tools/create_supplement_gypi.py", "trunk/src/supplement.gypi"],
},
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
"pattern": ".",
"action": ["python", "trunk/build/gyp_chromium", "--depth=trunk", "trunk/webrtcjingle.gyp"],
},
]
# "trunk/third_party/yasm/source/patched-yasm":
# From("trunk/chromium_deps", "src/third_party/yasm/source/patched-yasm"),
# libjingle deps.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# gclient sync
# cd trunk
# export CHROME_SRC=`pwd`
# source build/android/envsetup.sh
# gclient runhooks
# make
```
```
26 changes: 26 additions & 0 deletions tools/create_supplement_gypi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# Copyright (c) 2012 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.

import sys

supplement_gypi = """#!/usr/bin/env python
# This file is generated by %s. Not for check-in.
# Please see the WebRTC DEPS file for details.
{
'variables': {
'build_with_chromium': 0,
}
}
"""

def main(argv):
open(argv[1], 'w').write(supplement_gypi % argv[0])

if __name__ == '__main__':
sys.exit(main(sys.argv))
113 changes: 113 additions & 0 deletions webrtcjingle.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Copyright (c) 2012 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': [ 'third_party/webrtc/build/common.gypi', ],
'variables': {
'peerconnection_sample': 'third_party/libjingle/source/talk/examples/peerconnection',
},

'targets': [
{
'target_name': 'peerconnection_server',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/server/data_socket.cc',
'<(peerconnection_sample)/server/data_socket.h',
'<(peerconnection_sample)/server/main.cc',
'<(peerconnection_sample)/server/peer_channel.cc',
'<(peerconnection_sample)/server/peer_channel.h',
'<(peerconnection_sample)/server/utils.cc',
'<(peerconnection_sample)/server/utils.h',
],
'include_dirs': [
'third_party/libjingle/source',
],
},
],
'conditions': [
['OS=="win"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/client/conductor.cc',
'<(peerconnection_sample)/client/conductor.h',
'<(peerconnection_sample)/client/defaults.cc',
'<(peerconnection_sample)/client/defaults.h',
'<(peerconnection_sample)/client/main.cc',
'<(peerconnection_sample)/client/main_wnd.cc',
'<(peerconnection_sample)/client/main_wnd.h',
'<(peerconnection_sample)/client/peer_connection_client.cc',
'<(peerconnection_sample)/client/peer_connection_client.h',
'third_party/libjingle/source/talk/base/win32socketinit.cc',
'third_party/libjingle/source/talk/base/win32socketserver.cc',
],
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '2', # Windows
},
},
'dependencies': [
'third_party/libjingle/libjingle.gyp:libjingle_peerconnection',
],
'include_dirs': [
'src',
'src/modules/interface',
'third_party/libjingle/source',
],
},
], # targets
}, ], # OS="win"
['OS=="linux"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/client/conductor.cc',
'<(peerconnection_sample)/client/conductor.h',
'<(peerconnection_sample)/client/defaults.cc',
'<(peerconnection_sample)/client/defaults.h',
'<(peerconnection_sample)/client/linux/main.cc',
'<(peerconnection_sample)/client/linux/main_wnd.cc',
'<(peerconnection_sample)/client/linux/main_wnd.h',
'<(peerconnection_sample)/client/peer_connection_client.cc',
'<(peerconnection_sample)/client/peer_connection_client.h',
],
'dependencies': [
'third_party/libjingle/libjingle.gyp:libjingle_peerconnection',
# TODO(tommi): Switch to this and remove specific gtk dependency
# sections below for cflags and link_settings.
# '<(DEPTH)/build/linux/system.gyp:gtk',
],
'include_dirs': [
'src',
'src/modules/interface',
'third_party/libjingle/source',
],
'cflags': [
'<!@(pkg-config --cflags gtk+-2.0)',
],
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)',
],
'libraries': [
'<!@(pkg-config --libs-only-l gtk+-2.0 gthread-2.0)',
'-lX11',
'-lXext',
],
},
},
], # targets
}, ], # OS="linux"
],

}

0 comments on commit ea69294

Please sign in to comment.