Skip to content

Commit 9209aaf

Browse files
committed
opt: use vcpkg to compile static ffmpeg on windows
1 parent 82df8ce commit 9209aaf

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424

2525
env:
2626
CARGO_TERM_COLOR: always
27-
VCPKG_COMMIT_ID: 06c79a9afa6f99f02f44d20df9e0848b2a56bf1b
27+
VCPKG_COMMIT_ID: 365f6444ab40ee87c73c947b475b3a267b3cb77c
2828
TAG_NAME: latest
2929
VERSION: "1.1.4"
3030

@@ -136,14 +136,15 @@ jobs:
136136
- run: rustup toolchain install ${{ inputs.RUST_TOOLCHAIN }} --profile minimal
137137
- uses: Swatinem/rust-cache@v2
138138

139-
# - name: setup vcpkg (do not install any package)
140-
# uses: lukka/run-vcpkg@v10
141-
# with:
142-
# vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
139+
- name: setup vcpkg (do not install any package)
140+
uses: lukka/run-vcpkg@v10
141+
with:
142+
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
143143

144144
- name: build RustPlayer
145+
shell: bash
145146
run: |
146-
# $VCPKG_ROOT/vcpkg install ffmpeg:x64-windows-static-md
147+
$VCPKG_ROOT/vcpkg install ffmpeg:x64-windows-static-md
147148
cargo build --release
148149
149150
- name: rename

thirdparty/ffmpeg-decoder-rs/Cargo.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@ path = "src/lib.rs"
1919
default = []
2020
rodio_source = ['rodio']
2121

22-
[dependencies]
23-
ffmpeg-sys-next = { path = "../rust-ffmpeg-sys", default-features=false, features=["avcodec", "avformat", "swresample", "static", "build"] }
22+
[dependencies.ffmpeg-sys-next]
23+
path = "../rust-ffmpeg-sys"
24+
default-features = false
25+
features = ["avcodec", "avformat", "swresample", "static", "build"]
26+
27+
[target.'cfg(windows)'.dependencies.ffmpeg-sys-next]
28+
path = "../rust-ffmpeg-sys"
29+
default-features = false
30+
features = ["avcodec", "avformat", "swresample", "static"]
2431

32+
33+
[dependencies]
2534
thiserror = "1.0"
2635
log = "0.4"
2736

0 commit comments

Comments
 (0)