blob: d68238138bfecb3df1a713a25ad7bcc1b729c487 [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.
buildbot@webrtc.org55535d42014-07-08 18:18:55 +000034 'libjingle_tests_additional_deps%': [],
kjellander@webrtc.org10141012014-06-10 10:13:38 +000035 'libjingle_root%': '<(DEPTH)',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000036 # 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.orgdd14b2a2013-08-12 18:06:29 +000040 'conditions': [
41 ['OS=="android" or OS=="linux"', {
kjellander@webrtc.orgc2c94a92014-10-31 19:01:41 +000042 '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")',
fischman@webrtc.orgdd14b2a2013-08-12 18:06:29 +000043 }],
44 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +000045 },
46 'target_defaults': {
47 'include_dirs': [
kjellander@webrtc.org10141012014-06-10 10:13:38 +000048 '<(libjingle_root)',
kjellander@webrtc.orgcf85f1c2014-03-05 00:40:33 +000049 '<(DEPTH)',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000050 '../../third_party',
51 '../../third_party/webrtc',
henrike@webrtc.org9de257d2013-07-17 14:42:53 +000052 '../../webrtc',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000053 ],
54 'defines': [
55 'EXPAT_RELATIVE_PATH',
56 'FEATURE_ENABLE_VOICEMAIL',
57 'GTEST_RELATIVE_PATH',
58 'JSONCPP_RELATIVE_PATH',
59 'LOGGING=1',
60 'SRTP_RELATIVE_PATH',
61
62 # Feature selection
63 'FEATURE_ENABLE_SSL',
64 'FEATURE_ENABLE_VOICEMAIL',
65 'FEATURE_ENABLE_PSTN',
tkchin@webrtc.orgb038c722014-07-14 20:24:09 +000066 'HAVE_SCTP',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000067 'HAVE_SRTP',
68 'HAVE_WEBRTC_VIDEO',
69 'HAVE_WEBRTC_VOICE',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000070 'USE_WEBRTC_DEV_BRANCH',
71 ],
72 'conditions': [
73 # TODO(ronghuawu): Support dynamic library build.
74 ['"<(libpeer_target_type)"=="static_library"', {
75 'defines': [ 'LIBPEERCONNECTION_LIB=1' ],
76 }],
77 ['OS=="linux"', {
78 'defines': [
79 'LINUX',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000080 'WEBRTC_LINUX',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000081 ],
82 'conditions': [
83 ['clang==1', {
84 'cflags': [
pbos@webrtc.org174a6742014-06-02 07:58:30 +000085 '-Wall',
86 '-Wextra',
87 '-Wunused-variable',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000088 # TODO(ronghuawu): Fix the warning caused by
89 # LateBindingSymbolTable::TableInfo from
90 # latebindingsymboltable.cc.def and remove below flag.
91 '-Wno-address-of-array-temporary',
pbos@webrtc.orgd60d79a2014-09-24 07:10:57 +000092 '-Wthread-safety',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000093 ],
94 }],
95 ],
96 }],
97 ['OS=="mac"', {
98 'defines': [
99 'OSX',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000100 'WEBRTC_MAC',
101 ],
102 }],
103 ['OS=="win"', {
104 'defines': [
105 'WEBRTC_WIN',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000106 ],
fbarchard@google.com48305f52014-07-30 00:16:20 +0000107 'msvs_disabled_warnings': [
108 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
109 # Warning 4702 ("Unreachable code") should be re-enabled once
110 # users are updated to VS2013 Update 2.
111 4702,
112 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000113 }],
114 ['OS=="ios"', {
115 'defines': [
116 'IOS',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000117 'WEBRTC_MAC',
118 'WEBRTC_IOS',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000119 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000120 }],
fischman@webrtc.orge3de6b12013-08-26 19:31:21 +0000121 ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
henrike@webrtc.org723d6832013-07-12 16:04:50 +0000122 'defines': [
123 'CARBON_DEPRECATED=YES',
124 ],
125 }],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000126 ['os_posix==1', {
fischman@webrtc.orgb25576a2014-03-26 21:53:47 +0000127 '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.org28e20752013-07-10 00:45:36 +0000137 'defines': [
138 'HASH_NAMESPACE=__gnu_cxx',
139 'POSIX',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000140 'WEBRTC_POSIX',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000141 'DISABLE_DYNAMIC_CAST',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000142 # The POSIX standard says we have to define this.
143 '_REENTRANT',
144 ],
145 }],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000146 ],
147 }, # target_defaults
148}