webrtc_m130/webrtc/BUILD.gn

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

520 lines
14 KiB
Plaintext
Raw Normal View History

# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# TODO(kjellander): Rebase this to webrtc/build/common.gypi changes after r6330.
import("//build/config/linux/pkg_config.gni")
import("//build/config/sanitizers/sanitizers.gni")
Reland of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2657563002/ ) Reason for revert: Starting to work on a fix (it seems that there are third_party dependencies that depends on the path to the webrtc.gni file) Original issue's description: > Revert of Moving webrtc.gni up one level from build/ (patchset #1 id:1 of https://codereview.webrtc.org/2651543003/ ) > > Reason for revert: > This was causing the following failure: https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Builder/builds/838/steps/generate_build_files/logs/stdio > > Original issue's description: > > Moving webrtc.gni up one level from build/ > > > > BUG=webrtc:7030 > > > > Review-Url: https://codereview.webrtc.org/2651543003 > > Cr-Commit-Position: refs/heads/master@{#16241} > > Committed: https://chromium.googlesource.com/external/webrtc/+/35a32700fc9b5d932ddbd528c12f59c3274e4774 > > TBR=kjellander@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:7030 > > Review-Url: https://codereview.webrtc.org/2657563002 > Cr-Commit-Position: refs/heads/master@{#16244} > Committed: https://chromium.googlesource.com/external/webrtc/+/69dc7dbe247ead087f3bae0eb7e23f27f0de1ec3 TBR=kjellander@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:7030 Review-Url: https://codereview.webrtc.org/2654773002 Cr-Commit-Position: refs/heads/master@{#16247}
2017-01-24 06:58:22 -08:00
import("webrtc.gni")
import("//third_party/protobuf/proto_library.gni")
Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2345163003/ ) Reason for revert: Bring back the include I managed to accidentally remove. Original issue's description: > Revert of Fix android_junit_tests and add a GN target for them. (patchset #3 id:90001 of https://codereview.webrtc.org/2344133002/ ) > > Reason for revert: > Breaks bots. > > Original issue's description: > > Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2341213003/ ) > > > > Reason for revert: > > Fix the issue. > > > > Original issue's description: > > > Revert of Fix android_junit_tests and add a GN target for them. (patchset #1 id:20001 of https://codereview.webrtc.org/2346793002/ ) > > > > > > Reason for revert: > > > Breaks WebRTC in Chrome on Android: > > > > > > https://build.chromium.org/p/chromium.webrtc.fyi/waterfall?builder=Android%20Builder%20(dbg) > > > > > > Original issue's description: > > > > Fix android_junit_tests and add a GN target for them. > > > > > > > > BUG=webrtc:6365 > > > > NOTRY=True > > > > > > > > Committed: https://crrev.com/bb716daea73889517f996aa29f867563ed63d58a > > > > Cr-Commit-Position: refs/heads/master@{#14241} > > > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,sakal@webrtc.org > > > # Skipping CQ checks because original CL landed less than 1 days ago. > > > NOPRESUBMIT=true > > > NOTREECHECKS=true > > > NOTRY=true > > > BUG=webrtc:6365 > > > > > > Committed: https://crrev.com/9adb1ff9439aecf4e8ac3972a631bb74df2b6868 > > > Cr-Commit-Position: refs/heads/master@{#14253} > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:6365 > > > > Committed: https://crrev.com/51fe1d805d19bf7c79aad46049d040fae1ae6953 > > Cr-Commit-Position: refs/heads/master@{#14254} > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6365 > > Committed: https://crrev.com/1431d49ea073d88b65303ab843545678fbb6e9f9 > Cr-Commit-Position: refs/heads/master@{#14255} TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6365 Review-Url: https://codereview.webrtc.org/2348663003 Cr-Commit-Position: refs/heads/master@{#14264}
2016-09-16 07:22:17 -07:00
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}
# Contains the defines and includes in common.gypi that are duplicated both as
# target_defaults and direct_dependent_settings.
config("common_inherited_config") {
defines = []
cflags = []
ldflags = []
if (build_with_mozilla) {
defines += [ "WEBRTC_MOZILLA_BUILD" ]
}
if (build_with_chromium) {
defines = [
# TODO(kjellander): Cleanup unused ones and move defines closer to
# the source when webrtc:4256 is completed.
"FEATURE_ENABLE_VOICEMAIL",
"EXPAT_RELATIVE_PATH",
"GTEST_RELATIVE_PATH",
"NO_MAIN_THREAD_WRAPPING",
"NO_SOUND_SYSTEM",
"WEBRTC_CHROMIUM_BUILD",
]
include_dirs = [
# The overrides must be included first as that is the mechanism for
# selecting the override headers in Chromium.
"../webrtc_overrides",
# Allow includes to be prefixed with webrtc/ in case it is not an
# immediate subdirectory of the top-level.
"..",
]
}
if (is_posix) {
defines += [ "WEBRTC_POSIX" ]
}
if (is_ios) {
defines += [
"WEBRTC_MAC",
"WEBRTC_IOS",
]
}
if (is_linux) {
defines += [ "WEBRTC_LINUX" ]
}
if (is_mac) {
defines += [ "WEBRTC_MAC" ]
}
if (is_win) {
defines += [
"WEBRTC_WIN",
"_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
]
}
if (is_android) {
defines += [
"WEBRTC_LINUX",
"WEBRTC_ANDROID",
]
}
if (is_chromeos) {
defines += [ "CHROMEOS" ]
}
if (rtc_sanitize_coverage != "") {
assert(is_clang, "sanitizer coverage requires clang")
cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
}
# TODO(GYP): Support these in GN.
# if (is_bsd) {
# defines += [ "BSD" ]
# }
# if (is_openbsd) {
# defines += [ "OPENBSD" ]
# }
# if (is_freebsd) {
# defines += [ "FREEBSD" ]
# }
}
config("common_config") {
cflags = []
cflags_cc = []
defines = []
if (rtc_restrict_logging) {
defines += [ "WEBRTC_RESTRICT_LOGGING" ]
}
if (rtc_include_internal_audio_device) {
defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
}
if (rtc_relative_path) {
defines += [ "EXPAT_RELATIVE_PATH" ]
}
if (!rtc_libvpx_build_vp9) {
defines += [ "RTC_DISABLE_VP9" ]
}
if (rtc_enable_sctp) {
defines += [ "HAVE_SCTP" ]
}
if (rtc_enable_external_auth) {
defines += [ "ENABLE_EXTERNAL_AUTH" ]
}
if (build_with_chromium) {
defines += [
# NOTICE: Since common_inherited_config is used in public_configs for our
# targets, there's no point including the defines in that config here.
# TODO(kjellander): Cleanup unused ones and move defines closer to the
# source when webrtc:4256 is completed.
"HAVE_SRTP",
"HAVE_WEBRTC_VIDEO",
"HAVE_WEBRTC_VOICE",
"LOGGING_INSIDE_WEBRTC",
"USE_WEBRTC_DEV_BRANCH",
]
} else {
if (is_posix) {
# Enable more warnings: -Wextra is currently disabled in Chromium.
cflags = [
"-Wextra",
# Repeat some flags that get overridden by -Wextra.
"-Wno-unused-parameter",
"-Wno-missing-field-initializers",
"-Wno-strict-overflow",
]
cflags_cc = [
"-Wnon-virtual-dtor",
# This is enabled for clang; enable for gcc as well.
"-Woverloaded-virtual",
]
}
if (is_clang) {
cflags += [
"-Wimplicit-fallthrough",
"-Wthread-safety",
"-Winconsistent-missing-override",
"-Wundef",
]
}
}
if (current_cpu == "arm64") {
defines += [ "WEBRTC_ARCH_ARM64" ]
defines += [ "WEBRTC_HAS_NEON" ]
}
if (current_cpu == "arm") {
defines += [ "WEBRTC_ARCH_ARM" ]
if (arm_version >= 7) {
defines += [ "WEBRTC_ARCH_ARM_V7" ]
if (arm_use_neon) {
defines += [ "WEBRTC_HAS_NEON" ]
}
}
}
if (current_cpu == "mipsel") {
defines += [ "MIPS32_LE" ]
if (mips_float_abi == "hard") {
defines += [ "MIPS_FPU_LE" ]
}
if (mips_arch_variant == "r2") {
defines += [ "MIPS32_R2_LE" ]
}
if (mips_dsp_rev == 1) {
defines += [ "MIPS_DSP_R1_LE" ]
} else if (mips_dsp_rev == 2) {
defines += [
"MIPS_DSP_R1_LE",
"MIPS_DSP_R2_LE",
]
}
}
if (is_android && !is_clang) {
# The Android NDK doesn"t provide optimized versions of these
# functions. Ensure they are disabled for all compilers.
cflags += [
"-fno-builtin-cos",
"-fno-builtin-sin",
"-fno-builtin-cosf",
"-fno-builtin-sinf",
]
}
if (use_libfuzzer || use_drfuzz || use_afl) {
# Used in Chromium's overrides to disable logging
defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
}
}
config("common_objc") {
libs = [ "Foundation.framework" ]
}
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
if (!build_with_chromium) {
# Target to build all the WebRTC production code.
rtc_static_library("webrtc") {
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
# Only the root target should depend on this.
visibility = [ "//:default" ]
sources = [
# TODO(ossu): Keep this here until donwstream projects have updated.
# http://bugs.webrtc.org/6716
"call.h",
"config.h",
]
# complete_static_lib doesn't work on Mac since libtool cannot support
# multiple objects with the same filenames (https://bugs.webrtc.org/6418).
if (is_win || is_linux || is_android) {
complete_static_lib = true
} else {
# TODO(kjellander): Remove this whenever possible. GN's static_library
# target type requires at least one object to avoid errors linking.
sources += [ "no_op_function.cc" ]
}
defines = []
deps = [
":webrtc_common",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
"api",
"api:transport_api",
"audio",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
"base",
"call",
"common_audio",
"common_video",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
"logging",
"media",
"modules",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
"modules/video_capture:video_capture_internal_impl",
"p2p",
"pc",
"sdk",
RTCStats and RTCStatsReport added (webrtc/stats). The old and new getStats are very different. This CL proposes rewriting the new getStats from scratch with a bottom-up approach, starting with the fundamental stats classes. This will allow cleaner and more efficient code that is more aligned with the spec. RTCStats and subclasses are the equivalent to RTCStats and RTCStats- -derived dictionaries from the specs[1][2]. The dictionary members are public member variables of type RTCStatsMember<T>, where T is one of the supported types. All members derive from RTCStatsMemberInterface and iteration of members is possible with RTCStats::Members(). The members are not stored in a map for performance and readability. Type checking is supported with static class variables, kType. Only the supported member types T are specialized and may be instantiated, and sequences are supported with std::vector<...>. Type checking is again supported with static class variables, kType. RTCStatsReport is the equivalent from the spec[3], and maps RTCStats::id to RTCStats-objects. RTCStatsReport is reference counted. It and its contained stats may be destroyed on any thread. When the RTCStatsCollector is added in a follow-up CL, it will return const references to the RTCStatsReports. This means copies don't have to be made for multiple stats observers or when jumping threads. In fact, no copies of any stats will have to be made in surfacing stats to Blink. [1] https://www.w3.org/TR/2016/WD-webrtc-20160531/#rtcstats-dictionary [2] https://w3c.github.io/webrtc-stats/archives/20160526/webrtc-stats.html [3] https://www.w3.org/TR/2016/WD-webrtc-20160531/#rtcstatsreport-object This adds the new folder webrtc/stats/, with target rtc_stats and binary rtc_stats_unittests. Public api headers are placed in webrtc/api/ and .cc files are placed in webrtc/stats/. BUG=chromium:627816 Review-Url: https://codereview.webrtc.org/2241093002 Cr-Commit-Position: refs/heads/master@{#13879}
2016-08-24 01:33:13 -07:00
"stats",
"system_wrappers",
"video",
"voice_engine",
]
if (rtc_enable_protobuf) {
defines += [ "ENABLE_RTC_EVENT_LOG" ]
deps += [ "logging:rtc_event_log_proto" ]
}
}
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
if (rtc_include_tests) {
# Target to build all the WebRTC tests (but not examples or tools).
# Executable in order to get a target that links all WebRTC code.
rtc_executable("webrtc_tests") {
testonly = true
# Only the root target should depend on this.
visibility = [ "//:default" ]
deps = [
":rtc_unittests",
":video_engine_tests",
":webrtc_nonparallel_tests",
":webrtc_perf_tests",
"api:rtc_api_unittests",
"base:rtc_base_tests_utils",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
"common_audio:common_audio_unittests",
"common_video:common_video_unittests",
"media:rtc_media_unittests",
"modules:modules_tests",
"modules:modules_unittests",
"modules/audio_coding:audio_coding_tests",
"modules/audio_processing:audio_processing_tests",
"modules/rtp_rtcp:test_packet_masks_metrics",
"modules/video_capture:video_capture_internal_impl",
"modules/video_coding:plot_videoprocessor_integrationtest",
"ortc:ortc_unittests",
"pc:peerconnection_unittests",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
"pc:rtc_pc_unittests",
"stats:rtc_stats_unittests",
"system_wrappers:system_wrappers_unittests",
"test",
"video:screenshare_loopback",
"video:video_loopback",
"video:video_tests",
"voice_engine:voe_cmd_test",
"voice_engine:voice_engine_unittests",
]
if (is_android) {
deps += [
":android_junit_tests",
"//webrtc/sdk/android:libjingle_peerconnection_android_unittest",
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
]
} else {
deps += [ "modules/video_capture:video_capture_tests" ]
}
if (!is_ios) {
deps += [
"modules/audio_device:audio_device_tests",
"voice_engine:voe_auto_test",
]
}
if (rtc_enable_protobuf) {
deps += [ "logging:rtc_event_log2rtp_dump" ]
}
GN: New conventions, default target and refactorings Introduce a convention on categorizing GN targets: 1. Production code 2. Tests 3. Examples 4. Tools The first two have targets spread out all over the tree, while the latter are isolated to examples/ and tools/ directories. Another new convention: Each directory's BUILD.gn file shall contain a target named similar to the directory name. This target shall contain the 'most common' production code, i.e. so that most consumers of the directory can depend on only the directory (which implicitly means that target in GN). //webrtc:webrtc_tests is changed to depend on all WebRTC tests. From now on, it's necessary to add new test targets to this dependency tree in order to get them compiled. Two new group targets are created: //webrtc/modules/audio_coding:audio_coding_tests //webrtc/modules/audio_processing:audio_processing_tests to reduce the long list of tests in //webrtc:webrtc_tests. Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted to the root target, to avoid circular dependencies due to the monolithic property of these targets (a problem we've had in the past). The 'root' target at the top level is renamed to 'default', which means GN will build this target instead of _all_ generated targets (see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default). This target now depends on everything we want to build, meaning all targets now explicitly needs to be wired up from the root target in order to get build. Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build. BUG=webrtc:6440 TESTED=git cl try --clobber NOTRY=True Review-Url: https://codereview.webrtc.org/2441383002 Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 05:44:03 -07:00
}
}
}
rtc_static_library("webrtc_common") {
sources = [
"common_types.cc",
"common_types.h",
"config.cc",
"config.h",
"typedefs.h",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
if (use_libfuzzer || use_drfuzz || use_afl) {
# This target is only here for gn to discover fuzzer build targets under
# webrtc/test/fuzzers/.
group("webrtc_fuzzers_dummy") {
testonly = true
deps = [
"test/fuzzers:webrtc_fuzzer_main",
]
}
}
if (rtc_include_tests) {
config("rtc_unittests_config") {
# GN orders flags on a target before flags from configs. The default config
# adds -Wall, and this flag have to be after -Wall -- so they need to
# come from a config and can"t be on the target directly.
if (is_clang) {
cflags = [
"-Wno-sign-compare",
"-Wno-unused-const-variable",
]
}
}
rtc_test("rtc_unittests") {
testonly = true
deps = [
"base:rtc_base_approved_unittests",
"base:rtc_base_unittests",
"base:rtc_numerics_unittests",
"base:rtc_task_queue_unittests",
"p2p:libstunprober_unittests",
"p2p:rtc_p2p_unittests",
"system_wrappers:metrics_default",
]
if (rtc_enable_protobuf) {
deps += [ "logging:rtc_event_log_tests" ]
}
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
shard_timeout = 900
}
if (is_ios || is_mac) {
deps += [ "sdk:rtc_sdk_peerconnection_objc_unittests" ]
}
}
# TODO(pbos): Rename test suite, this is no longer "just" for video targets.
video_engine_tests_resources = [
"//resources/foreman_cif_short.yuv",
"//resources/voice_engine/audio_long16.pcm",
]
if (is_ios) {
bundle_data("video_engine_tests_bundle_data") {
testonly = true
sources = video_engine_tests_resources
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
}
rtc_test("video_engine_tests") {
testonly = true
deps = [
"audio:audio_tests",
"base:rtc_base_tests_utils",
"call:call_tests",
"modules/video_capture",
"test:test_common",
"test:test_main",
"test:video_test_common",
"video:video_tests",
]
data = video_engine_tests_resources
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
if (is_android) {
deps += [ "//testing/android/native_test:native_test_native_code" ]
shard_timeout = 900
}
if (is_ios) {
deps += [ ":video_engine_tests_bundle_data" ]
}
}
webrtc_perf_tests_resources = [
"//resources/audio_coding/speech_mono_16kHz.pcm",
"//resources/audio_coding/speech_mono_32_48kHz.pcm",
"//resources/audio_coding/testfile32kHz.pcm",
"//resources/ConferenceMotion_1280_720_50.yuv",
"//resources/difficult_photo_1850_1110.yuv",
"//resources/foreman_cif.yuv",
"//resources/google-wifi-3mbps.rx",
"//resources/paris_qcif.yuv",
"//resources/photo_1850_1110.yuv",
"//resources/presentation_1850_1110.yuv",
"//resources/verizon4g-downlink.rx",
"//resources/voice_engine/audio_long16.pcm",
"//resources/web_screenshot_1850_1110.yuv",
]
if (is_ios) {
bundle_data("webrtc_perf_tests_bundle_data") {
testonly = true
sources = webrtc_perf_tests_resources
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
}
rtc_test("webrtc_perf_tests") {
testonly = true
configs += [ ":rtc_unittests_config" ]
deps = [
"call:call_perf_tests",
"modules/audio_coding:audio_coding_perf_tests",
"modules/audio_processing:audio_processing_perf_tests",
"modules/remote_bitrate_estimator:remote_bitrate_estimator_perf_tests",
"test:test_main",
"video:video_full_stack_tests",
"video:video_quality_test",
]
data = webrtc_perf_tests_resources
if (is_android) {
deps += [ "//testing/android/native_test:native_test_native_code" ]
shard_timeout = 2700
}
if (is_ios) {
deps += [ ":webrtc_perf_tests_bundle_data" ]
}
}
rtc_test("webrtc_nonparallel_tests") {
testonly = true
deps = [
"base:rtc_base_nonparallel_tests",
]
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
shard_timeout = 900
}
}
Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2345163003/ ) Reason for revert: Bring back the include I managed to accidentally remove. Original issue's description: > Revert of Fix android_junit_tests and add a GN target for them. (patchset #3 id:90001 of https://codereview.webrtc.org/2344133002/ ) > > Reason for revert: > Breaks bots. > > Original issue's description: > > Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2341213003/ ) > > > > Reason for revert: > > Fix the issue. > > > > Original issue's description: > > > Revert of Fix android_junit_tests and add a GN target for them. (patchset #1 id:20001 of https://codereview.webrtc.org/2346793002/ ) > > > > > > Reason for revert: > > > Breaks WebRTC in Chrome on Android: > > > > > > https://build.chromium.org/p/chromium.webrtc.fyi/waterfall?builder=Android%20Builder%20(dbg) > > > > > > Original issue's description: > > > > Fix android_junit_tests and add a GN target for them. > > > > > > > > BUG=webrtc:6365 > > > > NOTRY=True > > > > > > > > Committed: https://crrev.com/bb716daea73889517f996aa29f867563ed63d58a > > > > Cr-Commit-Position: refs/heads/master@{#14241} > > > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,sakal@webrtc.org > > > # Skipping CQ checks because original CL landed less than 1 days ago. > > > NOPRESUBMIT=true > > > NOTREECHECKS=true > > > NOTRY=true > > > BUG=webrtc:6365 > > > > > > Committed: https://crrev.com/9adb1ff9439aecf4e8ac3972a631bb74df2b6868 > > > Cr-Commit-Position: refs/heads/master@{#14253} > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:6365 > > > > Committed: https://crrev.com/51fe1d805d19bf7c79aad46049d040fae1ae6953 > > Cr-Commit-Position: refs/heads/master@{#14254} > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6365 > > Committed: https://crrev.com/1431d49ea073d88b65303ab843545678fbb6e9f9 > Cr-Commit-Position: refs/heads/master@{#14255} TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6365 Review-Url: https://codereview.webrtc.org/2348663003 Cr-Commit-Position: refs/heads/master@{#14264}
2016-09-16 07:22:17 -07:00
if (is_android) {
junit_binary("android_junit_tests") {
java_files = [
"examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
"examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
"examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
"sdk/android/tests/src/org/webrtc/CameraEnumerationTest.java",
]
Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2345163003/ ) Reason for revert: Bring back the include I managed to accidentally remove. Original issue's description: > Revert of Fix android_junit_tests and add a GN target for them. (patchset #3 id:90001 of https://codereview.webrtc.org/2344133002/ ) > > Reason for revert: > Breaks bots. > > Original issue's description: > > Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2341213003/ ) > > > > Reason for revert: > > Fix the issue. > > > > Original issue's description: > > > Revert of Fix android_junit_tests and add a GN target for them. (patchset #1 id:20001 of https://codereview.webrtc.org/2346793002/ ) > > > > > > Reason for revert: > > > Breaks WebRTC in Chrome on Android: > > > > > > https://build.chromium.org/p/chromium.webrtc.fyi/waterfall?builder=Android%20Builder%20(dbg) > > > > > > Original issue's description: > > > > Fix android_junit_tests and add a GN target for them. > > > > > > > > BUG=webrtc:6365 > > > > NOTRY=True > > > > > > > > Committed: https://crrev.com/bb716daea73889517f996aa29f867563ed63d58a > > > > Cr-Commit-Position: refs/heads/master@{#14241} > > > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,sakal@webrtc.org > > > # Skipping CQ checks because original CL landed less than 1 days ago. > > > NOPRESUBMIT=true > > > NOTREECHECKS=true > > > NOTRY=true > > > BUG=webrtc:6365 > > > > > > Committed: https://crrev.com/9adb1ff9439aecf4e8ac3972a631bb74df2b6868 > > > Cr-Commit-Position: refs/heads/master@{#14253} > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:6365 > > > > Committed: https://crrev.com/51fe1d805d19bf7c79aad46049d040fae1ae6953 > > Cr-Commit-Position: refs/heads/master@{#14254} > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6365 > > Committed: https://crrev.com/1431d49ea073d88b65303ab843545678fbb6e9f9 > Cr-Commit-Position: refs/heads/master@{#14255} TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6365 Review-Url: https://codereview.webrtc.org/2348663003 Cr-Commit-Position: refs/heads/master@{#14264}
2016-09-16 07:22:17 -07:00
deps = [
"//base:base_java_test_support",
"//webrtc/examples:AppRTCMobile_javalib",
"//webrtc/sdk/android:libjingle_peerconnection_java",
Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2345163003/ ) Reason for revert: Bring back the include I managed to accidentally remove. Original issue's description: > Revert of Fix android_junit_tests and add a GN target for them. (patchset #3 id:90001 of https://codereview.webrtc.org/2344133002/ ) > > Reason for revert: > Breaks bots. > > Original issue's description: > > Reland of Fix android_junit_tests and add a GN target for them. (patchset #1 id:1 of https://codereview.webrtc.org/2341213003/ ) > > > > Reason for revert: > > Fix the issue. > > > > Original issue's description: > > > Revert of Fix android_junit_tests and add a GN target for them. (patchset #1 id:20001 of https://codereview.webrtc.org/2346793002/ ) > > > > > > Reason for revert: > > > Breaks WebRTC in Chrome on Android: > > > > > > https://build.chromium.org/p/chromium.webrtc.fyi/waterfall?builder=Android%20Builder%20(dbg) > > > > > > Original issue's description: > > > > Fix android_junit_tests and add a GN target for them. > > > > > > > > BUG=webrtc:6365 > > > > NOTRY=True > > > > > > > > Committed: https://crrev.com/bb716daea73889517f996aa29f867563ed63d58a > > > > Cr-Commit-Position: refs/heads/master@{#14241} > > > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,sakal@webrtc.org > > > # Skipping CQ checks because original CL landed less than 1 days ago. > > > NOPRESUBMIT=true > > > NOTREECHECKS=true > > > NOTRY=true > > > BUG=webrtc:6365 > > > > > > Committed: https://crrev.com/9adb1ff9439aecf4e8ac3972a631bb74df2b6868 > > > Cr-Commit-Position: refs/heads/master@{#14253} > > > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:6365 > > > > Committed: https://crrev.com/51fe1d805d19bf7c79aad46049d040fae1ae6953 > > Cr-Commit-Position: refs/heads/master@{#14254} > > TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6365 > > Committed: https://crrev.com/1431d49ea073d88b65303ab843545678fbb6e9f9 > Cr-Commit-Position: refs/heads/master@{#14255} TBR=magjed@webrtc.org,kjellander@webrtc.org,henrika@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6365 Review-Url: https://codereview.webrtc.org/2348663003 Cr-Commit-Position: refs/heads/master@{#14264}
2016-09-16 07:22:17 -07:00
]
}
}
}