Revert of Enable GN check for webrtc/base (patchset #9 id:350001 of https://codereview.webrtc.org/2840453004/ )
Reason for revert:
It causes a Chromium build error:
ERROR at //third_party/webrtc/test/BUILD.gn:113:5: Can't load input file.
"//third_party/gflags",
Original issue's description:
> Reland of Enable GN check for webrtc/base (patchset #3 id:230001 of https://codereview.webrtc.org/2838683002/ )
>
> Reason for revert:
> Try to fix the webrtc/test/fuzzers issue and reland this CL because it
> contains lots of fixes for our BUILD.gn files.
>
> Original issue's description:
> > Revert of Enable GN check for webrtc/base (patchset #13 id:240001 of https://codereview.webrtc.org/2717083002/ )
> >
> > Reason for revert:
> > Breaks Chromium because in Chromium we import WebRTC with rtc_include_tests=false (https://bugs.chromium.org/p/chromium/issues/detail?id=713179#c6).
> >
> > Chromium uses webrtc/test/fuzzers and this CL adds test dependencies to neteq_rtc_fuzzer.
> >
> > Original issue's description:
> > > Enable GN check for webrtc/base
> > >
> > > It's not possible to enable it for the rtc_base_approved
> > > target but since a larger refactoring is ongoing for webrtc/base
> > > this CL doesn't attempt to fix that.
> > >
> > > Changes made:
> > > * Move webrtc/system_wrappers/include/stringize_macros.h into
> > > webrtc/base:rtc_base_approved_unittests (and corresponding
> > > unit test to rtc_base_approved_unittests).
> > > * Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
> > > * Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
> > > webrtc/base.
> > > * Remove unused use include of webrtc/base/fileutils.h in
> > > webrtc/base/pathutils.cc
> > >
> > > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > > NOTRY=True
> > >
> > > Review-Url: https://codereview.webrtc.org/2717083002
> > > Cr-Commit-Position: refs/heads/master@{#17766}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/ed754e71ae8866db641677073274e86fe704eeac
> >
> > TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > NOTRY=True
> >
> > Review-Url: https://codereview.webrtc.org/2838683002
> > Cr-Commit-Position: refs/heads/master@{#17849}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/11ed366c487a938815cd52ad2ab5467b0f90e1ae
>
> TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6828, webrtc:3806, webrtc:7480
>
> Review-Url: https://codereview.webrtc.org/2840453004
> Cr-Commit-Position: refs/heads/master@{#17876}
> Committed: https://chromium.googlesource.com/external/webrtc/+/7054085e59c3123613cd0014bedb0fe91a56e26f
TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6828, webrtc:3806, webrtc:7480
Review-Url: https://codereview.webrtc.org/2846483002
Cr-Commit-Position: refs/heads/master@{#17877}
diff --git a/.gn b/.gn
index a6b4af7..f968276 100644
--- a/.gn
+++ b/.gn
@@ -24,7 +24,6 @@
check_targets = [
"//webrtc/api/*",
"//webrtc/audio/*",
- "//webrtc/base/*",
"//webrtc/call/*",
"//webrtc/common_video/*",
"//webrtc/common_audio/*",
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 2a17d92..a3ee03f 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -92,10 +92,6 @@
# The subset of rtc_base approved for use outside of libjingle.
rtc_static_library("rtc_base_approved") {
- # TODO(kjellander): Remove (bugs.webrtc.org/7480)
- # Enabling GN check triggers a cyclic dependency caused by rate_limiter.cc:
- # :rtc_base_approved -> //webrtc/system_wrappers -> :rtc_base_approved
- check_includes = false
defines = []
libs = []
deps = []
@@ -140,6 +136,8 @@
"location.h",
"md5.cc",
"md5.h",
+ "md5digest.cc",
+ "md5digest.h",
"mod_ops.h",
"onetimeevent.h",
"optional.cc",
@@ -174,7 +172,6 @@
"string_to_number.h",
"stringencode.cc",
"stringencode.h",
- "stringize_macros.h",
"stringutils.cc",
"stringutils.h",
"swap_queue.h",
@@ -658,74 +655,21 @@
]
}
-config("rtc_base_tests_utils_exported_config") {
- defines = [ "GTEST_RELATIVE_PATH" ]
-}
-
-config("rtc_base_tests_utils_warnings_config") {
- if (is_win && is_clang) {
- cflags = [
- # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270
- "-Wno-reorder",
- "-Wno-sign-compare",
- ]
- }
-}
-
-rtc_source_set("rtc_base_tests_utils") {
- testonly = true
- sources = [
- # Also use this as a convenient dumping ground for misc files that are
- # included by multiple targets below.
- "cpu_time.cc",
- "cpu_time.h",
- "fakeclock.cc",
- "fakeclock.h",
- "fakenetwork.h",
- "fakesslidentity.h",
- "firewallsocketserver.cc",
- "firewallsocketserver.h",
- "gunit.h",
- "httpserver.cc",
- "httpserver.h",
- "md5digest.cc",
- "md5digest.h",
- "memory_usage.cc",
- "memory_usage.h",
- "natserver.cc",
- "natserver.h",
- "natsocketfactory.cc",
- "natsocketfactory.h",
- "nattypes.cc",
- "nattypes.h",
- "proxyserver.cc",
- "proxyserver.h",
- "sigslottester.h",
- "sigslottester.h.pump",
- "testbase64.h",
- "testechoserver.h",
- "testutils.h",
- "timedelta.h",
- ]
- configs += [ ":rtc_base_tests_utils_warnings_config" ]
- public_configs = [ ":rtc_base_tests_utils_exported_config" ]
- deps = [
- ":rtc_base",
- "../test:field_trial",
- "../test:test_support",
- ]
- public_deps = [
- "//testing/gmock",
- "//testing/gtest",
- ]
-
- 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 (rtc_include_tests) {
+ config("rtc_base_tests_utils_exported_config") {
+ defines = [ "GTEST_RELATIVE_PATH" ]
+ }
+
+ config("rtc_base_tests_utils_warnings_config") {
+ if (is_win && is_clang) {
+ cflags = [
+ # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6270
+ "-Wno-reorder",
+ "-Wno-sign-compare",
+ ]
+ }
+ }
+
rtc_source_set("rtc_base_tests_main") {
testonly = true
sources = [
@@ -733,9 +677,56 @@
]
public_configs = [ ":rtc_base_tests_utils_exported_config" ]
deps = [
- ":rtc_base",
- ":rtc_base_approved",
":rtc_base_tests_utils",
+ ]
+ public_deps = [
+ "//testing/gmock",
+ "//testing/gtest",
+ ]
+
+ 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" ]
+ }
+ }
+
+ rtc_source_set("rtc_base_tests_utils") {
+ testonly = true
+ sources = [
+ # Also use this as a convenient dumping ground for misc files that are
+ # included by multiple targets below.
+ "cpu_time.cc",
+ "cpu_time.h",
+ "fakeclock.cc",
+ "fakeclock.h",
+ "fakenetwork.h",
+ "fakesslidentity.h",
+ "firewallsocketserver.cc",
+ "firewallsocketserver.h",
+ "gunit.h",
+ "httpserver.cc",
+ "httpserver.h",
+ "memory_usage.cc",
+ "memory_usage.h",
+ "natserver.cc",
+ "natserver.h",
+ "natsocketfactory.cc",
+ "natsocketfactory.h",
+ "nattypes.cc",
+ "nattypes.h",
+ "proxyserver.cc",
+ "proxyserver.h",
+ "sigslottester.h",
+ "sigslottester.h.pump",
+ "testbase64.h",
+ "testechoserver.h",
+ "testutils.h",
+ "timedelta.h",
+ ]
+ configs += [ ":rtc_base_tests_utils_warnings_config" ]
+ public_configs = [ ":rtc_base_tests_utils_exported_config" ]
+ deps = [
+ ":rtc_base",
"../test:field_trial",
"../test:test_support",
]
@@ -772,9 +763,6 @@
deps = [
":rtc_base",
":rtc_base_tests_main",
- ":rtc_base_tests_utils",
- "../system_wrappers:system_wrappers",
- "../test:test_support",
"//testing/gtest",
]
if (is_win) {
@@ -829,7 +817,6 @@
"safe_minmax_unittest.cc",
"string_to_number_unittest.cc",
"stringencode_unittest.cc",
- "stringize_macros_unittest.cc",
"stringutils_unittest.cc",
"swap_queue_unittest.cc",
"thread_annotations_unittest.cc",
@@ -838,13 +825,8 @@
"timeutils_unittest.cc",
]
deps = [
- ":rtc_base",
":rtc_base_approved",
":rtc_base_tests_main",
- ":rtc_base_tests_utils",
- ":rtc_task_queue",
- "../system_wrappers:system_wrappers",
- "../test:test_support",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
@@ -868,9 +850,7 @@
]
deps = [
":rtc_base_tests_main",
- ":rtc_base_tests_utils",
":rtc_task_queue",
- "../test:test_support",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
@@ -892,10 +872,8 @@
"numerics/percentile_filter_unittest.cc",
]
deps = [
- ":rtc_base_approved",
":rtc_base_tests_main",
":rtc_numerics",
- "../test:test_support",
]
}
@@ -961,8 +939,6 @@
}
deps = [
":rtc_base_tests_main",
- ":rtc_base_tests_utils",
- "../test:test_support",
]
public_deps = [
":rtc_base",
diff --git a/webrtc/base/location.h b/webrtc/base/location.h
index 541be9a..a541bbe 100644
--- a/webrtc/base/location.h
+++ b/webrtc/base/location.h
@@ -13,7 +13,7 @@
#include <string>
-#include "webrtc/base/stringize_macros.h"
+#include "webrtc/system_wrappers/include/stringize_macros.h"
namespace rtc {
diff --git a/webrtc/base/pathutils.cc b/webrtc/base/pathutils.cc
index 3036774..75dabb5 100644
--- a/webrtc/base/pathutils.cc
+++ b/webrtc/base/pathutils.cc
@@ -16,6 +16,7 @@
#endif // WEBRTC_WIN
#include "webrtc/base/checks.h"
+#include "webrtc/base/fileutils.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/pathutils.h"
#include "webrtc/base/stringutils.h"
diff --git a/webrtc/common_audio/resampler/sinc_resampler_unittest.cc b/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
index 990580d..82546d0 100644
--- a/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
+++ b/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
@@ -19,11 +19,11 @@
#include <algorithm>
#include <memory>
-#include "webrtc/base/stringize_macros.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/common_audio/resampler/sinc_resampler.h"
#include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h"
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
+#include "webrtc/system_wrappers/include/stringize_macros.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 3d7cce2..4a2fdca 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -1130,101 +1130,6 @@
]
}
-config("neteq_unittest_tools_config") {
- include_dirs = [ "tools" ]
-}
-
-rtc_source_set("neteq_unittest_tools") {
- testonly = true
- sources = [
- "neteq/tools/audio_checksum.h",
- "neteq/tools/audio_loop.cc",
- "neteq/tools/audio_loop.h",
- "neteq/tools/audio_sink.cc",
- "neteq/tools/audio_sink.h",
- "neteq/tools/constant_pcm_packet_source.cc",
- "neteq/tools/constant_pcm_packet_source.h",
- "neteq/tools/fake_decode_from_file.cc",
- "neteq/tools/fake_decode_from_file.h",
- "neteq/tools/input_audio_file.cc",
- "neteq/tools/input_audio_file.h",
- "neteq/tools/neteq_input.h",
- "neteq/tools/neteq_replacement_input.cc",
- "neteq/tools/neteq_replacement_input.h",
- "neteq/tools/output_audio_file.h",
- "neteq/tools/output_wav_file.h",
- "neteq/tools/packet.cc",
- "neteq/tools/packet.h",
- "neteq/tools/packet_source.cc",
- "neteq/tools/packet_source.h",
- "neteq/tools/resample_input_audio_file.cc",
- "neteq/tools/resample_input_audio_file.h",
- "neteq/tools/rtp_file_source.cc",
- "neteq/tools/rtp_file_source.h",
- "neteq/tools/rtp_generator.cc",
- "neteq/tools/rtp_generator.h",
- ]
-
- public_configs = [ ":neteq_unittest_tools_config" ]
-
- 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" ]
- }
-
- deps = [
- ":audio_encoder_interface",
- ":pcm16b",
- "../..:webrtc_common",
- "../../api/audio_codecs:audio_codecs_api",
- "../../base:rtc_base_approved",
- "../../base:rtc_base_tests_utils",
- "../../common_audio",
- "../../test:rtp_test_utils",
- "../rtp_rtcp",
- ]
-
- public_deps = [
- ":neteq_test_minimal",
- ]
-
- if (rtc_enable_protobuf) {
- sources += [
- "neteq/tools/neteq_packet_source_input.cc",
- "neteq/tools/neteq_packet_source_input.h",
- ]
- deps += [ ":rtc_event_log_source" ]
- }
-}
-
-if (rtc_enable_protobuf) {
- rtc_static_library("rtc_event_log_source") {
- testonly = true
-
- # TODO(kjellander): Remove (bugs.webrtc.org/6828)
- # Needs call.h to be moved to webrtc/api first.
- check_includes = false
-
- sources = [
- "neteq/tools/rtc_event_log_source.cc",
- "neteq/tools/rtc_event_log_source.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" ]
- }
-
- deps = [
- "../../base:rtc_base_approved",
- "../../logging:rtc_event_log_parser",
- ]
- public_deps = [
- "../../logging:rtc_event_log_proto",
- ]
- }
-}
-
if (rtc_include_tests) {
group("audio_coding_tests") {
testonly = true
@@ -1495,6 +1400,32 @@
proto_out_dir = "webrtc/modules/audio_coding/neteq"
}
+ rtc_static_library("rtc_event_log_source") {
+ testonly = true
+
+ # TODO(kjellander): Remove (bugs.webrtc.org/6828)
+ # Needs call.h to be moved to webrtc/api first.
+ check_includes = false
+
+ sources = [
+ "neteq/tools/rtc_event_log_source.cc",
+ "neteq/tools/rtc_event_log_source.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" ]
+ }
+
+ deps = [
+ "../../base:rtc_base_approved",
+ "../../logging:rtc_event_log_parser",
+ ]
+ public_deps = [
+ "../../logging:rtc_event_log_proto",
+ ]
+ }
+
rtc_test("neteq_rtpplay") {
testonly = true
defines = []
@@ -1612,6 +1543,72 @@
]
}
+ config("neteq_unittest_tools_config") {
+ include_dirs = [ "tools" ]
+ }
+
+ rtc_source_set("neteq_unittest_tools") {
+ testonly = true
+ sources = [
+ "neteq/tools/audio_checksum.h",
+ "neteq/tools/audio_loop.cc",
+ "neteq/tools/audio_loop.h",
+ "neteq/tools/audio_sink.cc",
+ "neteq/tools/audio_sink.h",
+ "neteq/tools/constant_pcm_packet_source.cc",
+ "neteq/tools/constant_pcm_packet_source.h",
+ "neteq/tools/fake_decode_from_file.cc",
+ "neteq/tools/fake_decode_from_file.h",
+ "neteq/tools/input_audio_file.cc",
+ "neteq/tools/input_audio_file.h",
+ "neteq/tools/neteq_input.h",
+ "neteq/tools/neteq_replacement_input.cc",
+ "neteq/tools/neteq_replacement_input.h",
+ "neteq/tools/output_audio_file.h",
+ "neteq/tools/output_wav_file.h",
+ "neteq/tools/packet.cc",
+ "neteq/tools/packet.h",
+ "neteq/tools/packet_source.cc",
+ "neteq/tools/packet_source.h",
+ "neteq/tools/resample_input_audio_file.cc",
+ "neteq/tools/resample_input_audio_file.h",
+ "neteq/tools/rtp_file_source.cc",
+ "neteq/tools/rtp_file_source.h",
+ "neteq/tools/rtp_generator.cc",
+ "neteq/tools/rtp_generator.h",
+ ]
+
+ public_configs = [ ":neteq_unittest_tools_config" ]
+
+ 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" ]
+ }
+
+ deps = [
+ ":audio_encoder_interface",
+ ":pcm16b",
+ "../..:webrtc_common",
+ "../../api/audio_codecs:audio_codecs_api",
+ "../../base:rtc_base_approved",
+ "../../common_audio",
+ "../../test:rtp_test_utils",
+ "../rtp_rtcp",
+ ]
+
+ public_deps = [
+ ":neteq_test_minimal",
+ ]
+
+ if (rtc_enable_protobuf) {
+ sources += [
+ "neteq/tools/neteq_packet_source_input.cc",
+ "neteq/tools/neteq_packet_source_input.h",
+ ]
+ deps += [ ":rtc_event_log_source" ]
+ }
+ }
+
rtc_source_set("neteq_test_tools") {
testonly = true
sources = [
diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn
index 325c016..6a056c2 100644
--- a/webrtc/system_wrappers/BUILD.gn
+++ b/webrtc/system_wrappers/BUILD.gn
@@ -27,6 +27,7 @@
"include/rw_lock_wrapper.h",
"include/sleep.h",
"include/static_instance.h",
+ "include/stringize_macros.h",
"include/timestamp_extrapolator.h",
"include/trace.h",
"source/aligned_malloc.cc",
@@ -210,6 +211,7 @@
"source/metrics_unittest.cc",
"source/ntp_time_unittest.cc",
"source/rtp_to_ntp_estimator_unittest.cc",
+ "source/stringize_macros_unittest.cc",
]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
diff --git a/webrtc/base/stringize_macros.h b/webrtc/system_wrappers/include/stringize_macros.h
similarity index 86%
rename from webrtc/base/stringize_macros.h
rename to webrtc/system_wrappers/include/stringize_macros.h
index 7e2f44d..9c8e7e9 100644
--- a/webrtc/base/stringize_macros.h
+++ b/webrtc/system_wrappers/include/stringize_macros.h
@@ -15,8 +15,8 @@
// symbols (or their output) and manipulating preprocessor symbols
// that define strings.
-#ifndef WEBRTC_BASE_STRINGIZE_MACROS_H_
-#define WEBRTC_BASE_STRINGIZE_MACROS_H_
+#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STRINGIZE_MACROS_H_
+#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STRINGIZE_MACROS_H_
// This is not very useful as it does not expand defined symbols if
// called directly. Use its counterpart without the _NO_EXPANSION
@@ -35,4 +35,4 @@
// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)"
#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x)
-#endif // WEBRTC_BASE_STRINGIZE_MACROS_H_
+#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STRINGIZE_MACROS_H_
diff --git a/webrtc/base/stringize_macros_unittest.cc b/webrtc/system_wrappers/source/stringize_macros_unittest.cc
similarity index 94%
rename from webrtc/base/stringize_macros_unittest.cc
rename to webrtc/system_wrappers/source/stringize_macros_unittest.cc
index d0ba113..8b103c5 100644
--- a/webrtc/base/stringize_macros_unittest.cc
+++ b/webrtc/system_wrappers/source/stringize_macros_unittest.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/base/stringize_macros.h"
+#include "webrtc/system_wrappers/include/stringize_macros.h"
#include "webrtc/test/gtest.h"
diff --git a/webrtc/test/fuzzers/BUILD.gn b/webrtc/test/fuzzers/BUILD.gn
index 9bc8785..74ea607 100644
--- a/webrtc/test/fuzzers/BUILD.gn
+++ b/webrtc/test/fuzzers/BUILD.gn
@@ -257,9 +257,8 @@
"neteq_rtp_fuzzer.cc",
]
deps = [
- "../../base:rtc_base_approved",
+ "../../modules/audio_coding:neteq",
"../../modules/audio_coding:neteq_test_minimal",
- "../../modules/audio_coding:neteq_unittest_tools",
"../../modules/audio_coding:pcm16b",
"../../modules/rtp_rtcp",
]
diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn
index 40d9ed3..ca774f2 100644
--- a/webrtc/voice_engine/BUILD.gn
+++ b/webrtc/voice_engine/BUILD.gn
@@ -181,7 +181,6 @@
":file_player",
":voice_engine",
"../base:rtc_base_approved",
- "../base:rtc_base_tests_utils",
"../test:test_common",
"//testing/gmock",
"//testing/gtest",