Chromium Code Reviews| Index: webrtc/pc/BUILD.gn | 
| diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn | 
| index 483485012da481803fe641f220ef643832af61bb..201b7f4136d7a21fce19b2f8a1e25cc25fb07e7d 100644 | 
| --- a/webrtc/pc/BUILD.gn | 
| +++ b/webrtc/pc/BUILD.gn | 
| @@ -25,7 +25,7 @@ config("rtc_pc_config") { | 
| } | 
| } | 
| -rtc_static_library("rtc_pc") { | 
| +rtc_static_library("rtc_pc_base") { | 
| defines = [] | 
| sources = [ | 
| "audiomonitor.cc", | 
| @@ -56,7 +56,7 @@ rtc_static_library("rtc_pc") { | 
| deps = [ | 
| "../api:call_api", | 
| "../base:rtc_base", | 
| - "../media", | 
| + "../media:rtc_data", | 
| ] | 
| if (rtc_build_libsrtp) { | 
| @@ -71,6 +71,18 @@ rtc_static_library("rtc_pc") { | 
| } | 
| } | 
| +# TODO(zhihuang): Remove this once the downstream dependencies start using the | 
| +# modular targets. | 
| +rtc_static_library("rtc_pc") { | 
| + public_deps = [ | 
| + ":rtc_pc_base", | 
| + ] | 
| + | 
| + deps = [ | 
| + "../media:rtc_audio_video", | 
| + ] | 
| +} | 
| + | 
| config("libjingle_peerconnection_warnings_config") { | 
| # GN orders flags on a target before flags from configs. The default config | 
| # adds these flags so to cancel them out they need to come from a config and | 
| @@ -80,7 +92,60 @@ config("libjingle_peerconnection_warnings_config") { | 
| } | 
| } | 
| -rtc_static_library("libjingle_peerconnection") { | 
| +rtc_static_library("webrtc_null_audio") { | 
| 
 
kjellander_webrtc
2017/05/29 20:59:15
How about using rtc instead of webrtc in all these
 
Taylor Brandstetter
2017/05/30 17:30:52
It would be useful to have a comment explaining ho
 
Zhi Huang
2017/05/31 00:03:29
Done.
 
Zhi Huang
2017/05/31 00:03:29
Sounds good to me.
 
Zhi Huang
2017/05/31 03:55:37
I just realized that if we follow the "rtc_..." pa
 
kjellander_webrtc
2017/06/01 05:34:30
AFAIK that is OK but you won't be able to build rt
 
 | 
| + sources = [ | 
| + "nullaudiofactory.cc", | 
| + ] | 
| + | 
| + 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_static_library("webrtc_audio") { | 
| + sources = [ | 
| + "audiofactory.cc", | 
| + ] | 
| + | 
| + public_deps = [ | 
| + "../media:rtc_audio_video", | 
| + ] | 
| + | 
| + 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_static_library("webrtc_null_media") { | 
| + sources = [ | 
| + "nullmediafactory.cc", | 
| + ] | 
| + | 
| + 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_static_library("webrtc_media") { | 
| + sources = [ | 
| + "mediafactory.cc", | 
| + ] | 
| + | 
| + deps = [ | 
| + "../call", | 
| + "../media:rtc_audio_video", | 
| + ] | 
| + | 
| + 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_static_library("webrtc_peerconnection") { | 
| cflags = [] | 
| sources = [ | 
| "audiotrack.cc", | 
| @@ -141,18 +206,28 @@ rtc_static_library("libjingle_peerconnection") { | 
| } | 
| deps = [ | 
| - ":rtc_pc", | 
| + ":rtc_pc_base", | 
| "../api:call_api", | 
| "../api:rtc_stats_api", | 
| "../api/video_codecs:video_codecs_api", | 
| - "../call", | 
| - "../media", | 
| + "../logging:rtc_event_log_api", | 
| "../stats", | 
| ] | 
| public_deps = [ | 
| "../api:libjingle_peerconnection_api", | 
| ] | 
| +} | 
| + | 
| +# TODO(zhihuang): Remove this once the downstream dependencies start using the | 
| +# modular targets. | 
| +rtc_static_library("libjingle_peerconnection") { | 
| + public_deps = [ | 
| + ":webrtc_audio", | 
| + ":webrtc_media", | 
| + ":webrtc_peerconnection", | 
| + "../api:libjingle_peerconnection_api", | 
| + ] | 
| if (rtc_use_quic) { | 
| sources += [ | 
| @@ -244,7 +319,6 @@ if (rtc_include_tests) { | 
| ] | 
| deps = [ | 
| - ":libjingle_peerconnection", | 
| "../base:rtc_base_tests_utils", | 
| "//testing/gmock", | 
| ] | 
| @@ -368,4 +442,69 @@ if (rtc_include_tests) { | 
| shard_timeout = 900 | 
| } | 
| } | 
| + | 
| + rtc_test("peerconnection_datachannelonly_unittests") { | 
| + check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828) | 
| 
 
kjellander_webrtc
2017/05/29 20:59:15
Is it possible to avoid this?
 
Zhi Huang
2017/05/31 00:03:29
Yep. :)
 
 | 
| + testonly = true | 
| + sources = [ | 
| + "peerconnection_datachannelonly_unittest.cc", | 
| + ] | 
| + | 
| + if (rtc_enable_sctp) { | 
| + defines = [ "HAVE_SCTP" ] | 
| + } | 
| + | 
| + configs += [ ":peerconnection_unittests_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" ] | 
| + } | 
| + | 
| + # TODO(jschuh): Bug 1348: fix this warning. | 
| + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 
| + | 
| + if (is_win) { | 
| + cflags = [ | 
| + "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. | 
| + "/wd4389", # signed/unsigned mismatch. | 
| + ] | 
| + } | 
| + | 
| + deps = [] | 
| + if (is_android) { | 
| + sources += [ | 
| + "test/androidtestinitializer.cc", | 
| + "test/androidtestinitializer.h", | 
| + ] | 
| + deps += [ | 
| + "//testing/android/native_test:native_test_support", | 
| + "//webrtc/sdk/android:base_jni", | 
| + "//webrtc/sdk/android:libjingle_peerconnection_java", | 
| + "//webrtc/sdk/android:webrtc_null_audio_jni", | 
| + "//webrtc/sdk/android:webrtc_null_video_jni", | 
| + ] | 
| + } | 
| + | 
| + deps += [ | 
| + ":pc_test_utils", | 
| + ":webrtc_null_audio", | 
| + ":webrtc_null_media", | 
| + ":webrtc_peerconnection", | 
| + "..:webrtc_common", | 
| + "../api:fakemetricsobserver", | 
| + "../base:rtc_base_tests_main", | 
| + "../base:rtc_base_tests_utils", | 
| + "../media:rtc_media_tests_utils", | 
| + "../pc:rtc_pc_base", | 
| + "../system_wrappers:metrics_default", | 
| + "//testing/gmock", | 
| + ] | 
| + | 
| + if (is_android) { | 
| + deps += [ "//testing/android/native_test:native_test_support" ] | 
| + | 
| 
 
kjellander_webrtc
2017/05/29 20:59:15
Remove blank line.
 
Zhi Huang
2017/05/31 00:03:29
Done.
 
 | 
| + shard_timeout = 900 | 
| + } | 
| + } | 
| } |