blob: 87f852c2dc66411f7f79b7e8331035da8f0b9d2c [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001#
2# libjingle
jlmiller@webrtc.org5f93d0a2015-01-20 21:36:13 +00003# Copyright 2012 Google Inc.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00004#
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',
buildbot@webrtc.org55535d42014-07-08 18:18:55 +000033 'libjingle_tests_additional_deps%': [],
henrike@webrtc.org28e20752013-07-10 00:45:36 +000034 # TODO(ronghuawu): For now, disable the Chrome plugins, which causes a
35 # flood of chromium-style warnings.
36 'clang_use_chrome_plugins%': 0,
37 'libpeer_target_type%': 'static_library',
fischman@webrtc.orgdd14b2a2013-08-12 18:06:29 +000038 'conditions': [
39 ['OS=="android" or OS=="linux"', {
kjellander@webrtc.orgc2c94a92014-10-31 19:01:41 +000040 '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 +000041 }],
42 ],
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020043 # Disable these to not build components which can be externally provided.
44 'build_expat%': 1,
45 'build_icu%': 1,
46 'build_json%': 1,
47 'build_libsrtp%': 1,
48 'build_libyuv%': 1,
49 'build_usrsctp%': 1,
50 # Make it possible to provide custom locations for some libraries.
51 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
52
53 # Disable this to skip building source requiring GTK.
54 'use_gtk%': 1,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000055 },
56 'target_defaults': {
57 'include_dirs': [
kjellander@webrtc.orgcf85f1c2014-03-05 00:40:33 +000058 '<(DEPTH)',
kjellander@webrtc.orge41ec812015-03-06 08:03:16 +000059 '../..',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000060 '../../third_party',
61 '../../third_party/webrtc',
henrike@webrtc.org9de257d2013-07-17 14:42:53 +000062 '../../webrtc',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000063 ],
64 'defines': [
65 'EXPAT_RELATIVE_PATH',
66 'FEATURE_ENABLE_VOICEMAIL',
67 'GTEST_RELATIVE_PATH',
68 'JSONCPP_RELATIVE_PATH',
69 'LOGGING=1',
70 'SRTP_RELATIVE_PATH',
71
72 # Feature selection
73 'FEATURE_ENABLE_SSL',
74 'FEATURE_ENABLE_VOICEMAIL',
75 'FEATURE_ENABLE_PSTN',
tkchin@webrtc.orgb038c722014-07-14 20:24:09 +000076 'HAVE_SCTP',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000077 'HAVE_SRTP',
78 'HAVE_WEBRTC_VIDEO',
79 'HAVE_WEBRTC_VOICE',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000080 ],
81 'conditions': [
82 # TODO(ronghuawu): Support dynamic library build.
83 ['"<(libpeer_target_type)"=="static_library"', {
84 'defines': [ 'LIBPEERCONNECTION_LIB=1' ],
85 }],
86 ['OS=="linux"', {
87 'defines': [
88 'LINUX',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000089 'WEBRTC_LINUX',
henrike@webrtc.org28e20752013-07-10 00:45:36 +000090 ],
Henrik Kjellander4cd69402015-05-15 09:10:30 +020091 # Remove Chromium's disabling of the -Wformat warning.
92 'cflags!': [
93 '-Wno-format',
94 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +000095 'conditions': [
96 ['clang==1', {
97 'cflags': [
pbos@webrtc.org174a6742014-06-02 07:58:30 +000098 '-Wall',
99 '-Wextra',
Henrik Kjellander4cd69402015-05-15 09:10:30 +0200100 '-Wformat',
101 '-Wformat-security',
Henrik Kjellander7c027b62015-04-22 13:21:30 +0200102 '-Wimplicit-fallthrough',
103 '-Wmissing-braces',
104 '-Wreorder',
pbos@webrtc.org174a6742014-06-02 07:58:30 +0000105 '-Wunused-variable',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000106 # TODO(ronghuawu): Fix the warning caused by
107 # LateBindingSymbolTable::TableInfo from
108 # latebindingsymboltable.cc.def and remove below flag.
109 '-Wno-address-of-array-temporary',
pbos@webrtc.orgd60d79a2014-09-24 07:10:57 +0000110 '-Wthread-safety',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000111 ],
Henrik Kjellander24d44852015-04-23 14:51:18 +0200112 'cflags_cc': [
113 '-Wunused-private-field',
114 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000115 }],
116 ],
117 }],
118 ['OS=="mac"', {
119 'defines': [
120 'OSX',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000121 'WEBRTC_MAC',
122 ],
123 }],
124 ['OS=="win"', {
125 'defines': [
126 'WEBRTC_WIN',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000127 ],
fbarchard@google.com48305f52014-07-30 00:16:20 +0000128 'msvs_disabled_warnings': [
129 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
130 # Warning 4702 ("Unreachable code") should be re-enabled once
131 # users are updated to VS2013 Update 2.
132 4702,
133 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000134 }],
135 ['OS=="ios"', {
136 'defines': [
137 'IOS',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000138 'WEBRTC_MAC',
139 'WEBRTC_IOS',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000140 ],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000141 }],
fischman@webrtc.orge3de6b12013-08-26 19:31:21 +0000142 ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
henrike@webrtc.org723d6832013-07-12 16:04:50 +0000143 'defines': [
144 'CARBON_DEPRECATED=YES',
145 ],
146 }],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000147 ['os_posix==1', {
fischman@webrtc.orgb25576a2014-03-26 21:53:47 +0000148 'configurations': {
149 'Debug_Base': {
150 'defines': [
151 # Chromium's build/common.gypi defines this for all posix _except_
152 # for ios & mac. We want it there as well, e.g. because ASSERT
153 # and friends trigger off of it.
154 '_DEBUG',
155 ],
156 },
157 },
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000158 'defines': [
159 'HASH_NAMESPACE=__gnu_cxx',
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +0000160 'WEBRTC_POSIX',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000161 'DISABLE_DYNAMIC_CAST',
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000162 # The POSIX standard says we have to define this.
163 '_REENTRANT',
164 ],
165 }],
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000166 ],
167 }, # target_defaults
168}