henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | # |
| 2 | # libjingle |
| 3 | # Copyright 2012, Google Inc. |
| 4 | # |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 5 | # Redistribution and use in source and binary forms, with or without |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 6 | # modification, are permitted provided that the following conditions are met: |
| 7 | # |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 8 | # 1. Redistributions of source code must retain the above copyright notice, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 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. |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 13 | # 3. The name of the author may not be used to endorse or promote products |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 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 |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 18 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 19 | # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 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, |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 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 |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | # |
| 27 | |
| 28 | # This file contains common settings for building libjingle components. |
| 29 | |
| 30 | { |
| 31 | 'variables': { |
fischman@webrtc.org | dd14b2a | 2013-08-12 18:06:29 +0000 | [diff] [blame] | 32 | 'webrtc_root%': '<(DEPTH)/webrtc', |
kjellander@webrtc.org | 1014101 | 2014-06-10 10:13:38 +0000 | [diff] [blame] | 33 | # TODO(ronghuawu): Chromium build will need a different libjingle_root. |
buildbot@webrtc.org | 55535d4 | 2014-07-08 18:18:55 +0000 | [diff] [blame] | 34 | 'libjingle_tests_additional_deps%': [], |
kjellander@webrtc.org | 1014101 | 2014-06-10 10:13:38 +0000 | [diff] [blame] | 35 | 'libjingle_root%': '<(DEPTH)', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 36 | # TODO(ronghuawu): For now, disable the Chrome plugins, which causes a |
| 37 | # flood of chromium-style warnings. |
| 38 | 'clang_use_chrome_plugins%': 0, |
| 39 | 'libpeer_target_type%': 'static_library', |
fischman@webrtc.org | dd14b2a | 2013-08-12 18:06:29 +0000 | [diff] [blame] | 40 | 'conditions': [ |
| 41 | ['OS=="android" or OS=="linux"', { |
| 42 | # TODO(henrike): make sure waterfall bots have $JAVA_HOME configured |
| 43 | # properly and remove the default value below. See issue 2113. |
| 44 | 'java_home%': '<!(python -c "import os; dir=os.getenv(\'JAVA_HOME\', \'/usr/lib/jvm/java-6-sun\'); 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")', |
| 45 | }], |
| 46 | ], |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 47 | }, |
| 48 | 'target_defaults': { |
| 49 | 'include_dirs': [ |
kjellander@webrtc.org | 1014101 | 2014-06-10 10:13:38 +0000 | [diff] [blame] | 50 | '<(libjingle_root)', |
kjellander@webrtc.org | cf85f1c | 2014-03-05 00:40:33 +0000 | [diff] [blame] | 51 | '<(DEPTH)', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 52 | '../../third_party', |
| 53 | '../../third_party/webrtc', |
henrike@webrtc.org | 9de257d | 2013-07-17 14:42:53 +0000 | [diff] [blame] | 54 | '../../webrtc', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 55 | ], |
| 56 | 'defines': [ |
| 57 | 'EXPAT_RELATIVE_PATH', |
| 58 | 'FEATURE_ENABLE_VOICEMAIL', |
| 59 | 'GTEST_RELATIVE_PATH', |
| 60 | 'JSONCPP_RELATIVE_PATH', |
| 61 | 'LOGGING=1', |
| 62 | 'SRTP_RELATIVE_PATH', |
| 63 | |
| 64 | # Feature selection |
| 65 | 'FEATURE_ENABLE_SSL', |
| 66 | 'FEATURE_ENABLE_VOICEMAIL', |
| 67 | 'FEATURE_ENABLE_PSTN', |
| 68 | # TODO(eric): enable HAVE_NSS_SSL_H and SSL_USE_NSS once they are ready. |
| 69 | # 'HAVE_NSS_SSL_H=1', |
tkchin@webrtc.org | b038c72 | 2014-07-14 20:24:09 +0000 | [diff] [blame] | 70 | 'HAVE_SCTP', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 71 | 'HAVE_SRTP', |
| 72 | 'HAVE_WEBRTC_VIDEO', |
| 73 | 'HAVE_WEBRTC_VOICE', |
| 74 | # 'SSL_USE_NSS', |
| 75 | # TODO(ronghuawu): Remove this once libjingle is updated to use the new |
| 76 | # webrtc. |
| 77 | 'USE_WEBRTC_DEV_BRANCH', |
| 78 | ], |
| 79 | 'conditions': [ |
| 80 | # TODO(ronghuawu): Support dynamic library build. |
| 81 | ['"<(libpeer_target_type)"=="static_library"', { |
| 82 | 'defines': [ 'LIBPEERCONNECTION_LIB=1' ], |
| 83 | }], |
| 84 | ['OS=="linux"', { |
| 85 | 'defines': [ |
| 86 | 'LINUX', |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame^] | 87 | 'WEBRTC_LINUX', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 88 | ], |
| 89 | 'conditions': [ |
| 90 | ['clang==1', { |
| 91 | 'cflags': [ |
pbos@webrtc.org | 174a674 | 2014-06-02 07:58:30 +0000 | [diff] [blame] | 92 | '-Wall', |
| 93 | '-Wextra', |
| 94 | '-Wunused-variable', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 95 | # TODO(ronghuawu): Fix the warning caused by |
| 96 | # LateBindingSymbolTable::TableInfo from |
| 97 | # latebindingsymboltable.cc.def and remove below flag. |
| 98 | '-Wno-address-of-array-temporary', |
| 99 | ], |
| 100 | }], |
| 101 | ], |
| 102 | }], |
| 103 | ['OS=="mac"', { |
| 104 | 'defines': [ |
| 105 | 'OSX', |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame^] | 106 | 'WEBRTC_MAC', |
| 107 | ], |
| 108 | }], |
| 109 | ['OS=="win"', { |
| 110 | 'defines': [ |
| 111 | 'WEBRTC_WIN', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 112 | ], |
| 113 | }], |
| 114 | ['OS=="ios"', { |
| 115 | 'defines': [ |
| 116 | 'IOS', |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame^] | 117 | 'WEBRTC_MAC', |
| 118 | 'WEBRTC_IOS', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 119 | ], |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 120 | }], |
fischman@webrtc.org | e3de6b1 | 2013-08-26 19:31:21 +0000 | [diff] [blame] | 121 | ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', { |
henrike@webrtc.org | 723d683 | 2013-07-12 16:04:50 +0000 | [diff] [blame] | 122 | 'defines': [ |
| 123 | 'CARBON_DEPRECATED=YES', |
| 124 | ], |
| 125 | }], |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 126 | ['os_posix==1', { |
fischman@webrtc.org | b25576a | 2014-03-26 21:53:47 +0000 | [diff] [blame] | 127 | 'configurations': { |
| 128 | 'Debug_Base': { |
| 129 | 'defines': [ |
| 130 | # Chromium's build/common.gypi defines this for all posix _except_ |
| 131 | # for ios & mac. We want it there as well, e.g. because ASSERT |
| 132 | # and friends trigger off of it. |
| 133 | '_DEBUG', |
| 134 | ], |
| 135 | }, |
| 136 | }, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 137 | 'defines': [ |
| 138 | 'HASH_NAMESPACE=__gnu_cxx', |
| 139 | 'POSIX', |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame^] | 140 | 'WEBRTC_POSIX', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 141 | 'DISABLE_DYNAMIC_CAST', |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 142 | # The POSIX standard says we have to define this. |
| 143 | '_REENTRANT', |
| 144 | ], |
| 145 | }], |
jiayl@webrtc.org | a576faf | 2014-01-29 17:45:53 +0000 | [diff] [blame] | 146 | # TODO(jiayl): collapse the following 5 defines into 2, one for NSS and |
| 147 | # one for OPENSSL, and update the relevant code. |
| 148 | ['use_openssl==1', { |
| 149 | 'defines': [ |
| 150 | 'SSL_USE_OPENSSL', |
| 151 | 'HAVE_OPENSSL_SSL_H', |
| 152 | ], |
| 153 | 'dependencies': [ |
| 154 | '<(DEPTH)/third_party/openssl/openssl.gyp:openssl', |
| 155 | ], |
| 156 | }, { |
| 157 | 'defines': [ |
| 158 | 'SSL_USE_NSS', |
| 159 | 'HAVE_NSS_SSL_H', |
| 160 | 'SSL_USE_NSS_RNG', |
| 161 | ], |
| 162 | 'conditions': [ |
| 163 | ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { |
| 164 | 'dependencies': [ |
| 165 | '<(DEPTH)/build/linux/system.gyp:ssl', |
| 166 | ], |
| 167 | }], |
| 168 | ['OS == "mac" or OS == "ios" or OS == "win"', { |
| 169 | 'dependencies': [ |
| 170 | '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl', |
| 171 | '<(DEPTH)/third_party/nss/nss.gyp:nspr', |
| 172 | '<(DEPTH)/third_party/nss/nss.gyp:nss', |
| 173 | ], |
| 174 | }], |
| 175 | ], |
| 176 | }], |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 177 | ], |
| 178 | }, # target_defaults |
| 179 | } |