common.gypi revision 23725e09c6533739afa67ca9694f6fa874c26279
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# This file contains common settings for building libjingle components. 29 30{ 31 'variables': { 32 'webrtc_root%': '<(DEPTH)/webrtc', 33 'libjingle_tests_additional_deps%': [], 34 # TODO(ronghuawu): For now, disable the Chrome plugins, which causes a 35 # flood of chromium-style warnings. 36 'clang_use_chrome_plugins%': 0, 37 'conditions': [ 38 ['OS=="android" or OS=="linux"', { 39 'java_home%': '<!(python -c "import os; dir=os.getenv(\'JAVA_HOME\', \'/usr/lib/jvm/java-7-openjdk-amd64\'); assert os.path.exists(os.path.join(dir, \'include/jni.h\')), \'Point \\$JAVA_HOME or the java_home gyp variable to a directory containing include/jni.h!\'; print dir")', 40 }], 41 ], 42 # Disable these to not build components which can be externally provided. 43 'build_expat%': 1, 44 'build_json%': 1, 45 'build_libsrtp%': 1, 46 'build_libyuv%': 1, 47 'build_usrsctp%': 1, 48 # Make it possible to provide custom locations for some libraries. 49 'libyuv_dir%': '<(DEPTH)/third_party/libyuv', 50 51 # Disable this to skip building source requiring GTK. 52 'use_gtk%': 1, 53 }, 54 'target_defaults': { 55 'include_dirs': [ 56 '<(DEPTH)', 57 '../..', 58 '../../third_party', 59 '../../third_party/webrtc', 60 '../../webrtc', 61 ], 62 'defines': [ 63 'EXPAT_RELATIVE_PATH', 64 'FEATURE_ENABLE_VOICEMAIL', 65 'GTEST_RELATIVE_PATH', 66 'JSONCPP_RELATIVE_PATH', 67 'LOGGING=1', 68 'SRTP_RELATIVE_PATH', 69 70 # Feature selection 71 'FEATURE_ENABLE_SSL', 72 'FEATURE_ENABLE_VOICEMAIL', 73 'FEATURE_ENABLE_PSTN', 74 'HAVE_SCTP', 75 'HAVE_SRTP', 76 'HAVE_WEBRTC_VIDEO', 77 'HAVE_WEBRTC_VOICE', 78 ], 79 'conditions': [ 80 ['OS=="linux"', { 81 'defines': [ 82 'LINUX', 83 'WEBRTC_LINUX', 84 ], 85 # Remove Chromium's disabling of the -Wformat warning. 86 'cflags!': [ 87 '-Wno-format', 88 ], 89 'conditions': [ 90 ['clang==1', { 91 'cflags': [ 92 '-Wall', 93 '-Wextra', 94 '-Wformat', 95 '-Wformat-security', 96 '-Wimplicit-fallthrough', 97 '-Wmissing-braces', 98 '-Wreorder', 99 '-Wunused-variable', 100 # TODO(ronghuawu): Fix the warning caused by 101 # LateBindingSymbolTable::TableInfo from 102 # latebindingsymboltable.cc.def and remove below flag. 103 '-Wno-address-of-array-temporary', 104 '-Wthread-safety', 105 ], 106 'cflags_cc': [ 107 '-Wunused-private-field', 108 ], 109 }], 110 ], 111 }], 112 ['OS=="mac"', { 113 'defines': [ 114 'OSX', 115 'WEBRTC_MAC', 116 ], 117 }], 118 ['OS=="win"', { 119 'defines': [ 120 'WEBRTC_WIN', 121 ], 122 'msvs_disabled_warnings': [ 123 # https://code.google.com/p/chromium/issues/detail?id=372451#c20 124 # Warning 4702 ("Unreachable code") should be re-enabled once 125 # users are updated to VS2013 Update 2. 126 4702, 127 ], 128 }], 129 ['OS=="ios"', { 130 'defines': [ 131 'IOS', 132 'WEBRTC_MAC', 133 'WEBRTC_IOS', 134 ], 135 }], 136 ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', { 137 'defines': [ 138 'CARBON_DEPRECATED=YES', 139 ], 140 }], 141 ['os_posix==1', { 142 'configurations': { 143 'Debug_Base': { 144 'defines': [ 145 # Chromium's build/common.gypi defines this for all posix _except_ 146 # for ios & mac. We want it there as well, e.g. because ASSERT 147 # and friends trigger off of it. 148 '_DEBUG', 149 ], 150 }, 151 }, 152 'defines': [ 153 'HASH_NAMESPACE=__gnu_cxx', 154 'WEBRTC_POSIX', 155 'DISABLE_DYNAMIC_CAST', 156 # The POSIX standard says we have to define this. 157 '_REENTRANT', 158 ], 159 }], 160 ], 161 }, # target_defaults 162} 163