blob: 336f7a117a2947a83557c7a15c866c4ef6140cf6 [file] [log] [blame]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +00009import("//build/config/arm.gni")
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +000010import("//build/config/mips.gni")
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000011
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000012declare_args() {
13 # Assume Chromium build for now, since that's the priority case for getting GN
14 # up and running with WebRTC.
15 build_with_chromium = true
16 build_with_libjingle = true
17
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000018 # Disable this to avoid building the Opus audio codec.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000019 rtc_include_opus = true
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000020
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000021 # Used to specify an external Jsoncpp include path when not compiling the
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000022 # library that comes with WebRTC (i.e. rtc_build_json == 0).
23 rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000024
25 # Used to specify an external OpenSSL include path when not compiling the
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000026 # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
27 rtc_ssl_root = ""
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000028
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000029 # Selects fixed-point code where possible.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000030 rtc_prefer_fixed_point = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000031
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000032 # Enable data logging. Produces text files with data logged within engines
33 # which can be easily parsed for offline processing.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000034 rtc_enable_data_logging = false
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000035
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000036 # Enables the use of protocol buffers for debug recordings.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000037 rtc_enable_protobuf = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000038
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000039 # Disable these to not build components which can be externally provided.
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020040 rtc_build_expat = true
41 rtc_build_icu = true
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000042 rtc_build_json = true
43 rtc_build_libjpeg = true
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000044 rtc_build_libvpx = true
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020045 rtc_build_libyuv = true
Andrew MacDonald23dc68e2015-04-24 08:46:51 -070046 rtc_build_openmax_dl = true
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020047 rtc_build_opus = true
48 rtc_build_ssl = true
49 rtc_build_vp9 = true
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000050
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000051 # Disable by default.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000052 rtc_have_dbus_glib = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000053
54 # Enable to use the Mozilla internal settings.
55 build_with_mozilla = false
56
henrika@webrtc.org45db7ee2015-01-12 14:27:23 +000057 rtc_enable_android_opensl = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000058
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000059 # Link-Time Optimizations.
60 # Executes code generation at link-time instead of compile-time.
61 # https://gcc.gnu.org/wiki/LinkTimeOptimization
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000062 rtc_use_lto = false
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000063
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000064 if (build_with_chromium) {
65 # Exclude pulse audio on Chromium since its prerequisites don't require
66 # pulse audio.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000067 rtc_include_pulse_audio = false
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000068
69 # Exclude internal ADM since Chromium uses its own IO handling.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000070 rtc_include_internal_audio_device = false
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000071
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000072 } else {
73 # Settings for the standalone (not-in-Chromium) build.
74
75 # TODO(andrew): For now, disable the Chrome plugins, which causes a
76 # flood of chromium-style warnings. Investigate enabling them:
77 # http://code.google.com/p/webrtc/issues/detail?id=163
78 clang_use_chrome_plugins = false
79
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000080 rtc_include_pulse_audio = true
81 rtc_include_internal_audio_device = true
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000082 }
83
84 if (build_with_libjingle) {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000085 rtc_include_tests = false
86 rtc_restrict_logging = true
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000087 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000088 rtc_include_tests = true
89 rtc_restrict_logging = false
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000090 }
91
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000092 if (is_ios) {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000093 rtc_build_libjpeg = false
94 rtc_enable_protobuf = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000095 }
96
kjellander@webrtc.org72273912015-02-23 19:08:31 +000097 if (current_cpu == "arm") {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000098 rtc_prefer_fixed_point = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000099 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000100
andrew@webrtc.org34ac9562014-12-30 18:19:56 +0000101 # TODO(ljubomir): Unset rtc_use_openmax_dl for mips64el once mips64el gets
102 # supported in GN (since openmax_dl is not supported for mips64el).
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000103 if (!is_ios && (current_cpu != "arm" || arm_version >= 7)) {
andrew@webrtc.org4165f7a2014-10-08 18:01:27 +0000104 rtc_use_openmax_dl = true
105 } else {
106 rtc_use_openmax_dl = false
107 }
108
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000109 # WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and
110 # Android, which is why we currently cannot use the variables in
111 # //build/config/arm.gni (since it disables Neon for Android).
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000112 rtc_build_armv7_neon = (current_cpu == "arm" && arm_version >= 7)
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000113}
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +0000114
115# Make it possible to provide custom locations for some libraries (move these
116# up into declare_args should we need to actually use them for the GN build).
117rtc_libvpx_dir = "//third_party/libvpx"
118rtc_libyuv_dir = "//third_party/libyuv"
119rtc_opus_dir = "//third_party/opus"