Skip to content

Commit 05575a6

Browse files
committed
[*] fix: build audiopus_sys crate in local test windows11 failed
1 parent f79a69b commit 05575a6

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

Cargo.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ android-build-env = SLINT_STYLE=material $(build-env)
99
desktop-build-env = SLINT_STYLE=fluent $(build-env)
1010
web-build-env = SLINT_STYLE=fluent $(build-env) RUSTFLAGS='--cfg getrandom_backend="wasm_js"'
1111

12+
ifeq ($(OS),Windows_NT)
13+
desktop-build-env := $(desktop-build-env) CMAKE_POLICY_VERSION_MINIMUM=3.5
14+
endif
15+
1216
run-env = RUST_LOG=debug
1317
proj-features = --features=${desktop-features},database,qrcode,center-window
1418
desktop-features ?= desktop-wayland-wlr

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ This is a screen recording tool for `Linux` and `Windows`. It is based on `Rust`
7474
make desktop-build-release desktop-features=desktop-windows
7575
```
7676

77+
- `Windows` compiles `audiopus_sys`
78+
- If compilation of `audiopus_sys` fails on `Windows`, you can try adding the environment variable:``export CMAKE_POLICY_VERSION_MINIMUM=3.5`
79+
7780
----
7881
7982
### How to Configure `STUN` and `TURN` Servers

README.zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
make desktop-build-release desktop-features=desktop-windows
6969
```
7070

71+
- `Windows`编译`audiopus_sys`失败,可以尝试添加环境变量:`export CMAKE_POLICY_VERSION_MINIMUM=3.5`
72+
7173
----
7274

7375
### 如何配置`STUN`和`TURN`服务器

lib/scp-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

3-
scp -r ./recorder 192.168.10.14:C:/Users/blue/Desktop/wayshot/lib
3+
scp -r ./wrtc 192.168.10.15:C:/Users/blue/Desktop/wayshot/lib
44

lib/wrtc/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ description = "A whep library"
1212

1313
[dependencies]
1414
log.workspace = true
15+
opus.workspace = true
1516
rand.workspace = true
1617
http.workspace = true
1718
mp4m.workspace = true
1819
bytes.workspace = true
1920
webrtc.workspace = true
2021
bytesio.workspace = true
2122
indexmap.workspace = true
22-
opus.workspace = true
2323
openh264.workspace = true
2424
byteorder.workspace = true
2525
thiserror.workspace = true
@@ -35,6 +35,9 @@ serde = { workspace = true, features = ["derive"] }
3535
reqwest = { workspace = true, features = ["json"] }
3636
tokio-rustls = { workspace = true, features = ["tls12"] }
3737

38+
[target.'cfg(target_os = "windows")'.dependencies]
39+
cmake = "0.1.57" # for `audiopus_sys`
40+
3841
[dev-dependencies]
3942
image.workspace = true
4043
hound.workspace = true

0 commit comments

Comments
 (0)