Skip to content

Commit 93c4116

Browse files
committed
chore: Do more setup work to compile dav1d on windows
1 parent 31363f6 commit 93c4116

File tree

7 files changed

+40
-17
lines changed

7 files changed

+40
-17
lines changed

.justfiles/clippy.just

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
clippy:
2-
cargo clippy --manifest-path {{justfile_directory() / 'Cargo.toml'}} --all-targets --all-features -- -D warnings
2+
cargo clippy --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} --all-targets --all-features -- -D warnings

.justfiles/dav1d.just

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
1-
dav1d: install
2-
3-
clear:
4-
rm -rf {{justfile_directory() / 'target' / 'dav1d_build' }}
1+
dav1d: dirs
52

63
install-meson:
74
python --version
85
pip install -U meson setuptools ninja
96

107
clone:
11-
-git clone --branch 1.3.0 --depth 1 https://code.videolan.org/videolan/dav1d.git {{justfile_directory() / 'target' / 'dav1d'}}
8+
-git clone --branch 1.3.0 --depth 1 https://code.videolan.org/videolan/dav1d.git {{ join(justfile_directory(), 'target', 'dav1d') }}
9+
10+
[unix]
11+
prepare: clone install-meson
12+
pwd
13+
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{ join(justfile_directory(), 'target', 'dav1d_build') }} {{ join(justfile_directory(), 'target', 'dav1d') }}
1214

15+
[windows]
1316
prepare: clone install-meson
1417
pwd
15-
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{justfile_directory() / 'target' / 'dav1d_build' }} {{justfile_directory() / 'target' / 'dav1d' }}
18+
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64"
19+
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
20+
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
21+
$env:PATH = "$env:PATH;$LinkPath"
22+
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{ join(justfile_directory(), 'target', 'dav1d_build') }} {{ join(justfile_directory(), 'target', 'dav1d') }}
1623

1724
compile: prepare
1825
pwd
19-
ninja -C {{justfile_directory() / 'target' / 'dav1d_build' }}
26+
ninja -C {{ join(justfile_directory(), 'target', 'dav1d_build') }}
2027

2128
install: compile
22-
ninja -C {{justfile_directory() / 'target' / 'dav1d_build' }} install
29+
ninja -C {{ join(justfile_directory(), 'target', 'dav1d_build') }} install
30+
31+
dirs:
32+
@echo {{ just_executable() }}
33+
@echo {{ join(justfile_directory(), 'target', 'dav1d') }}
34+
@echo {{ join(justfile_directory(), 'target', 'dav1d_build') }}
35+
@echo 'After compiling dav1d set:'
36+
@echo PKG_CONFIG_PATH={{ join(justfile_directory(), 'target', 'dav1d_build', 'pkgconfig') }}
37+
@echo LD_LIBRARY_PATH={{ join(justfile_directory(), 'target', 'dav1d_build') }}
38+
39+
[confirm("Are you sure you want to remove dav1d and dav1d_build?")]
40+
clear:
41+
rm -rf {{ join(justfile_directory(), 'target', 'dav1d') }}
42+
rm -rf {{ join(justfile_directory(), 'target', 'dav1d_build') }}

.justfiles/deny.just

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
deny: workspace
22

33
workspace: install-cargo-deny
4-
cargo deny --log-level error --workspace --manifest-path {{justfile_directory() / 'Cargo.toml'}} check
4+
cargo deny --log-level error --workspace --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} check
55

66
install-cargo-deny:
77
cargo install cargo-deny

.justfiles/fmt.just

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fmt: run
22

33
run:
4-
cargo fmt --all --manifest-path {{ justfile_directory() / 'Cargo.toml'}}
4+
cargo fmt --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}
55

66
check:
7-
cargo fmt --all --manifest-path {{ justfile_directory() / 'Cargo.toml'}} -- --check
7+
cargo fmt --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} -- --check

.justfiles/msrv.just

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
msrv: verify
22

33
run: install-cargo-msrv
4-
cargo msrv --manifest-path {{justfile_directory() / 'Cargo.toml'}}
4+
cargo msrv --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}
55

66
verify: install-cargo-msrv
7-
cargo msrv verify --manifest-path {{justfile_directory() / 'Cargo.toml'}}
7+
cargo msrv verify --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}
88

99
install-cargo-msrv:
1010
cargo install cargo-msrv --version 0.16.0-beta.20

.justfiles/test.just

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
test: all no-default-features
22

33
all:
4-
cargo test --all
4+
cargo test --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}
55

66
no-default-features:
7-
cargo test --all --no-default-features
7+
cargo test --all --no-default-features --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ mod msrv '.justfiles/msrv.just'
66
mod test '.justfiles/test.just'
77
mod dav1d '.justfiles/dav1d.just'
88

9-
9+
[windows]
10+
default:
11+
@echo 'On Windows, run just using:'
12+
@echo 'just --unstable --shell pwsh.exe --shell-arg -c'
1013

1114
before-push:
1215
# do fmt

0 commit comments

Comments
 (0)