blob: 8261c2085e3e071e3042cd368528b773854f2a63 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001#
2# libjingle
3# Copyright 2012, Google Inc.
4#
fischman@webrtc.orge3de6b12013-08-26 19:31:21 +00005# Redistribution and use in source and binary forms, with or without
henrike@webrtc.org28e20752013-07-10 00:45:36 +00006# modification, are permitted provided that the following conditions are met:
7#
fischman@webrtc.orge3de6b12013-08-26 19:31:21 +00008# 1. Redistributions of source code must retain the above copyright notice,
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009# 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.orge3de6b12013-08-26 19:31:21 +000013# 3. The name of the author may not be used to endorse or promote products
henrike@webrtc.org28e20752013-07-10 00:45:36 +000014# 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.orge3de6b12013-08-26 19:31:21 +000017# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
henrike@webrtc.org28e20752013-07-10 00:45:36 +000018# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
fischman@webrtc.orge3de6b12013-08-26 19:31:21 +000019# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000020# 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.orge3de6b12013-08-26 19:31:21 +000023# 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.org28e20752013-07-10 00:45:36 +000025# 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.orgdd14b2a2013-08-12 18:06:29 +000032 'webrtc_root%': '<(DEPTH)/webrtc',
kjellander@webrtc.org10141012014-06-10 10:13:38 +000033 # TODO(ronghuawu): Chromium build will need a different libjingle_root.
34 'libjingle_root%': '<(DEPTH)',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000035 # TODO(ronghuawu): For now, disable the Chrome plugins, which causes a
36 # flood of chromium-style warnings.
37 'clang_use_chrome_plugins%': 0,
38 'libpeer_target_type%': 'static_library',
fischman@webrtc.orgdd14b2a2013-08-12 18:06:29 +000039 'conditions': [
40 ['OS=="android" or OS=="linux"', {
41 # TODO(henrike): make sure waterfall bots have $JAVA_HOME configured
42 # properly and remove the default value below. See issue 2113.
43 '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")',
44 }],
45 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +000046 },
47 'target_defaults': {
48 'include_dirs': [
kjellander@webrtc.org10141012014-06-10 10:13:38 +000049 '<(libjingle_root)',
kjellander@webrtc.orgcf85f1c2014-03-05 00:40:33 +000050 '<(DEPTH)',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000051 '../../third_party',
52 '../../third_party/webrtc',
henrike@webrtc.org9de257d2013-07-17 14:42:53 +000053 '../../webrtc',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000054 ],
55 'defines': [
56 'EXPAT_RELATIVE_PATH',
57 'FEATURE_ENABLE_VOICEMAIL',
58 'GTEST_RELATIVE_PATH',
59 'JSONCPP_RELATIVE_PATH',
60 'LOGGING=1',
61 'SRTP_RELATIVE_PATH',
62
63 # Feature selection
64 'FEATURE_ENABLE_SSL',
65 'FEATURE_ENABLE_VOICEMAIL',
66 'FEATURE_ENABLE_PSTN',
67 # TODO(eric): enable HAVE_NSS_SSL_H and SSL_USE_NSS once they are ready.
68 # 'HAVE_NSS_SSL_H=1',
69 'HAVE_SRTP',
70 'HAVE_WEBRTC_VIDEO',
71 'HAVE_WEBRTC_VOICE',
72 # 'SSL_USE_NSS',
73 # TODO(ronghuawu): Remove this once libjingle is updated to use the new
74 # webrtc.
75 'USE_WEBRTC_DEV_BRANCH',
76 ],
77 'conditions': [
78 # TODO(ronghuawu): Support dynamic library build.
79 ['"<(libpeer_target_type)"=="static_library"', {
80 'defines': [ 'LIBPEERCONNECTION_LIB=1' ],
81 }],
82 ['OS=="linux"', {
83 'defines': [
84 'LINUX',
85 ],
86 'conditions': [
87 ['clang==1', {
88 'cflags': [
pbos@webrtc.org174a6742014-06-02 07:58:30 +000089 '-Wall',
90 '-Wextra',
91 '-Wunused-variable',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000092 # TODO(ronghuawu): Fix the warning caused by
93 # LateBindingSymbolTable::TableInfo from
94 # latebindingsymboltable.cc.def and remove below flag.
95 '-Wno-address-of-array-temporary',
96 ],
97 }],
98 ],
99 }],
100 ['OS=="mac"', {
101 'defines': [
102 'OSX',
103 ],
104 }],
105 ['OS=="ios"', {
106 'defines': [
107 'IOS',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000108 ],
jiayl@webrtc.orga576faf2014-01-29 17:45:53 +0000109 }, {
110 'defines': [
111 'HAVE_SCTP',
fischman@webrtc.org1bc19542013-08-01 18:29:45 +0000112 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000113 }],
fischman@webrtc.orge3de6b12013-08-26 19:31:21 +0000114 ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
henrike@webrtc.org723d6832013-07-12 16:04:50 +0000115 'defines': [
116 'CARBON_DEPRECATED=YES',
117 ],
118 }],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000119 ['os_posix==1', {
fischman@webrtc.orgb25576a2014-03-26 21:53:47 +0000120 'configurations': {
121 'Debug_Base': {
122 'defines': [
123 # Chromium's build/common.gypi defines this for all posix _except_
124 # for ios & mac. We want it there as well, e.g. because ASSERT
125 # and friends trigger off of it.
126 '_DEBUG',
127 ],
128 },
129 },
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000130 'defines': [
131 'HASH_NAMESPACE=__gnu_cxx',
132 'POSIX',
133 'DISABLE_DYNAMIC_CAST',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000134 # The POSIX standard says we have to define this.
135 '_REENTRANT',
136 ],
137 }],
jiayl@webrtc.orga576faf2014-01-29 17:45:53 +0000138 # TODO(jiayl): collapse the following 5 defines into 2, one for NSS and
139 # one for OPENSSL, and update the relevant code.
140 ['use_openssl==1', {
141 'defines': [
142 'SSL_USE_OPENSSL',
143 'HAVE_OPENSSL_SSL_H',
144 ],
145 'dependencies': [
146 '<(DEPTH)/third_party/openssl/openssl.gyp:openssl',
147 ],
148 }, {
149 'defines': [
150 'SSL_USE_NSS',
151 'HAVE_NSS_SSL_H',
152 'SSL_USE_NSS_RNG',
153 ],
154 'conditions': [
155 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
156 'dependencies': [
157 '<(DEPTH)/build/linux/system.gyp:ssl',
158 ],
159 }],
160 ['OS == "mac" or OS == "ios" or OS == "win"', {
161 'dependencies': [
162 '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
163 '<(DEPTH)/third_party/nss/nss.gyp:nspr',
164 '<(DEPTH)/third_party/nss/nss.gyp:nss',
165 ],
166 }],
167 ],
168 }],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000169 ],
170 }, # target_defaults
171}