Skip to content

Commit 86d053c

Browse files
MirkoBonadeiCommit Bot
authored and
Commit Bot
committed
Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked into a shared library (and in order to support Chromium's component build mode, WebRTC needs to be linked as a shared library). Source sets always pass all the object files to the linker. On the flip side, source_sets link more object files in release builds and to avoid this, this CL introduces a the GN template "rtc_library" that expands to static_library during release builds and to source_set during component builds. See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set Bug: webrtc:9419 Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168 Commit-Queue: Mirko Bonadei <[email protected]> Reviewed-by: Karl Wiberg <[email protected]> Reviewed-by: Nico Weber <[email protected]> Cr-Commit-Position: refs/heads/master@{#29525}
1 parent e8b962b commit 86d053c

File tree

100 files changed

+729
-627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+729
-627
lines changed

api/BUILD.gn

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ rtc_source_set("callfactory_api") {
3939
}
4040

4141
if (!build_with_chromium) {
42-
rtc_source_set("create_peerconnection_factory") {
42+
rtc_library("create_peerconnection_factory") {
4343
visibility = [ "*" ]
4444
allow_poison = [ "default_task_queue" ]
4545
sources = [
@@ -66,7 +66,7 @@ if (!build_with_chromium) {
6666
}
6767
}
6868

69-
rtc_source_set("rtp_headers") {
69+
rtc_library("rtp_headers") {
7070
visibility = [ "*" ]
7171
sources = [
7272
"rtp_headers.cc",
@@ -81,7 +81,7 @@ rtc_source_set("rtp_headers") {
8181
]
8282
}
8383

84-
rtc_source_set("rtp_packet_info") {
84+
rtc_library("rtp_packet_info") {
8585
visibility = [ "*" ]
8686
sources = [
8787
"rtp_packet_info.cc",
@@ -100,7 +100,7 @@ rtc_source_set("rtp_packet_info") {
100100
]
101101
}
102102

103-
rtc_source_set("media_stream_interface") {
103+
rtc_library("media_stream_interface") {
104104
visibility = [ "*" ]
105105
sources = [
106106
"media_stream_interface.cc",
@@ -120,7 +120,7 @@ rtc_source_set("media_stream_interface") {
120120
]
121121
}
122122

123-
rtc_static_library("libjingle_peerconnection_api") {
123+
rtc_library("libjingle_peerconnection_api") {
124124
visibility = [ "*" ]
125125
cflags = []
126126
sources = [
@@ -215,7 +215,7 @@ rtc_static_library("libjingle_peerconnection_api") {
215215
]
216216
}
217217

218-
rtc_source_set("rtc_error") {
218+
rtc_library("rtc_error") {
219219
visibility = [ "*" ]
220220
sources = [
221221
"rtc_error.cc",
@@ -295,7 +295,7 @@ rtc_source_set("track_id_stream_label_map") {
295295
]
296296
}
297297

298-
rtc_source_set("rtp_parameters") {
298+
rtc_library("rtp_parameters") {
299299
visibility = [ "*" ]
300300
sources = [
301301
"media_types.cc",
@@ -370,7 +370,7 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
370370
]
371371
}
372372

373-
rtc_source_set("test_dependency_factory") {
373+
rtc_library("test_dependency_factory") {
374374
visibility = [ "*" ]
375375
testonly = true
376376
sources = [
@@ -385,7 +385,7 @@ rtc_source_set("test_dependency_factory") {
385385
}
386386

387387
if (rtc_include_tests) {
388-
rtc_source_set("create_video_quality_test_fixture_api") {
388+
rtc_library("create_video_quality_test_fixture_api") {
389389
visibility = [ "*" ]
390390
testonly = true
391391
sources = [
@@ -401,7 +401,7 @@ if (rtc_include_tests) {
401401
]
402402
}
403403

404-
rtc_source_set("create_network_emulation_manager") {
404+
rtc_library("create_network_emulation_manager") {
405405
visibility = [ "*" ]
406406
testonly = true
407407
sources = [
@@ -414,7 +414,7 @@ if (rtc_include_tests) {
414414
]
415415
}
416416

417-
rtc_source_set("create_peerconnection_quality_test_fixture") {
417+
rtc_library("create_peerconnection_quality_test_fixture") {
418418
visibility = [ "*" ]
419419
testonly = true
420420
sources = [
@@ -438,7 +438,7 @@ rtc_source_set("libjingle_logging_api") {
438438
]
439439
}
440440

441-
rtc_source_set("rtc_event_log_output_file") {
441+
rtc_library("rtc_event_log_output_file") {
442442
visibility = [ "*" ]
443443
sources = [
444444
"rtc_event_log_output_file.cc",
@@ -472,7 +472,7 @@ rtc_source_set("rtc_stats_api") {
472472
]
473473
}
474474

475-
rtc_source_set("audio_options_api") {
475+
rtc_library("audio_options_api") {
476476
visibility = [ "*" ]
477477
sources = [
478478
"audio_options.cc",
@@ -486,7 +486,7 @@ rtc_source_set("audio_options_api") {
486486
]
487487
}
488488

489-
rtc_source_set("transport_api") {
489+
rtc_library("transport_api") {
490490
visibility = [ "*" ]
491491
sources = [
492492
"call/transport.cc",
@@ -572,7 +572,7 @@ rtc_source_set("refcountedbase") {
572572
]
573573
}
574574

575-
rtc_source_set("ice_transport_factory") {
575+
rtc_library("ice_transport_factory") {
576576
visibility = [ "*" ]
577577
sources = [
578578
"ice_transport_factory.cc",
@@ -589,7 +589,7 @@ rtc_source_set("ice_transport_factory") {
589589
]
590590
}
591591

592-
rtc_source_set("neteq_simulator_api") {
592+
rtc_library("neteq_simulator_api") {
593593
visibility = [ "*" ]
594594
sources = [
595595
"test/neteq_simulator.cc",
@@ -609,7 +609,7 @@ rtc_source_set("function_view") {
609609

610610
if (rtc_include_tests) {
611611
if (rtc_enable_protobuf) {
612-
rtc_source_set("audioproc_f_api") {
612+
rtc_library("audioproc_f_api") {
613613
visibility = [ "*" ]
614614
testonly = true
615615
sources = [
@@ -624,7 +624,7 @@ if (rtc_include_tests) {
624624
]
625625
}
626626

627-
rtc_source_set("neteq_simulator_factory") {
627+
rtc_library("neteq_simulator_factory") {
628628
visibility = [ "*" ]
629629
testonly = true
630630
sources = [
@@ -650,7 +650,7 @@ if (rtc_include_tests) {
650650
]
651651
}
652652

653-
rtc_source_set("create_simulcast_test_fixture_api") {
653+
rtc_library("create_simulcast_test_fixture_api") {
654654
visibility = [ "*" ]
655655
testonly = true
656656
sources = [
@@ -665,7 +665,7 @@ if (rtc_include_tests) {
665665
]
666666
}
667667

668-
rtc_source_set("videocodec_test_fixture_api") {
668+
rtc_library("videocodec_test_fixture_api") {
669669
visibility = [ "*" ]
670670
testonly = true
671671
sources = [
@@ -682,7 +682,7 @@ if (rtc_include_tests) {
682682
]
683683
}
684684

685-
rtc_source_set("create_videocodec_test_fixture_api") {
685+
rtc_library("create_videocodec_test_fixture_api") {
686686
visibility = [ "*" ]
687687
testonly = true
688688
sources = [
@@ -721,7 +721,7 @@ if (rtc_include_tests) {
721721
]
722722
}
723723

724-
rtc_source_set("mock_frame_encryptor") {
724+
rtc_library("mock_frame_encryptor") {
725725
testonly = true
726726
sources = [
727727
"test/mock_frame_encryptor.cc",
@@ -735,7 +735,7 @@ if (rtc_include_tests) {
735735
]
736736
}
737737

738-
rtc_source_set("mock_frame_decryptor") {
738+
rtc_library("mock_frame_decryptor") {
739739
testonly = true
740740
sources = [
741741
"test/mock_frame_decryptor.cc",
@@ -748,7 +748,7 @@ if (rtc_include_tests) {
748748
]
749749
}
750750

751-
rtc_source_set("fake_frame_encryptor") {
751+
rtc_library("fake_frame_encryptor") {
752752
testonly = true
753753
sources = [
754754
"test/fake_frame_encryptor.cc",
@@ -765,7 +765,7 @@ if (rtc_include_tests) {
765765
]
766766
}
767767

768-
rtc_source_set("fake_frame_decryptor") {
768+
rtc_library("fake_frame_decryptor") {
769769
testonly = true
770770
sources = [
771771
"test/fake_frame_decryptor.cc",
@@ -859,7 +859,7 @@ if (rtc_include_tests) {
859859
]
860860
}
861861

862-
rtc_source_set("mock_video_decoder") {
862+
rtc_library("mock_video_decoder") {
863863
visibility = [ "*" ]
864864

865865
testonly = true
@@ -874,7 +874,7 @@ if (rtc_include_tests) {
874874
]
875875
}
876876

877-
rtc_source_set("mock_video_encoder") {
877+
rtc_library("mock_video_encoder") {
878878
visibility = [ "*" ]
879879

880880
testonly = true
@@ -905,7 +905,7 @@ if (rtc_include_tests) {
905905
]
906906
}
907907

908-
rtc_source_set("loopback_media_transport") {
908+
rtc_library("loopback_media_transport") {
909909
testonly = true
910910

911911
sources = [
@@ -922,7 +922,7 @@ if (rtc_include_tests) {
922922
]
923923
}
924924

925-
rtc_source_set("rtc_api_unittests") {
925+
rtc_library("rtc_api_unittests") {
926926
testonly = true
927927

928928
sources = [
@@ -956,7 +956,7 @@ if (rtc_include_tests) {
956956
]
957957
}
958958

959-
rtc_source_set("compile_all_headers") {
959+
rtc_library("compile_all_headers") {
960960
testonly = true
961961

962962
sources = [

api/audio/BUILD.gn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import("../../webrtc.gni")
1010

11-
rtc_source_set("audio_frame_api") {
11+
rtc_library("audio_frame_api") {
1212
visibility = [ "*" ]
1313
sources = [
1414
"audio_frame.cc",
@@ -36,7 +36,7 @@ rtc_source_set("audio_mixer_api") {
3636
]
3737
}
3838

39-
rtc_source_set("aec3_config") {
39+
rtc_library("aec3_config") {
4040
visibility = [ "*" ]
4141
sources = [
4242
"echo_canceller3_config.cc",
@@ -50,7 +50,7 @@ rtc_source_set("aec3_config") {
5050
]
5151
}
5252

53-
rtc_source_set("aec3_config_json") {
53+
rtc_library("aec3_config_json") {
5454
visibility = [ "*" ]
5555
sources = [
5656
"echo_canceller3_config_json.cc",
@@ -66,7 +66,7 @@ rtc_source_set("aec3_config_json") {
6666
]
6767
}
6868

69-
rtc_source_set("aec3_factory") {
69+
rtc_library("aec3_factory") {
7070
visibility = [ "*" ]
7171
configs += [ "../../modules/audio_processing:apm_debug_dump" ]
7272
sources = [

api/audio/test/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (is_android) {
1313
}
1414

1515
if (rtc_include_tests) {
16-
rtc_source_set("audio_api_unittests") {
16+
rtc_library("audio_api_unittests") {
1717
testonly = true
1818
sources = [
1919
"audio_frame_unittest.cc",

api/audio_codecs/BUILD.gn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (is_android) {
1212
import("//build/config/android/rules.gni")
1313
}
1414

15-
rtc_source_set("audio_codecs_api") {
15+
rtc_library("audio_codecs_api") {
1616
visibility = [ "*" ]
1717
sources = [
1818
"audio_codec_pair_id.cc",
@@ -43,7 +43,7 @@ rtc_source_set("audio_codecs_api") {
4343
]
4444
}
4545

46-
rtc_static_library("builtin_audio_decoder_factory") {
46+
rtc_library("builtin_audio_decoder_factory") {
4747
visibility = [ "*" ]
4848
allow_poison = [ "audio_codecs" ]
4949
sources = [
@@ -77,7 +77,7 @@ rtc_static_library("builtin_audio_decoder_factory") {
7777
}
7878
}
7979

80-
rtc_static_library("builtin_audio_encoder_factory") {
80+
rtc_library("builtin_audio_encoder_factory") {
8181
visibility = [ "*" ]
8282
allow_poison = [ "audio_codecs" ]
8383
sources = [

api/audio_codecs/L16/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (is_android) {
1212
import("//build/config/android/rules.gni")
1313
}
1414

15-
rtc_static_library("audio_encoder_L16") {
15+
rtc_library("audio_encoder_L16") {
1616
visibility = [ "*" ]
1717
poisonous = [ "audio_codecs" ]
1818
sources = [
@@ -30,7 +30,7 @@ rtc_static_library("audio_encoder_L16") {
3030
]
3131
}
3232

33-
rtc_static_library("audio_decoder_L16") {
33+
rtc_library("audio_decoder_L16") {
3434
visibility = [ "*" ]
3535
poisonous = [ "audio_codecs" ]
3636
sources = [

api/audio_codecs/g711/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (is_android) {
1212
import("//build/config/android/rules.gni")
1313
}
1414

15-
rtc_static_library("audio_encoder_g711") {
15+
rtc_library("audio_encoder_g711") {
1616
visibility = [ "*" ]
1717
poisonous = [ "audio_codecs" ]
1818
sources = [
@@ -30,7 +30,7 @@ rtc_static_library("audio_encoder_g711") {
3030
]
3131
}
3232

33-
rtc_static_library("audio_decoder_g711") {
33+
rtc_library("audio_decoder_g711") {
3434
visibility = [ "*" ]
3535
poisonous = [ "audio_codecs" ]
3636
sources = [

api/audio_codecs/g722/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rtc_source_set("audio_encoder_g722_config") {
1919
]
2020
}
2121

22-
rtc_static_library("audio_encoder_g722") {
22+
rtc_library("audio_encoder_g722") {
2323
visibility = [ "*" ]
2424
poisonous = [ "audio_codecs" ]
2525
sources = [
@@ -38,7 +38,7 @@ rtc_static_library("audio_encoder_g722") {
3838
]
3939
}
4040

41-
rtc_static_library("audio_decoder_g722") {
41+
rtc_library("audio_decoder_g722") {
4242
visibility = [ "*" ]
4343
poisonous = [ "audio_codecs" ]
4444
sources = [

0 commit comments

Comments
 (0)