OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/crypto.gni") |
| 6 |
| 7 declare_args() { |
| 8 libjingle_source = "source" |
| 9 libpeer_target_type = "static_library" |
| 10 } |
| 11 |
| 12 # From third_party/libjingle/libjingle.gyp's target_defaults. |
| 13 config("jingle_unexported_configs") { |
| 14 defines = [ |
| 15 "EXPAT_RELATIVE_PATH", |
| 16 "FEATURE_ENABLE_SSL", |
| 17 "GTEST_RELATIVE_PATH", |
| 18 "HAVE_SRTP", |
| 19 "HAVE_WEBRTC_VIDEO", |
| 20 "HAVE_WEBRTC_VOICE", |
| 21 "LOGGING_INSIDE_WEBRTC", |
| 22 "NO_MAIN_THREAD_WRAPPING", |
| 23 "NO_SOUND_SYSTEM", |
| 24 "SRTP_RELATIVE_PATH", |
| 25 "USE_WEBRTC_DEV_BRANCH", |
| 26 "ENABLE_EXTERNAL_AUTH", |
| 27 ] |
| 28 |
| 29 include_dirs = [ |
| 30 "overrides", |
| 31 "../../third_party/webrtc/overrides", |
| 32 "${libjingle_source}", |
| 33 "../../testing/gtest/include", |
| 34 "../../third_party", |
| 35 "../../third_party/libyuv/include", |
| 36 "../../third_party/usrsctp", |
| 37 ] |
| 38 |
| 39 if ("${libpeer_target_type}" == "static_library") { |
| 40 defines += [ "LIBPEERCONNECTION_LIB=1" ] |
| 41 } |
| 42 |
| 43 if (is_win && cpu_arch == "x86") { |
| 44 defines += [ "_USE_32BIT_TIME_T" ] |
| 45 } |
| 46 |
| 47 if (use_openssl) { |
| 48 defines += [ |
| 49 "SSL_USE_OPENSSL", |
| 50 "HAVE_OPENSSL_SSL_H", |
| 51 ] |
| 52 } else { |
| 53 defines += [ |
| 54 "SSL_USE_NSS", |
| 55 "HAVE_NSS_SSL_H", |
| 56 "SSL_USE_NSS_RNG", |
| 57 ] |
| 58 } |
| 59 |
| 60 } |
| 61 |
| 62 # From third_party/libjingle/libjingle.gyp's target_defaults. |
| 63 config("jingle_direct_dependent_configs") { |
| 64 include_dirs = [ |
| 65 "../../third_party/webrtc/overrides", |
| 66 "overrides", |
| 67 "${libjingle_source}", |
| 68 "../../testing/gtest/include", |
| 69 "../../third_party", |
| 70 ] |
| 71 defines = [ |
| 72 "FEATURE_ENABLE_SSL", |
| 73 "FEATURE_ENABLE_VOICEMAIL", |
| 74 "EXPAT_RELATIVE_PATH", |
| 75 "GTEST_RELATIVE_PATH", |
| 76 "NO_MAIN_THREAD_WRAPPING", |
| 77 "NO_SOUND_SYSTEM", |
| 78 ] |
| 79 # TODO(GYP): Port is_win blocks. |
| 80 if (is_linux) { |
| 81 defines += [ "LINUX", "WEBRTC_LINUX" ] |
| 82 } |
| 83 if (is_mac) { |
| 84 defines += [ "OSX", "WEBRTC_MAC" ] |
| 85 } |
| 86 if (is_ios) { |
| 87 defines += [ "IOS", "WEBRTC_MAC", "WEBRTC_IOS" ] |
| 88 } |
| 89 if (is_win) { |
| 90 defines += [ "WEBRTC_WIN" ] |
| 91 } |
| 92 if (is_android) { |
| 93 defines += [ "ANDROID" ] |
| 94 } |
| 95 if (is_posix) { |
| 96 defines += [ "POSIX", "WEBRTC_POSIX" ] |
| 97 } |
| 98 # TODO(GYP): Support these in GN. |
| 99 # if (is_bsd) { |
| 100 # defines += [ "BSD" ] |
| 101 # } |
| 102 # if (is_openbsd) { |
| 103 # defines += [ "OPENBSD" ] |
| 104 # } |
| 105 # if (is_freebsd) { |
| 106 # defines += [ "FREEBSD" ] |
| 107 # } |
| 108 if (is_chromeos) { |
| 109 defines += [ "CHROMEOS" ] |
| 110 } |
| 111 } |
| 112 |
| 113 # From third_party/libjingle/libjingle.gyp's target_defaults. |
| 114 config("jingle_all_dependent_configs") { |
| 115 if (is_debug) { |
| 116 # TODO(sergeyu): Fix libjingle to use NDEBUG instead of |
| 117 # _DEBUG and remove this define. See GYP file as well. |
| 118 defines = [ "_DEBUG" ] |
| 119 } |
| 120 } |
| 121 |
| 122 # From third_party/libjingle/libjingle.gyp's target_defaults. |
| 123 group("jingle_deps") { |
| 124 deps = [ |
| 125 "//base", |
| 126 "//net", |
| 127 "//third_party/expat", |
| 128 "//crypto:platform", |
| 129 ] |
| 130 forward_dependent_configs_from = [ |
| 131 "//third_party/expat", |
| 132 ] |
| 133 } |
| 134 |
| 135 # GYP version: third_party/libjingle.gyp:libjingle |
| 136 static_library("libjingle") { |
| 137 sources = [ |
| 138 # List from third_party/libjingle/libjingle_common.gypi |
| 139 "${libjingle_source}/talk/p2p/base/asyncstuntcpsocket.cc", |
| 140 "${libjingle_source}/talk/p2p/base/asyncstuntcpsocket.h", |
| 141 "${libjingle_source}/talk/p2p/base/basicpacketsocketfactory.cc", |
| 142 "${libjingle_source}/talk/p2p/base/basicpacketsocketfactory.h", |
| 143 "${libjingle_source}/talk/p2p/base/candidate.h", |
| 144 "${libjingle_source}/talk/p2p/base/common.h", |
| 145 "${libjingle_source}/talk/p2p/base/constants.cc", |
| 146 "${libjingle_source}/talk/p2p/base/constants.h", |
| 147 "${libjingle_source}/talk/p2p/base/dtlstransport.h", |
| 148 "${libjingle_source}/talk/p2p/base/dtlstransportchannel.cc", |
| 149 "${libjingle_source}/talk/p2p/base/dtlstransportchannel.h", |
| 150 "${libjingle_source}/talk/p2p/base/p2ptransport.cc", |
| 151 "${libjingle_source}/talk/p2p/base/p2ptransport.h", |
| 152 "${libjingle_source}/talk/p2p/base/p2ptransportchannel.cc", |
| 153 "${libjingle_source}/talk/p2p/base/p2ptransportchannel.h", |
| 154 "${libjingle_source}/talk/p2p/base/parsing.cc", |
| 155 "${libjingle_source}/talk/p2p/base/parsing.h", |
| 156 "${libjingle_source}/talk/p2p/base/port.cc", |
| 157 "${libjingle_source}/talk/p2p/base/port.h", |
| 158 "${libjingle_source}/talk/p2p/base/portallocator.cc", |
| 159 "${libjingle_source}/talk/p2p/base/portallocator.h", |
| 160 "${libjingle_source}/talk/p2p/base/portallocatorsessionproxy.cc", |
| 161 "${libjingle_source}/talk/p2p/base/portallocatorsessionproxy.h", |
| 162 "${libjingle_source}/talk/p2p/base/portproxy.cc", |
| 163 "${libjingle_source}/talk/p2p/base/portproxy.h", |
| 164 "${libjingle_source}/talk/p2p/base/pseudotcp.cc", |
| 165 "${libjingle_source}/talk/p2p/base/pseudotcp.h", |
| 166 "${libjingle_source}/talk/p2p/base/rawtransport.cc", |
| 167 "${libjingle_source}/talk/p2p/base/rawtransport.h", |
| 168 "${libjingle_source}/talk/p2p/base/rawtransportchannel.cc", |
| 169 "${libjingle_source}/talk/p2p/base/rawtransportchannel.h", |
| 170 "${libjingle_source}/talk/p2p/base/relayport.cc", |
| 171 "${libjingle_source}/talk/p2p/base/relayport.h", |
| 172 "${libjingle_source}/talk/p2p/base/session.cc", |
| 173 "${libjingle_source}/talk/p2p/base/session.h", |
| 174 "${libjingle_source}/talk/p2p/base/sessionclient.h", |
| 175 "${libjingle_source}/talk/p2p/base/sessiondescription.cc", |
| 176 "${libjingle_source}/talk/p2p/base/sessiondescription.h", |
| 177 "${libjingle_source}/talk/p2p/base/sessionid.h", |
| 178 "${libjingle_source}/talk/p2p/base/sessionmanager.cc", |
| 179 "${libjingle_source}/talk/p2p/base/sessionmanager.h", |
| 180 "${libjingle_source}/talk/p2p/base/sessionmessages.cc", |
| 181 "${libjingle_source}/talk/p2p/base/sessionmessages.h", |
| 182 "${libjingle_source}/talk/p2p/base/stun.cc", |
| 183 "${libjingle_source}/talk/p2p/base/stun.h", |
| 184 "${libjingle_source}/talk/p2p/base/stunport.cc", |
| 185 "${libjingle_source}/talk/p2p/base/stunport.h", |
| 186 "${libjingle_source}/talk/p2p/base/stunrequest.cc", |
| 187 "${libjingle_source}/talk/p2p/base/stunrequest.h", |
| 188 "${libjingle_source}/talk/p2p/base/tcpport.cc", |
| 189 "${libjingle_source}/talk/p2p/base/tcpport.h", |
| 190 "${libjingle_source}/talk/p2p/base/transport.cc", |
| 191 "${libjingle_source}/talk/p2p/base/transport.h", |
| 192 "${libjingle_source}/talk/p2p/base/transportchannel.cc", |
| 193 "${libjingle_source}/talk/p2p/base/transportchannel.h", |
| 194 "${libjingle_source}/talk/p2p/base/transportchannelimpl.h", |
| 195 "${libjingle_source}/talk/p2p/base/transportchannelproxy.cc", |
| 196 "${libjingle_source}/talk/p2p/base/transportchannelproxy.h", |
| 197 "${libjingle_source}/talk/p2p/base/transportdescription.cc", |
| 198 "${libjingle_source}/talk/p2p/base/transportdescription.h", |
| 199 "${libjingle_source}/talk/p2p/base/transportdescriptionfactory.cc", |
| 200 "${libjingle_source}/talk/p2p/base/transportdescriptionfactory.h", |
| 201 "${libjingle_source}/talk/p2p/base/turnport.cc", |
| 202 "${libjingle_source}/talk/p2p/base/turnport.h", |
| 203 "${libjingle_source}/talk/p2p/client/basicportallocator.cc", |
| 204 "${libjingle_source}/talk/p2p/client/basicportallocator.h", |
| 205 "${libjingle_source}/talk/p2p/client/httpportallocator.cc", |
| 206 "${libjingle_source}/talk/p2p/client/httpportallocator.h", |
| 207 "${libjingle_source}/talk/p2p/client/sessionmanagertask.h", |
| 208 "${libjingle_source}/talk/p2p/client/sessionsendtask.h", |
| 209 "${libjingle_source}/talk/p2p/client/socketmonitor.cc", |
| 210 "${libjingle_source}/talk/p2p/client/socketmonitor.h", |
| 211 "${libjingle_source}/talk/xmllite/qname.cc", |
| 212 "${libjingle_source}/talk/xmllite/qname.h", |
| 213 "${libjingle_source}/talk/xmllite/xmlbuilder.cc", |
| 214 "${libjingle_source}/talk/xmllite/xmlbuilder.h", |
| 215 "${libjingle_source}/talk/xmllite/xmlconstants.cc", |
| 216 "${libjingle_source}/talk/xmllite/xmlconstants.h", |
| 217 "${libjingle_source}/talk/xmllite/xmlelement.cc", |
| 218 "${libjingle_source}/talk/xmllite/xmlelement.h", |
| 219 "${libjingle_source}/talk/xmllite/xmlnsstack.cc", |
| 220 "${libjingle_source}/talk/xmllite/xmlnsstack.h", |
| 221 "${libjingle_source}/talk/xmllite/xmlparser.cc", |
| 222 "${libjingle_source}/talk/xmllite/xmlparser.h", |
| 223 "${libjingle_source}/talk/xmllite/xmlprinter.cc", |
| 224 "${libjingle_source}/talk/xmllite/xmlprinter.h", |
| 225 "${libjingle_source}/talk/xmpp/asyncsocket.h", |
| 226 "${libjingle_source}/talk/xmpp/constants.cc", |
| 227 "${libjingle_source}/talk/xmpp/constants.h", |
| 228 "${libjingle_source}/talk/xmpp/jid.cc", |
| 229 "${libjingle_source}/talk/xmpp/jid.h", |
| 230 "${libjingle_source}/talk/xmpp/plainsaslhandler.h", |
| 231 "${libjingle_source}/talk/xmpp/prexmppauth.h", |
| 232 "${libjingle_source}/talk/xmpp/saslcookiemechanism.h", |
| 233 "${libjingle_source}/talk/xmpp/saslhandler.h", |
| 234 "${libjingle_source}/talk/xmpp/saslmechanism.cc", |
| 235 "${libjingle_source}/talk/xmpp/saslmechanism.h", |
| 236 "${libjingle_source}/talk/xmpp/saslplainmechanism.h", |
| 237 "${libjingle_source}/talk/xmpp/xmppclient.cc", |
| 238 "${libjingle_source}/talk/xmpp/xmppclient.h", |
| 239 "${libjingle_source}/talk/xmpp/xmppclientsettings.h", |
| 240 "${libjingle_source}/talk/xmpp/xmppengine.h", |
| 241 "${libjingle_source}/talk/xmpp/xmppengineimpl.cc", |
| 242 "${libjingle_source}/talk/xmpp/xmppengineimpl.h", |
| 243 "${libjingle_source}/talk/xmpp/xmppengineimpl_iq.cc", |
| 244 "${libjingle_source}/talk/xmpp/xmpplogintask.cc", |
| 245 "${libjingle_source}/talk/xmpp/xmpplogintask.h", |
| 246 "${libjingle_source}/talk/xmpp/xmppstanzaparser.cc", |
| 247 "${libjingle_source}/talk/xmpp/xmppstanzaparser.h", |
| 248 "${libjingle_source}/talk/xmpp/xmpptask.cc", |
| 249 "${libjingle_source}/talk/xmpp/xmpptask.h", |
| 250 ] |
| 251 sources -= [ |
| 252 # Compiled as part of libjingle_p2p_constants. |
| 253 "${libjingle_source}/talk/p2p/base/constants.cc", |
| 254 "${libjingle_source}/talk/p2p/base/constants.h", |
| 255 ] |
| 256 deps = [ |
| 257 # TODO(GYP): Uncomment when WebRTC GN build has settled. |
| 258 # "//third_party/webrtc/base:webrtc_base", |
| 259 ":libjingle_p2p_constants", |
| 260 ":jingle_deps" |
| 261 ] |
| 262 |
| 263 # From libjingle_common.gypi's conditions list. |
| 264 if (is_win && !nacl_untrusted_build) { |
| 265 cflags += [ "/wd4005", "\wd4267" ] |
| 266 } |
| 267 |
| 268 forward_dependent_configs_from = [ |
| 269 ":jingle_deps" |
| 270 ] |
| 271 configs += [ |
| 272 ":jingle_unexported_configs" |
| 273 ] |
| 274 direct_dependent_configs = [ |
| 275 ":jingle_direct_dependent_configs", |
| 276 ] |
| 277 all_dependent_configs = [ |
| 278 ":jingle_all_dependent_configs", |
| 279 ] |
| 280 } |
| 281 |
| 282 # This has to be is a separate project due to a bug in MSVS 2008 and the |
| 283 # current toolset on android. The problem is that we have two files named |
| 284 # "constants.cc" and MSVS/android doesn't handle this properly. |
| 285 # GYP currently has guards to catch this, so if you want to remove it, |
| 286 # run GYP and if GYP has removed the validation check, then we can assume |
| 287 # that the toolchains have been fixed (we currently use VS2010 and later, |
| 288 # so VS2008 isn't a concern anymore). |
| 289 # |
| 290 # GYP version: third_party/libjingle.gyp:libjingle_p2p_constants |
| 291 static_library("libjingle_p2p_constants") { |
| 292 sources = [ |
| 293 "${libjingle_source}/talk/p2p/base/constants.cc", |
| 294 "${libjingle_source}/talk/p2p/base/constants.h", |
| 295 ] |
| 296 deps = [ |
| 297 ":jingle_deps", |
| 298 ] |
| 299 forward_dependent_configs_from = [ |
| 300 ":jingle_deps", |
| 301 ] |
| 302 configs += [ |
| 303 ":jingle_unexported_configs" |
| 304 ] |
| 305 direct_dependent_configs = [ |
| 306 ":jingle_direct_dependent_configs", |
| 307 ] |
| 308 all_dependent_configs = [ |
| 309 ":jingle_all_dependent_configs", |
| 310 ] |
| 311 } |
| 312 |
| 313 # GYP version: third_party/libjingle.gyp:peerconnnection_server |
| 314 #TODO(GYP): Switch to executable when WebRTC dependency is resolved. |
| 315 source_set("peerconnnection_server") { |
| 316 sources = [ |
| 317 "${libjingle_source}/talk/examples/peerconnection/server/data_socket.cc", |
| 318 "${libjingle_source}/talk/examples/peerconnection/server/data_socket.h", |
| 319 "${libjingle_source}/talk/examples/peerconnection/server/main.cc", |
| 320 "${libjingle_source}/talk/examples/peerconnection/server/peer_channel.cc", |
| 321 "${libjingle_source}/talk/examples/peerconnection/server/peer_channel.h", |
| 322 "${libjingle_source}/talk/examples/peerconnection/server/utils.cc", |
| 323 "${libjingle_source}/talk/examples/peerconnection/server/utils.h", |
| 324 ] |
| 325 include_dirs = [ |
| 326 "${libjingle_source}", |
| 327 ] |
| 328 deps = [ |
| 329 ":libjingle", |
| 330 ":jingle_deps", |
| 331 ] |
| 332 forward_dependent_configs_from = [ |
| 333 ":jingle_deps", |
| 334 ] |
| 335 configs += [ |
| 336 ":jingle_unexported_configs" |
| 337 ] |
| 338 direct_dependent_configs = [ |
| 339 ":jingle_direct_dependent_configs", |
| 340 ] |
| 341 all_dependent_configs = [ |
| 342 ":jingle_all_dependent_configs", |
| 343 ] |
| 344 if (is_win) { |
| 345 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 346 cflags += [ "/wd4309" ] |
| 347 } |
| 348 } |
| 349 |
| 350 # TODO(GYP): Port libjingle.gyp's enable_webrtc condition block. |
OLD | NEW |