kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 1 | # 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.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 9 | import("//build/config/arm.gni") |
kjellander@webrtc.org | acb8085 | 2015-01-25 19:17:56 +0000 | [diff] [blame] | 10 | import("//build/config/mips.gni") |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 11 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 12 | declare_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.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 18 | # Disable this to avoid building the Opus audio codec. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 19 | rtc_include_opus = true |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 20 | |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 21 | # Used to specify an external Jsoncpp include path when not compiling the |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 22 | # library that comes with WebRTC (i.e. rtc_build_json == 0). |
| 23 | rtc_jsoncpp_root = "//third_party/jsoncpp/source/include" |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 24 | |
| 25 | # Used to specify an external OpenSSL include path when not compiling the |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 26 | # library that comes with WebRTC (i.e. rtc_build_ssl == 0). |
| 27 | rtc_ssl_root = "" |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 28 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 29 | # Selects fixed-point code where possible. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 30 | rtc_prefer_fixed_point = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 31 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 32 | # Enable data logging. Produces text files with data logged within engines |
| 33 | # which can be easily parsed for offline processing. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 34 | rtc_enable_data_logging = false |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 35 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 36 | # Enables the use of protocol buffers for debug recordings. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 37 | rtc_enable_protobuf = true |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 38 | |
kjellander@webrtc.org | 11bea89 | 2014-07-03 17:04:12 +0000 | [diff] [blame] | 39 | # Disable these to not build components which can be externally provided. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 40 | rtc_build_json = true |
| 41 | rtc_build_libjpeg = true |
| 42 | rtc_build_libyuv = true |
| 43 | rtc_build_libvpx = true |
kjellander@webrtc.org | ce22f13 | 2015-02-16 12:47:20 +0000 | [diff] [blame] | 44 | rtc_build_vp9 = true |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 45 | rtc_build_ssl = true |
minyue@webrtc.org | 7c112f3 | 2015-03-17 14:04:56 +0000 | [diff] [blame] | 46 | rtc_build_opus = true |
Andrew MacDonald | 23dc68e | 2015-04-24 08:46:51 -0700 | [diff] [blame^] | 47 | rtc_build_openmax_dl = true |
kjellander@webrtc.org | 11bea89 | 2014-07-03 17:04:12 +0000 | [diff] [blame] | 48 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 49 | # Disable by default. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 50 | rtc_have_dbus_glib = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 51 | |
| 52 | # Enable to use the Mozilla internal settings. |
| 53 | build_with_mozilla = false |
| 54 | |
henrika@webrtc.org | 45db7ee | 2015-01-12 14:27:23 +0000 | [diff] [blame] | 55 | rtc_enable_android_opensl = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 56 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 57 | # Link-Time Optimizations. |
| 58 | # Executes code generation at link-time instead of compile-time. |
| 59 | # https://gcc.gnu.org/wiki/LinkTimeOptimization |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 60 | rtc_use_lto = false |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 61 | |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 62 | if (build_with_chromium) { |
| 63 | # Exclude pulse audio on Chromium since its prerequisites don't require |
| 64 | # pulse audio. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 65 | rtc_include_pulse_audio = false |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 66 | |
| 67 | # Exclude internal ADM since Chromium uses its own IO handling. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 68 | rtc_include_internal_audio_device = false |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 69 | |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 70 | } else { |
| 71 | # Settings for the standalone (not-in-Chromium) build. |
| 72 | |
| 73 | # TODO(andrew): For now, disable the Chrome plugins, which causes a |
| 74 | # flood of chromium-style warnings. Investigate enabling them: |
| 75 | # http://code.google.com/p/webrtc/issues/detail?id=163 |
| 76 | clang_use_chrome_plugins = false |
| 77 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 78 | rtc_include_pulse_audio = true |
| 79 | rtc_include_internal_audio_device = true |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | if (build_with_libjingle) { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 83 | rtc_include_tests = false |
| 84 | rtc_restrict_logging = true |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 85 | } else { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 86 | rtc_include_tests = true |
| 87 | rtc_restrict_logging = false |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 88 | } |
| 89 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 90 | if (is_ios) { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 91 | rtc_build_libjpeg = false |
| 92 | rtc_enable_protobuf = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 93 | } |
| 94 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 95 | if (current_cpu == "arm") { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 96 | rtc_prefer_fixed_point = true |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 97 | } |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 98 | |
andrew@webrtc.org | 34ac956 | 2014-12-30 18:19:56 +0000 | [diff] [blame] | 99 | # TODO(ljubomir): Unset rtc_use_openmax_dl for mips64el once mips64el gets |
| 100 | # supported in GN (since openmax_dl is not supported for mips64el). |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 101 | if (!is_ios && (current_cpu != "arm" || arm_version >= 7)) { |
andrew@webrtc.org | 4165f7a | 2014-10-08 18:01:27 +0000 | [diff] [blame] | 102 | rtc_use_openmax_dl = true |
| 103 | } else { |
| 104 | rtc_use_openmax_dl = false |
| 105 | } |
| 106 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 107 | # WebRTC builds ARM v7 Neon instruction set optimized code for both iOS and |
| 108 | # Android, which is why we currently cannot use the variables in |
| 109 | # //build/config/arm.gni (since it disables Neon for Android). |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 110 | rtc_build_armv7_neon = (current_cpu == "arm" && arm_version >= 7) |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 111 | } |
kjellander@webrtc.org | ce22f13 | 2015-02-16 12:47:20 +0000 | [diff] [blame] | 112 | |
| 113 | # Make it possible to provide custom locations for some libraries (move these |
| 114 | # up into declare_args should we need to actually use them for the GN build). |
| 115 | rtc_libvpx_dir = "//third_party/libvpx" |
| 116 | rtc_libyuv_dir = "//third_party/libyuv" |
| 117 | rtc_opus_dir = "//third_party/opus" |