1//
2// Copyright (C) 2019 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16cc_library_static {
17    name: "libwebrtc",
18    srcs: [
19        "AdbWebSocketHandler.cpp",
20        "DTLS.cpp",
21        "G711Packetizer.cpp",
22        "Keyboard.cpp",
23        "MyWebSocketHandler.cpp",
24        "OpusPacketizer.cpp",
25        "Packetizer.cpp",
26        "RTPSender.cpp",
27        "RTPSession.cpp",
28        "RTPSocketHandler.cpp",
29        "SCTPHandler.cpp",
30        "SDP.cpp",
31        "ServerState.cpp",
32        "STUNClient.cpp",
33        "STUNMessage.cpp",
34        "Utils.cpp",
35        "VP8Packetizer.cpp",
36    ],
37    static_libs: [
38        "libhttps",
39        "libsrtp2",
40        "libcuttlefish_host_config",
41        "libcuttlefish_screen_connector",
42        "libcuttlefish_wayland_server",
43        "libgflags",
44        "libjsoncpp",
45        "libsource",
46        "libdrm",
47        "libffi",
48        "libwayland_server",
49        "libwayland_extension_server_protocols",
50    ],
51    shared_libs: [
52        "libssl",
53        "libbase",
54        "libcuttlefish_fs",
55    ],
56    header_libs: [
57        "cuttlefish_common_headers",
58    ],
59    defaults: ["cuttlefish_host_only"],
60    local_include_dirs: ["include"],
61    export_include_dirs: ["include"],
62}
63
64cc_binary_host {
65    name: "webRTC",
66    srcs: [
67        "webRTC.cpp",
68    ],
69    header_libs: [
70        "cuttlefish_glog",
71    ],
72    shared_libs: [
73        "libbase",
74        "libcrypto",
75        "libcuttlefish_fs",
76        "libcuttlefish_utils",
77        "libopus",
78        "libssl",
79        "libvpx",
80        "libyuv",
81    ],
82    static_libs: [
83        "libcuttlefish_host_config",
84        "libcuttlefish_screen_connector",
85        "libcuttlefish_wayland_server",
86        "libgflags",
87        "libhttps",
88        "libjsoncpp",
89        "libsource",
90        "libsrtp2",
91        "libwebrtc",
92        "libdrm",
93        "libffi",
94        "libwayland_server",
95        "libwayland_extension_server_protocols",
96    ],
97    cpp_std: "experimental",
98    defaults: ["cuttlefish_host_only"],
99}
100
101// TODO(jemoreira): Ideally these files should be in $HOST_OUT/webrtc but I
102// couldn't find a module type that would produce that, prebuilt_usr_share_host
103// is the next best thing for now.
104prebuilt_usr_share_host {
105    name: "webrtc_index.html",
106    src: "assets/index.html",
107    filename: "index.html",
108    sub_dir: "webrtc/assets",
109}
110
111prebuilt_usr_share_host {
112    name: "webrtc_style.css",
113    src: "assets/style.css",
114    filename: "style.css",
115    sub_dir: "webrtc/assets",
116}
117
118prebuilt_usr_share_host {
119    name: "webrtc_logcat.js",
120    src: "assets/js/logcat.js",
121    filename: "logcat.js",
122    sub_dir: "webrtc/assets/js",
123}
124
125prebuilt_usr_share_host {
126    name: "webrtc_receive.js",
127    src: "assets/js/receive.js",
128    filename: "receive.js",
129    sub_dir: "webrtc/assets/js",
130}
131
132prebuilt_usr_share_host {
133    name: "webrtc_viewpane.js",
134    src: "assets/js/viewpane.js",
135    filename: "viewpane.js",
136    sub_dir: "webrtc/assets/js",
137}
138
139prebuilt_usr_share_host {
140    name: "webrtc_server.crt",
141    src: "certs/server.crt",
142    filename: "server.crt",
143    sub_dir: "webrtc/certs",
144}
145
146prebuilt_usr_share_host {
147    name: "webrtc_server.key",
148    src: "certs/server.key",
149    filename: "server.key",
150    sub_dir: "webrtc/certs",
151}
152
153prebuilt_usr_share_host {
154    name: "webrtc_server.p12",
155    src: "certs/server.p12",
156    filename: "server.p12",
157    sub_dir: "webrtc/certs",
158}
159
160prebuilt_usr_share_host {
161    name: "webrtc_trusted.pem",
162    src: "certs/trusted.pem",
163    filename: "trusted.pem",
164    sub_dir: "webrtc/certs",
165}
166