Home | History | Annotate | Download | only in talk
      1 #
      2 # libjingle
      3 # Copyright 2012, Google Inc.
      4 #
      5 # Redistribution and use in source and binary forms, with or without
      6 # modification, are permitted provided that the following conditions are met:
      7 #
      8 #  1. Redistributions of source code must retain the above copyright notice,
      9 #     this list of conditions and the following disclaimer.
     10 #  2. Redistributions in binary form must reproduce the above copyright notice,
     11 #     this list of conditions and the following disclaimer in the documentation
     12 #     and/or other materials provided with the distribution.
     13 #  3. The name of the author may not be used to endorse or promote products
     14 #     derived from this software without specific prior written permission.
     15 #
     16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     17 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
     19 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     20 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     21 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     22 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     23 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     25 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26 #
     27 
     28 {
     29   'includes': [
     30     'build/common.gypi',
     31   ],
     32   'targets': [
     33     {
     34       'target_name': 'libjingle_xmpphelp',
     35       'type': 'static_library',
     36       'dependencies': [
     37         '<(DEPTH)/third_party/expat/expat.gyp:expat',
     38         'libjingle.gyp:libjingle',
     39         'libjingle.gyp:libjingle_p2p',
     40       ],
     41       'sources': [
     42         'xmpp/jingleinfotask.cc',
     43         'xmpp/jingleinfotask.h',
     44       ],
     45     },  # target libjingle_xmpphelp
     46     {
     47       'target_name': 'relayserver',
     48       'type': 'executable',
     49       'dependencies': [
     50         'libjingle.gyp:libjingle',
     51         'libjingle.gyp:libjingle_p2p',
     52       ],
     53       'sources': [
     54         'p2p/base/relayserver_main.cc',
     55       ],
     56     },  # target relayserver
     57     {
     58       'target_name': 'stunserver',
     59       'type': 'executable',
     60       'dependencies': [
     61         'libjingle.gyp:libjingle',
     62         'libjingle.gyp:libjingle_p2p',
     63       ],
     64       'sources': [
     65         'p2p/base/stunserver_main.cc',
     66       ],
     67     },  # target stunserver
     68     {
     69       'target_name': 'turnserver',
     70       'type': 'executable',
     71       'dependencies': [
     72         'libjingle.gyp:libjingle',
     73         'libjingle.gyp:libjingle_p2p',
     74       ],
     75       'sources': [
     76         'p2p/base/turnserver_main.cc',
     77       ],
     78     },  # target turnserver
     79     {
     80       'target_name': 'login',
     81       'type': 'executable',
     82       'dependencies': [
     83         'libjingle_xmpphelp',
     84       ],
     85       'sources': [
     86         'examples/login/login_main.cc',
     87       ],
     88     },  # target login
     89     {
     90       'target_name': 'peerconnection_server',
     91       'type': 'executable',
     92       'sources': [
     93         'examples/peerconnection/server/data_socket.cc',
     94         'examples/peerconnection/server/data_socket.h',
     95         'examples/peerconnection/server/main.cc',
     96         'examples/peerconnection/server/peer_channel.cc',
     97         'examples/peerconnection/server/peer_channel.h',
     98         'examples/peerconnection/server/utils.cc',
     99         'examples/peerconnection/server/utils.h',
    100       ],
    101       'dependencies': [
    102         'libjingle.gyp:libjingle',
    103       ],
    104       # TODO(ronghuawu): crbug.com/167187 fix size_t to int truncations.
    105       'msvs_disabled_warnings': [ 4309, ],
    106     }, # target peerconnection_server
    107   ],
    108   'conditions': [
    109     # TODO(ronghuawu): Reenable building call.
    110     # ['OS!="android"', {
    111     #   'targets': [
    112     #     {
    113     #       'target_name': 'call',
    114     #       'type': 'executable',
    115     #       'dependencies': [
    116     #         'libjingle.gyp:libjingle_p2p',
    117     #         'libjingle_xmpphelp',
    118     #       ],
    119     #       'sources': [
    120     #         'examples/call/call_main.cc',
    121     #         'examples/call/callclient.cc',
    122     #         'examples/call/callclient.h',
    123     #         'examples/call/console.cc',
    124     #         'examples/call/console.h',
    125     #         'examples/call/friendinvitesendtask.cc',
    126     #         'examples/call/friendinvitesendtask.h',
    127     #         'examples/call/mediaenginefactory.cc',
    128     #         'examples/call/mediaenginefactory.h',
    129     #         'examples/call/muc.h',
    130     #         'examples/call/mucinviterecvtask.cc',
    131     #         'examples/call/mucinviterecvtask.h',
    132     #         'examples/call/mucinvitesendtask.cc',
    133     #         'examples/call/mucinvitesendtask.h',
    134     #         'examples/call/presencepushtask.cc',
    135     #         'examples/call/presencepushtask.h',
    136     #       ],
    137     #       'conditions': [
    138     #         ['OS=="linux"', {
    139     #           'link_settings': {
    140     #             'libraries': [
    141     #               '<!@(pkg-config --libs-only-l gobject-2.0 gthread-2.0'
    142     #                   ' gtk+-2.0)',
    143     #             ],
    144     #           },
    145     #         }],
    146     #         ['OS=="win"', {
    147     #           'msvs_settings': {
    148     #             'VCLinkerTool': {
    149     #               'AdditionalDependencies': [
    150     #                 'strmiids.lib',
    151     #               ],
    152     #             },
    153     #           },
    154     #         }],
    155     #       ],  # conditions
    156     #     },  # target call
    157     #   ], # targets
    158     # }],  # OS!="android"
    159     ['OS=="linux" or OS=="win"', {
    160       'targets': [
    161         {
    162           'target_name': 'peerconnection_client',
    163           'type': 'executable',
    164           'sources': [
    165             'examples/peerconnection/client/conductor.cc',
    166             'examples/peerconnection/client/conductor.h',
    167             'examples/peerconnection/client/defaults.cc',
    168             'examples/peerconnection/client/defaults.h',
    169             'examples/peerconnection/client/peer_connection_client.cc',
    170             'examples/peerconnection/client/peer_connection_client.h',
    171           ],
    172           'dependencies': [
    173             '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
    174             'libjingle.gyp:libjingle_peerconnection',
    175           ],
    176           'conditions': [
    177             # TODO(ronghuawu): Move these files to a win/ directory then they
    178             # can be excluded automatically.
    179             ['OS=="win"', {
    180               'sources': [
    181                 'examples/peerconnection/client/flagdefs.h',
    182                 'examples/peerconnection/client/main.cc',
    183                 'examples/peerconnection/client/main_wnd.cc',
    184                 'examples/peerconnection/client/main_wnd.h',
    185               ],
    186               'msvs_settings': {
    187                 'VCLinkerTool': {
    188                  'SubSystem': '2',  # Windows
    189                 },
    190               },
    191             }],  # OS=="win"
    192             ['OS=="linux"', {
    193               'sources': [
    194                 'examples/peerconnection/client/linux/main.cc',
    195                 'examples/peerconnection/client/linux/main_wnd.cc',
    196                 'examples/peerconnection/client/linux/main_wnd.h',
    197               ],
    198               'cflags': [
    199                 '<!@(pkg-config --cflags glib-2.0 gobject-2.0 gtk+-2.0)',
    200               ],
    201               'link_settings': {
    202                 'ldflags': [
    203                   '<!@(pkg-config --libs-only-L --libs-only-other glib-2.0'
    204                       ' gobject-2.0 gthread-2.0 gtk+-2.0)',
    205                 ],
    206                 'libraries': [
    207                   '<!@(pkg-config --libs-only-l glib-2.0 gobject-2.0'
    208                       ' gthread-2.0 gtk+-2.0)',
    209                   '-lX11',
    210                   '-lXcomposite',
    211                   '-lXext',
    212                   '-lXrender',
    213                 ],
    214               },
    215             }],  # OS=="linux"
    216           ],  # conditions
    217         },  # target peerconnection_client
    218       ], # targets
    219     }],  # OS=="linux" or OS=="win"
    220 
    221     ['libjingle_objc==1 and OS=="ios"', {
    222       'targets': [
    223         {
    224           'target_name': 'AppRTCDemo',
    225           'type': 'executable',
    226           'product_name': 'AppRTCDemo',
    227           'mac_bundle': 1,
    228           'mac_bundle_resources': [
    229             'examples/ios/AppRTCDemo/ResourceRules.plist',
    230             'examples/ios/AppRTCDemo/en.lproj/APPRTCViewController.xib',
    231             'examples/ios/AppRTCDemo/ios_channel.html',
    232             'examples/ios/Icon.png',
    233           ],
    234           'dependencies': [
    235             'libjingle.gyp:libjingle_peerconnection_objc',
    236           ],
    237           'conditions': [
    238             ['target_arch=="ia32"', {
    239               'dependencies' : [
    240                 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
    241               ],
    242             }],
    243           ],
    244           'sources': [
    245             'examples/ios/AppRTCDemo/APPRTCAppClient.h',
    246             'examples/ios/AppRTCDemo/APPRTCAppClient.m',
    247             'examples/ios/AppRTCDemo/APPRTCAppDelegate.h',
    248             'examples/ios/AppRTCDemo/APPRTCAppDelegate.m',
    249             'examples/ios/AppRTCDemo/APPRTCViewController.h',
    250             'examples/ios/AppRTCDemo/APPRTCViewController.m',
    251             'examples/ios/AppRTCDemo/AppRTCDemo-Prefix.pch',
    252             'examples/ios/AppRTCDemo/GAEChannelClient.h',
    253             'examples/ios/AppRTCDemo/GAEChannelClient.m',
    254             'examples/ios/AppRTCDemo/main.m',
    255           ],
    256           'xcode_settings': {
    257             'CLANG_ENABLE_OBJC_ARC': 'YES',
    258             'INFOPLIST_FILE': 'examples/ios/AppRTCDemo/Info.plist',
    259             'OTHER_LDFLAGS': [
    260               '-framework Foundation',
    261               '-framework UIKit',
    262             ],
    263           },
    264           'postbuilds': [
    265             {
    266               # Ideally app signing would be a part of gyp.
    267               # Delete if/when that comes to pass.
    268               'postbuild_name': 'Sign AppRTCDemo',
    269               'variables': {
    270                 'variables': {
    271                   'key_id%': '<!(security find-identity -p codesigning -v | grep "iPhone Developer" | awk \'{print $2}\')',
    272                 },
    273                 'key_id%': '<(key_id)',
    274                 # Total HACK to give a more informative message when multiple
    275                 # codesigning keys are present in the default keychain.  Ideally
    276                 # we could pick more intelligently among the keys, but as a
    277                 # first cut just tell the developer to specify a key identity
    278                 # explicitly.
    279                 'ensure_single_key': '<!(python -c "assert len(\'\'\'<(key_id)\'\'\') > 0 and \'\\n\' not in \'\'\'<(key_id)\'\'\', \'key_id gyp variable needs to be set explicitly because there are multiple codesigning keys, or none!\'")',
    280               },
    281               'action': [
    282                 '/usr/bin/codesign', '-v', '--force', '--sign', '<(key_id)',
    283                 '${BUILT_PRODUCTS_DIR}/AppRTCDemo.app',
    284               ],
    285             },
    286           ],
    287         },  # target AppRTCDemo
    288       ],  # targets
    289     }],  # libjingle_objc==1
    290 
    291     ['OS=="android"', {
    292       'targets': [
    293         {
    294           'target_name': 'AppRTCDemo',
    295           'type': 'none',
    296           'dependencies': [
    297             'libjingle.gyp:libjingle_peerconnection_jar',
    298           ],
    299           'actions': [
    300             {
    301               # TODO(fischman): convert from a custom script to a standard gyp
    302               # apk build once chromium's apk-building gyp machinery can be used
    303               # (http://crbug.com/225101)
    304               'action_name': 'build_apprtcdemo_apk',
    305               'inputs' : [
    306                 '<(PRODUCT_DIR)/libjingle_peerconnection.jar',
    307                 '<(PRODUCT_DIR)/libjingle_peerconnection_so.so',
    308                 'examples/android/AndroidManifest.xml',
    309                 'examples/android/README',
    310                 'examples/android/ant.properties',
    311                 'examples/android/assets/channel.html',
    312                 'examples/android/build.xml',
    313                 'examples/android/jni/Android.mk',
    314                 'examples/android/project.properties',
    315                 'examples/android/res/drawable-hdpi/ic_launcher.png',
    316                 'examples/android/res/drawable-ldpi/ic_launcher.png',
    317                 'examples/android/res/drawable-mdpi/ic_launcher.png',
    318                 'examples/android/res/drawable-xhdpi/ic_launcher.png',
    319                 'examples/android/res/values/strings.xml',
    320                 'examples/android/src/org/appspot/apprtc/AppRTCClient.java',
    321                 'examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java',
    322                 'examples/android/src/org/appspot/apprtc/FramePool.java',
    323                 'examples/android/src/org/appspot/apprtc/GAEChannelClient.java',
    324                 'examples/android/src/org/appspot/apprtc/VideoStreamsView.java',
    325               ],
    326               'outputs': [
    327                 '<(PRODUCT_DIR)/AppRTCDemo-debug.apk',
    328               ],
    329               'action': [
    330                 'bash', '-ec',
    331                 'rm -fr <(_outputs) examples/android/{bin,libs} && '
    332                 'mkdir -p examples/android/libs/<(android_app_abi) && '
    333                 'cp <(PRODUCT_DIR)/libjingle_peerconnection.jar examples/android/libs/ &&'
    334                 '<(android_strip) -o examples/android/libs/<(android_app_abi)/libjingle_peerconnection_so.so  <(PRODUCT_DIR)/libjingle_peerconnection_so.so &&'
    335                 'cd examples/android && '
    336                 'ant debug && '
    337                 'cd - && '
    338                 'cp examples/android/bin/AppRTCDemo-debug.apk <(_outputs)'
    339               ],
    340             },
    341           ],
    342         },  # target AppRTCDemo
    343       ],  # targets
    344     }],  # OS=="android"
    345   ],
    346 }
    347