blob: 7fdd46280c4dfd965acf6e2a60fd7859cbe5344a [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 # Adds video support to dependencies shared by voice and video engine.
30 # This should normally be enabled; the intended use is to disable only
31 # when building voice engine exclusively.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000032 rtc_enable_video = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000033
34 # Selects fixed-point code where possible.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000035 rtc_prefer_fixed_point = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000036
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000037 # Enable data logging. Produces text files with data logged within engines
38 # which can be easily parsed for offline processing.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000039 rtc_enable_data_logging = false
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000040
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000041 # Enables the use of protocol buffers for debug recordings.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000042 rtc_enable_protobuf = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000043
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000044 # Disable these to not build components which can be externally provided.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000045 rtc_build_json = true
46 rtc_build_libjpeg = true
47 rtc_build_libyuv = true
48 rtc_build_libvpx = true
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000049 rtc_build_vp9 = true
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000050 rtc_build_ssl = true
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000051
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000052 # Disable by default.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000053 rtc_have_dbus_glib = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000054
55 # Enable to use the Mozilla internal settings.
56 build_with_mozilla = false
57
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +000058 # Define MIPS DSP variant and MIPS FPU.
59 # This may be subject to change in accordance to Chromium's MIPS flags.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000060 mips_dsp_rev = 0
61 mips_fpu = true
62
henrika@webrtc.org45db7ee2015-01-12 14:27:23 +000063 rtc_enable_android_opensl = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000064
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000065 # Link-Time Optimizations.
66 # Executes code generation at link-time instead of compile-time.
67 # https://gcc.gnu.org/wiki/LinkTimeOptimization
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000068 rtc_use_lto = false
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000069
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000070 # Directly call the trace callback instead of passing it to a logging
71 # thread. Used for components that provide their own threaded logging.
72 rtc_use_direct_trace = false
73
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000074 if (build_with_chromium) {
75 # Exclude pulse audio on Chromium since its prerequisites don't require
76 # pulse audio.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000077 rtc_include_pulse_audio = false
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000078
79 # Exclude internal ADM since Chromium uses its own IO handling.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000080 rtc_include_internal_audio_device = false
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000081
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000082 } else {
83 # Settings for the standalone (not-in-Chromium) build.
84
85 # TODO(andrew): For now, disable the Chrome plugins, which causes a
86 # flood of chromium-style warnings. Investigate enabling them:
87 # http://code.google.com/p/webrtc/issues/detail?id=163
88 clang_use_chrome_plugins = false
89
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000090 rtc_include_pulse_audio = true
91 rtc_include_internal_audio_device = true
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000092 }
93
94 if (build_with_libjingle) {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000095 rtc_include_tests = false
96 rtc_restrict_logging = true
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000097 } else {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000098 rtc_include_tests = true
99 rtc_restrict_logging = false
kjellander@webrtc.org788f0582014-08-28 13:51:08 +0000100 }
101
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000102 if (is_ios) {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000103 rtc_build_libjpeg = false
104 rtc_enable_protobuf = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000105 }
106
107 if (cpu_arch == "arm") {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000108 rtc_prefer_fixed_point = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000109 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000110
andrew@webrtc.org34ac9562014-12-30 18:19:56 +0000111 # TODO(ljubomir): Unset rtc_use_openmax_dl for mips64el once mips64el gets
112 # supported in GN (since openmax_dl is not supported for mips64el).
andrew@webrtc.org0001adc2014-10-09 04:13:02 +0000113 if (!is_ios && (cpu_arch != "arm" || arm_version >= 7)) {
andrew@webrtc.org4165f7a2014-10-08 18:01:27 +0000114 rtc_use_openmax_dl = true
115 } else {
116 rtc_use_openmax_dl = false
117 }
118
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000119 # WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and
120 # Android, which is why we currently cannot use the variables in
121 # //build/config/arm.gni (since it disables Neon for Android).
andrew@webrtc.org1090a6e2014-12-18 21:36:18 +0000122 rtc_build_armv7_neon = (cpu_arch == "arm" && arm_version >= 7)
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000123}
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +0000124
125# Make it possible to provide custom locations for some libraries (move these
126# up into declare_args should we need to actually use them for the GN build).
127rtc_libvpx_dir = "//third_party/libvpx"
128rtc_libyuv_dir = "//third_party/libyuv"
129rtc_opus_dir = "//third_party/opus"