12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- config (" libdatachannel_config" ) {
16
- include_dirs = [
17
- " repo/include" ,
18
- " repo/include/rtc" ,
19
- ]
20
- }
21
15
22
- config (" libdatachannel_config_disable_warnings" ) {
23
- cflags_cc = [
24
- " -Wno-shadow" ,
25
- " -Wno-unreachable-code" ,
26
- " -Wno-non-virtual-dtor" ,
27
- " -Wno-implicit-fallthrough" ,
16
+ action (" build_libdatachannel" ) {
17
+ script = " scripts/build_libdatachannel.py"
18
+ outputs = [
19
+ " $target_gen_dir /repo/build/libdatachannel.so" ,
28
20
]
21
+ args = []
29
22
}
30
23
31
- config (" libdatachannel_config_enable_features" ) {
32
- cflags_cc = [
33
- " -fexceptions" ,
34
- " -frtti" ,
35
- ]
36
- }
37
-
38
- source_set (" libdatachannel" ) {
39
- include_dirs = [
40
- " repo/src" ,
41
- " repo/include/rtc" ,
42
- " repo/deps/plog/include" ,
43
- " repo/deps/usrsctp/usrsctplib" ,
44
- " repo/deps/libjuice/include" ,
45
- " repo/deps/libsrtp/include" ,
46
- ]
47
-
48
- # ---------------------------------------------------------------------------
49
- # Source files from repo/src/*.cpp
50
- # ---------------------------------------------------------------------------
51
- sources = [
52
- " repo/src/av1rtppacketizer.cpp" ,
53
- " repo/src/candidate.cpp" ,
54
- " repo/src/capi.cpp" ,
55
- " repo/src/channel.cpp" ,
56
- " repo/src/configuration.cpp" ,
57
- " repo/src/datachannel.cpp" ,
58
- " repo/src/description.cpp" ,
59
- " repo/src/global.cpp" ,
60
- " repo/src/h264rtpdepacketizer.cpp" ,
61
- " repo/src/h264rtppacketizer.cpp" ,
62
- " repo/src/h265nalunit.cpp" ,
63
- " repo/src/h265rtpdepacketizer.cpp" ,
64
- " repo/src/h265rtppacketizer.cpp" ,
65
- " repo/src/mediahandler.cpp" ,
66
- " repo/src/message.cpp" ,
67
- " repo/src/nalunit.cpp" ,
68
- " repo/src/pacinghandler.cpp" ,
69
- " repo/src/peerconnection.cpp" ,
70
- " repo/src/plihandler.cpp" ,
71
- " repo/src/rembhandler.cpp" ,
72
- " repo/src/rtcpnackresponder.cpp" ,
73
- " repo/src/rtcpreceivingsession.cpp" ,
74
- " repo/src/rtcpsrreporter.cpp" ,
75
- " repo/src/rtp.cpp" ,
76
- " repo/src/rtpdepacketizer.cpp" ,
77
- " repo/src/rtppacketizationconfig.cpp" ,
78
- " repo/src/rtppacketizer.cpp" ,
79
- " repo/src/track.cpp" ,
80
- " repo/src/websocket.cpp" ,
81
- " repo/src/websocketserver.cpp" ,
82
- ]
83
-
84
- # ---------------------------------------------------------------------------
85
- # Source files from repo/src/impl/*.cpp
86
- # ---------------------------------------------------------------------------
87
- sources += [
88
- " repo/src/impl/certificate.cpp" ,
89
- " repo/src/impl/channel.cpp" ,
90
- " repo/src/impl/datachannel.cpp" ,
91
- " repo/src/impl/dtlssrtptransport.cpp" ,
92
- " repo/src/impl/dtlstransport.cpp" ,
93
- " repo/src/impl/http.cpp" ,
94
- " repo/src/impl/httpproxytransport.cpp" ,
95
- " repo/src/impl/icetransport.cpp" ,
96
- " repo/src/impl/init.cpp" ,
97
- " repo/src/impl/logcounter.cpp" ,
98
- " repo/src/impl/peerconnection.cpp" ,
99
- " repo/src/impl/pollinterrupter.cpp" ,
100
- " repo/src/impl/pollservice.cpp" ,
101
- " repo/src/impl/processor.cpp" ,
102
- " repo/src/impl/sctptransport.cpp" ,
103
- " repo/src/impl/sha.cpp" ,
104
- " repo/src/impl/tcpserver.cpp" ,
105
- " repo/src/impl/tcptransport.cpp" ,
106
- " repo/src/impl/threadpool.cpp" ,
107
- " repo/src/impl/tls.cpp" ,
108
- " repo/src/impl/tlstransport.cpp" ,
109
- " repo/src/impl/track.cpp" ,
110
- " repo/src/impl/transport.cpp" ,
111
- " repo/src/impl/utils.cpp" ,
112
- " repo/src/impl/verifiedtlstransport.cpp" ,
113
- " repo/src/impl/websocket.cpp" ,
114
- " repo/src/impl/websocketserver.cpp" ,
115
- " repo/src/impl/wshandshake.cpp" ,
116
- " repo/src/impl/wstransport.cpp" ,
117
- ]
24
+ shared_library (" libdatachannel" ) {
25
+ # Ensure the script runs first
26
+ deps = [ " :build_libdatachannel" ]
118
27
119
- public_configs = [ " :libdatachannel_config" ]
120
- configs += [
121
- " :libdatachannel_config_disable_warnings" ,
122
- " :libdatachannel_config_enable_features" ,
123
- ]
124
-
125
- defines = [
126
- " BUILD_SHARED_LIBS=1" , # default ON in the CMake
127
- " BUILD_SHARED_DEPS_LIBS=0" , # default OFF
128
- " USE_GNUTLS=0" , # default OFF => no GnuTLS
129
- " USE_MBEDTLS=0" , # default OFF => no MbedTLS
130
- " USE_NICE=0" , # default OFF => no libnice
131
- " PREFER_SYSTEM_LIB=0" , # default OFF
132
- " USE_SYSTEM_SRTP=0" , # default from PREFER_SYSTEM_LIB
133
- " USE_SYSTEM_JUICE=0" ,
134
- " USE_SYSTEM_USRSCTP=0" ,
135
- " USE_SYSTEM_PLOG=0" ,
136
- " USE_SYSTEM_JSON=0" ,
137
- " NO_WEBSOCKET=0" , # default OFF
138
- " NO_MEDIA=0" , # default OFF
139
- " NO_EXAMPLES=0" , # default OFF
140
- " NO_TESTS=0" , # default OFF
141
- " WARNINGS_AS_ERRORS=0" , # default OFF
142
- " CAPI_STDCALL=0" , # default OFF
143
- " SCTP_DEBUG=0" , # default OFF
144
- " RTC_UPDATE_VERSION_HEADER=0" , # default OFF
145
- " RTC_ENABLE_WEBSOCKET=0" ,
146
- " RTC_ENABLE_MEDIA=0" ,
147
- " RTC_SYSTEM_SRTP=0" ,
148
- ]
149
- }
28
+ # GN will link this .so into dependent targets
29
+ lib_dirs = [ rebase_path (" $target_gen_dir /repo/build" , root_build_dir ) ]
30
+ libs = [ " datachannel" ]
31
+ }
0 commit comments