Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit ed8781b

Browse files
committed
Enable rtp_rtcp WASM build.
1 parent a977465 commit ed8781b

File tree

5 files changed

+20
-140
lines changed

5 files changed

+20
-140
lines changed

talk/owt/BUILD.gn

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static_library("owt_sdk_base") {
295295
"sdk/base/customizedaudiodevicemodule.h",
296296
]
297297
}
298-
if (is_clang) {
298+
if (is_clang && !is_wasm) {
299299
configs -= [ "//build/config/clang:find_bad_constructs" ]
300300
}
301301
if (is_win && is_clang) {
@@ -329,17 +329,21 @@ static_library("owt_sdk_p2p") {
329329
"sdk/p2p/p2psignalingsenderimpl.cc",
330330
"sdk/p2p/p2psignalingsenderimpl.h",
331331
]
332-
if (is_clang) {
332+
if (is_clang && !is_wasm) {
333333
configs -= [ "//build/config/clang:find_bad_constructs" ]
334334
}
335335
}
336336

337-
wasm_lib("owt_wasm") {
338-
name = "owt"
339-
deps = [ "//third_party/webrtc/modules/rtp_rtcp" ]
340-
sources=[
341-
"sdk/wasm/main.cc",
342-
]
337+
if (is_wasm) {
338+
wasm_lib("owt_wasm") {
339+
name = "owt"
340+
deps = [
341+
"//third_party/webrtc/modules/rtp_rtcp:rtp_rtcp",
342+
"//third_party/webrtc/rtc_base:rtc_json",
343+
"//third_party/boringssl",
344+
]
345+
sources = [ "sdk/wasm/main.cc" ]
346+
}
343347
}
344348

345349
static_library("owt_sdk_conf") {
@@ -366,7 +370,7 @@ static_library("owt_sdk_conf") {
366370
"sdk/include/cpp/owt/conference/remotemixedstream.h",
367371
"sdk/include/cpp/owt/conference/user.h",
368372
]
369-
if (is_clang) {
373+
if (is_clang && !is_wasm) {
370374
configs -= [ "//build/config/clang:find_bad_constructs" ]
371375
}
372376

talk/owt/sdk/wasm/gn/BUILD.gn

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ template("gcc_like_toolchain") {
6565

6666
tool("cc") {
6767
depfile = "{{output}}.d"
68-
command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -fno-stack-protector ${external_cflags} -msimd128 -pthread -D__wasm__ -c {{source}} -o {{output}}"
68+
command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -fno-stack-protector ${external_cflags} -c {{source}} -o {{output}}"
6969
depsformat = "gcc"
7070
outputs = [ "$object_subdir/{{source_name_part}}.o" ]
7171
description = "compile {{source}}"
7272
}
7373

7474
tool("cxx") {
7575
depfile = "{{output}}.d"
76-
command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -fno-stack-protector ${external_cflags} -msimd128 -pthread -D__wasm__ ${external_cxxflags} -c {{source}} -o {{output}}"
76+
command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -fno-stack-protector ${external_cflags} ${external_cxxflags} -c {{source}} -o {{output}}"
7777
depsformat = "gcc"
7878
outputs = [ "$object_subdir/{{source_name_part}}.o" ]
7979
description = "compile {{source}}"
@@ -173,8 +173,8 @@ gcc_like_toolchain("wasm") {
173173
# emsdk_dir and em_config are defined in wasm.gni.
174174
cpu = host_cpu
175175
os = host_os
176-
ar = "emar --em-config $em_config"
177-
cc = "emcc --em-config $em_config"
178-
cxx = "em++ --em-config $em_config"
176+
ar = "$emsdk_dir/emscripten/emar --em-config $em_config"
177+
cc = "$emsdk_dir/emscripten/emcc --em-config $em_config"
178+
cxx = "$emsdk_dir/emscripten/em++ --em-config $em_config"
179179
strip = ""
180180
}

talk/owt/sdk/wasm/gn/BUILDCONFIG.gn

Lines changed: 0 additions & 124 deletions
This file was deleted.

talk/owt/sdk/wasm/gn/wasm.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import("wasm_vars.gni")
2323

2424
# Used by //gn/standalone/toolchain/BUILD.gn .
2525
em_config = rebase_path("/home/jianjunz/code/emsdk/.emscripten", "")
26-
emsdk_dir = rebase_path("//buildtools/linux64/emsdk", "")
26+
emsdk_dir = rebase_path("/home/jianjunz/code/emsdk/upstream", "")
2727

2828
# Defines a WASM library target.
2929
# Args:

talk/owt/sdk/wasm/gn/wasm_vars.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
# limitations under the License.
1818

1919
wasm_toolchain = "//talk/owt/sdk/wasm/gn:wasm"
20-
is_wasm = current_toolchain == wasm_toolchain
20+
# is_wasm = current_toolchain == wasm_toolchain

0 commit comments

Comments
 (0)