Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 4 additions & 26 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,11 @@ script_executable = "python3"
# in the source tree, e.g. for third party source trees.
secondary_source = "//build/secondary/"

# These are the targets to check headers for by default. The files in targets
# matching these patterns (see "gn help label_pattern" for format) will have
# These are the targets to skip header checking by default. The files in targets
# matching these patterns (see "gn help label_pattern" for format) will not have
# their includes checked for proper dependencies when you run either
# "gn check" or "gn gen --check".
check_targets = [
"//api/*",
"//audio/*",
"//backup/*",
"//call/*",
"//common_audio/*",
"//common_video/*",
"//examples/*",
"//logging/*",
"//media/*",
"//modules/*",
"//net/*",
"//p2p/*",
"//pc/*",
"//rtc_base/*",
"//rtc_tools/*",
"//sdk/*",
"//stats/*",
"//system_wrappers/*",
"//test/*",
"//video/*",
"//third_party/libyuv/*",
]
no_check_targets = [ "//third_party/icu/*" ]

# These are the list of GN files that run exec_script. This whitelist exists
# to force additional review for new uses of exec_script, which is strongly
Expand All @@ -66,7 +44,7 @@ default_args = {

mac_sdk_min = "10.12"

ios_deployment_target = "10.0"
ios_deployment_target = "12.0"

# The SDK API level, in contrast, is set by build/android/AndroidManifest.xml.
android32_ndk_api_level = 16
Expand Down
8 changes: 4 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,6 @@ config("common_config") {

config("common_objc") {
frameworks = [ "Foundation.framework" ]

if (rtc_use_metal_rendering) {
defines = [ "RTC_SUPPORTS_METAL" ]
}
}

if (!build_with_chromium) {
Expand Down Expand Up @@ -520,6 +516,10 @@ if (!build_with_chromium) {
rtc_executable("webrtc_lib_link_test") {
testonly = true

# This target is used for checking to link, so do not check dependencies
# on gn check.
check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/12785)

sources = [ "webrtc_lib_link_test.cc" ]
deps = [
# NOTE: Don't add deps here. If this test fails to link, it means you
Expand Down
181 changes: 113 additions & 68 deletions DEPS

Large diffs are not rendered by default.

113 changes: 65 additions & 48 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ def VerifyNativeApiHeadersListIsValid(input_api, output_api):
if non_existing_paths:
return [
output_api.PresubmitError(
'Directories to native API headers have changed which has made the '
'list in PRESUBMIT.py outdated.\nPlease update it to the current '
'location of our native APIs.', non_existing_paths)
'Directories to native API headers have changed which has made '
'the list in PRESUBMIT.py outdated.\nPlease update it to the '
'current location of our native APIs.', non_existing_paths)
]
return []

Expand Down Expand Up @@ -212,10 +212,10 @@ def CheckNoIOStreamInHeaders(input_api, output_api, source_file_filter):
if len(files):
return [
output_api.PresubmitError(
'Do not #include <iostream> in header files, since it inserts static '
+
'initialization into every file including the header. Instead, '
+ '#include <ostream>. See http://crbug.com/94794', files)
'Do not #include <iostream> in header files, since it inserts '
'static initialization into every file including the header. '
'Instead, #include <ostream>. See http://crbug.com/94794',
files)
]
return []

Expand All @@ -237,15 +237,15 @@ def CheckNoPragmaOnce(input_api, output_api, source_file_filter):
return [
output_api.PresubmitError(
'Do not use #pragma once in header files.\n'
'See http://www.chromium.org/developers/coding-style#TOC-File-headers',
'See http://www.chromium.org/developers/coding-style'
'#TOC-File-headers',
files)
]
return []


def CheckNoFRIEND_TEST(
def CheckNoFRIEND_TEST(# pylint: disable=invalid-name
input_api,
output_api, # pylint: disable=invalid-name
output_api,
source_file_filter):
"""Make sure that gtest's FRIEND_TEST() macro is not used, the
FRIEND_TEST_ALL_PREFIXES() macro from testsupport/gtest_prod_util.h should be
Expand All @@ -263,9 +263,9 @@ def CheckNoFRIEND_TEST(
return []
return [
output_api.PresubmitPromptWarning(
'WebRTC\'s code should not use '
'gtest\'s FRIEND_TEST() macro. Include testsupport/gtest_prod_util.h and '
'use FRIEND_TEST_ALL_PREFIXES() instead.\n' + '\n'.join(problems))
'WebRTC\'s code should not use gtest\'s FRIEND_TEST() macro. '
'Include testsupport/gtest_prod_util.h and use '
'FRIEND_TEST_ALL_PREFIXES() instead.\n' + '\n'.join(problems))
]


Expand Down Expand Up @@ -346,9 +346,9 @@ def CheckNoSourcesAbove(input_api, gn_files, output_api):
if violating_gn_files:
return [
output_api.PresubmitError(
'Referencing source files above the directory of the GN file is not '
'allowed. Please introduce new GN targets in the proper location '
'instead.\n'
'Referencing source files above the directory of the GN file '
'is not allowed. Please introduce new GN targets in the proper '
'location instead.\n'
'Invalid source entries:\n'
'%s\n'
'Violating GN files:' % '\n'.join(violating_source_entries),
Expand Down Expand Up @@ -407,9 +407,9 @@ def _MoreThanOneSourceUsed(*sources_lists):
gn_file_content = input_api.ReadFile(gn_file)
for target_match in TARGET_RE.finditer(gn_file_content):
# list_of_sources is a list of tuples of the form
# (c_files, cc_files, objc_files) that keeps track of all the sources
# defined in a target. A GN target can have more that on definition of
# sources (since it supports if/else statements).
# (c_files, cc_files, objc_files) that keeps track of all the
# sources defined in a target. A GN target can have more that
# on definition of sources (since it supports if/else statements).
# E.g.:
# rtc_static_library("foo") {
# if (is_win) {
Expand Down Expand Up @@ -454,7 +454,8 @@ def _MoreThanOneSourceUsed(*sources_lists):
return [
output_api.PresubmitError(
'GN targets cannot mix .c, .cc and .m (or .mm) source files.\n'
'Please create a separate target for each collection of sources.\n'
'Please create a separate target for each collection of '
'sources.\n'
'Mixed sources: \n'
'%s\n'
'Violating GN files:\n%s\n' %
Expand All @@ -476,8 +477,8 @@ def CheckNoPackageBoundaryViolations(input_api, gn_files, output_api):
if errors:
return [
output_api.PresubmitError(
'There are package boundary violations in the following GN files:',
long_text='\n\n'.join(str(err) for err in errors))
'There are package boundary violations in the following GN '
'files:', long_text='\n\n'.join(str(err) for err in errors))
]
return []

Expand All @@ -491,7 +492,7 @@ def CheckNoWarningSuppressionFlagsAreAdded(gn_files,
input_api,
output_api,
error_formatter=_ReportFileAndLine):
"""Make sure that warning suppression flags are not added wihtout a reason."""
"""Ensure warning suppression flags are not added wihtout a reason."""
msg = ('Usage of //build/config/clang:extra_warnings is discouraged '
'in WebRTC.\n'
'If you are not adding this code (e.g. you are just moving '
Expand Down Expand Up @@ -674,7 +675,8 @@ def CheckGnGen(input_api, output_api):
if errors:
return [
output_api.PresubmitPromptWarning(
'Some #includes do not match the build dependency graph. Please run:\n'
'Some #includes do not match the build dependency graph. '
'Please run:\n'
' gn gen --check <out_dir>',
long_text='\n\n'.join(errors))
]
Expand Down Expand Up @@ -729,18 +731,20 @@ def CheckUnwantedDependencies(input_api, output_api, source_file_filter):
if error_descriptions:
results.append(
output_api.PresubmitError(
'You added one or more #includes that violate checkdeps rules.\n'
'Check that the DEPS files in these locations contain valid rules.\n'
'See https://cs.chromium.org/chromium/src/buildtools/checkdeps/ for '
'more details about checkdeps.', error_descriptions))
'You added one or more #includes that violate checkdeps rules.'
'\nCheck that the DEPS files in these locations contain valid '
'rules.\nSee '
'https://cs.chromium.org/chromium/src/buildtools/checkdeps/ '
'for more details about checkdeps.', error_descriptions))
if warning_descriptions:
results.append(
output_api.PresubmitPromptOrNotify(
'You added one or more #includes of files that are temporarily\n'
'allowed but being removed. Can you avoid introducing the\n'
'#include? See relevant DEPS file(s) for details and contacts.\n'
'See https://cs.chromium.org/chromium/src/buildtools/checkdeps/ for '
'more details about checkdeps.', warning_descriptions))
'You added one or more #includes of files that are temporarily'
'\nallowed but being removed. Can you avoid introducing the\n'
'#include? See relevant DEPS file(s) for details and contacts.'
'\nSee '
'https://cs.chromium.org/chromium/src/buildtools/checkdeps/ '
'for more details about checkdeps.', warning_descriptions))
return results


Expand Down Expand Up @@ -787,9 +791,10 @@ def CheckChangeHasBugField(input_api, output_api):
else:
return [
output_api.PresubmitError(
'The "Bug: [bug number]" footer is mandatory. Please create a bug and '
'reference it using either of:\n'
' * https://bugs.webrtc.org - reference it using Bug: webrtc:XXXX\n'
'The "Bug: [bug number]" footer is mandatory. Please create a '
'bug and reference it using either of:\n'
' * https://bugs.webrtc.org - reference it using Bug: '
'webrtc:XXXX\n'
' * https://crbug.com - reference it using Bug: chromium:XXXXXX'
)
]
Expand Down Expand Up @@ -911,10 +916,19 @@ def CommonChecks(input_api, output_api):
results.extend(
input_api.canned_checks.CheckLicense(input_api, output_api,
_LicenseHeader(input_api)))

# TODO(bugs.webrtc.org/12114): Delete this filter and run pylint on
# all python files. This is a temporary solution.
python_file_filter = lambda f: (f.LocalPath().endswith('.py') and
source_file_filter(f))
python_changed_files = [f.LocalPath() for f in input_api.AffectedFiles(
file_filter=python_file_filter)]

results.extend(
input_api.canned_checks.RunPylint(
input_api,
output_api,
files_to_check=python_changed_files,
files_to_skip=(
r'^base[\\\/].*\.py$',
r'^build[\\\/].*\.py$',
Expand All @@ -932,12 +946,13 @@ def CommonChecks(input_api, output_api):
pylintrc='pylintrc'))

# TODO(nisse): talk/ is no more, so make below checks simpler?
# WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since
# we need to have different license checks in talk/ and webrtc/ directories.
# WebRTC can't use the presubmit_canned_checks.PanProjectChecks function
# since we need to have different license checks
# in talk/ and webrtc/directories.
# Instead, hand-picked checks are included below.

# .m and .mm files are ObjC files. For simplicity we will consider .h files in
# ObjC subdirectories ObjC headers.
# .m and .mm files are ObjC files. For simplicity we will consider
# .h files in ObjC subdirectories ObjC headers.
objc_filter_list = (r'.+\.m$', r'.+\.mm$', r'.+objc\/.+\.h$')
# Skip long-lines check for DEPS and GN files.
build_file_filter_list = (r'.+\.gn$', r'.+\.gni$', 'DEPS')
Expand Down Expand Up @@ -1163,9 +1178,9 @@ def CheckAbslMemoryInclude(input_api, output_api, source_file_filter):
if len(files):
return [
output_api.PresubmitError(
'Please include "absl/memory/memory.h" header for absl::WrapUnique.\n'
'This header may or may not be included transitively depending on the '
'C++ standard version.', files)
'Please include "absl/memory/memory.h" header for '
'absl::WrapUnique.\nThis header may or may not be included '
'transitively depending on the C++ standard version.', files)
]
return []

Expand Down Expand Up @@ -1343,13 +1358,15 @@ def CheckAddedDepsHaveTargetApprovals(input_api, output_api):
if input_api.tbr:
return [
output_api.PresubmitNotifyResult(
'--tbr was specified, skipping OWNERS check for DEPS additions'
'--tbr was specified, skipping OWNERS check for DEPS '
'additions'
)
]
if input_api.dry_run:
return [
output_api.PresubmitNotifyResult(
'This is a dry run, skipping OWNERS check for DEPS additions'
'This is a dry run, skipping OWNERS check for DEPS '
'additions'
)
]
if not input_api.change.issue:
Expand Down Expand Up @@ -1393,8 +1410,8 @@ def StripDeps(path):
if unapproved_dependencies:
output_list = [
output(
'You need LGTM from owners of depends-on paths in DEPS that were '
'modified in this CL:\n %s' %
'You need LGTM from owners of depends-on paths in DEPS that '
' were modified in this CL:\n %s' %
'\n '.join(sorted(unapproved_dependencies)))
]
suggested_owners = input_api.owners_client.SuggestOwners(
Expand Down
16 changes: 8 additions & 8 deletions api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ rtc_source_set("call_api") {
rtc_source_set("callfactory_api") {
visibility = [ "*" ]
sources = [ "call/call_factory_interface.h" ]
deps = [ "../rtc_base/system:rtc_export" ]
deps = [
"../call:rtp_interfaces",
"../rtc_base/system:rtc_export",
]
}

if (!build_with_chromium) {
Expand Down Expand Up @@ -135,14 +138,8 @@ rtc_library("libjingle_peerconnection_api") {
"jsep_ice_candidate.cc",
"jsep_ice_candidate.h",
"jsep_session_description.h",
"media_stream_proxy.h",
"media_stream_track_proxy.h",
"peer_connection_factory_proxy.h",
"peer_connection_interface.cc",
"peer_connection_interface.h",
"peer_connection_proxy.h",
"proxy.cc",
"proxy.h",
"rtp_receiver_interface.cc",
"rtp_receiver_interface.h",
"rtp_sender_interface.cc",
Expand All @@ -157,7 +154,7 @@ rtc_library("libjingle_peerconnection_api") {
"stats_types.h",
"turn_customizer.h",
"uma_metrics.h",
"video_track_source_proxy.h",
"video_track_source_proxy_factory.h",
]
deps = [
":array_view",
Expand All @@ -178,6 +175,7 @@ rtc_library("libjingle_peerconnection_api") {
":rtp_transceiver_direction",
":scoped_refptr",
":sequence_checker",
"../call:rtp_interfaces",
"../rtc_base:network_constants",
"adaptation:resource_adaptation_api",
"audio:audio_mixer_api",
Expand Down Expand Up @@ -1059,6 +1057,7 @@ if (rtc_include_tests) {
":time_controller",
"../call",
"../call:call_interfaces",
"../call:rtp_interfaces",
"../test/time_controller",
]
}
Expand Down Expand Up @@ -1103,6 +1102,7 @@ if (rtc_include_tests) {
"units:time_delta",
"units:timestamp",
"units:units_unittests",
"video:rtp_video_frame_assembler_unittests",
"video:video_unittests",
]
}
Expand Down
Loading