Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
70 lines (59 loc) · 2.77 KB
/
Copy pathjustfile
File metadata and controls
70 lines (59 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env just --justfile
# OBS Studio plugin for MoQ. See doc/bin/obs.md for the full build guide.
#
# `just obs compile` type-checks the sources on any platform with nothing to
# download. The recipes below build a loadable plugin, which is a bigger ask:
#
# Linux: `nix develop .#obs` provides obs-studio/qt6/ffmpeg/cmake, then `just obs build`.
# macOS: native, NOT nix. Needs full Xcode; run outside `nix develop` (its
# toolchain breaks the Xcode build). `just obs setup` downloads
# libobs/Qt6/ffmpeg via buildspec.json (obs-deps).
# Windows: needs Visual Studio 2022; same buildspec download (run from Git Bash).
#
# The C++ package (cpp/moq) is built in-tree: cargo builds rs/moq-ffi and
# uniffi-bindgen-cpp renders its bindings. MOQ_LOCAL points CMake at the repo root
# by default, so there's no prebuilt release to download.
set quiet
# List all of the available commands.
default:
just --list
# Configure via CMake presets. MOQ_LOCAL defaults to the repo root inside
# CMakeLists.txt (so the C++ package builds from cpp/moq); pass `path=/some/moq` to
# override it.
setup preset="" path="":
cmake --preset "$(../../sh/obs/preset.sh '{{ preset }}')" {{ if path == "" { "" } else { "-DMOQ_LOCAL=" + quote(path) } }}
# Build via CMake presets. Run `just obs setup` first (it configures + downloads
# deps); not chained here because on macOS setup reconfigures OBS, which is slow.
build preset="":
cmake --build --preset "$(../../sh/obs/preset.sh '{{ preset }}')"
# Type-check every plugin source and unit test, without linking or an obs-deps
# download. The gate to run in a worktree.
compile:
../../sh/obs/compile.sh
# Compile and link the plugin the way CI does, against the `.#obs` shell's own
# libobs/Qt6/ffmpeg, then run the unit tests. Linux-only in practice: it's the
# one platform where nixpkgs has obs-studio. The Debug build type reuses the
# dev-profile Rust artifacts CI restores, where a release moq-ffi would rebuild
# its whole dependency tree.
ci preset="":
cmake --preset "$(../../sh/obs/preset.sh '{{ preset }}' ci)" -DCMAKE_BUILD_TYPE=Debug
cmake --build --preset "$(../../sh/obs/preset.sh '{{ preset }}' ci)"
../../sh/obs/unit.sh
# Unit-test the plugin sources against stubbed libobs and ffmpeg and the real
# moq-ffi, under ThreadSanitizer. Nightly runs it; `just obs ci` runs them
# without the sanitizer.
test:
../../sh/obs/test.sh
# Lint formatting and the OBS version pins.
check:
../../sh/obs/check.sh
# Auto-fix formatting.
fix:
../../sh/obs/fix.sh
# Runs in the caller's directory, so a relative `--output` means what it would
# to the script itself.
# Build and package the obs-moq plugin for release.
[no-cd]
[positional-arguments]
package *args:
{{ quote(justfile_directory() / "cpp/obs/build.sh") }} "$@"