Skip to content

Commit 56f15f3

Browse files
committed
remove mpv_lib from build.zig
1 parent c66f1af commit 56f15f3

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,22 @@ WIP, but you should be able to use it with no much issues, see [below](#todo).
2222
- [X] opengl rendering
2323
- [X] software rendering
2424
- [X] ~~Export as a library Make the library~~
25-
- [ ] cross-platform compatible
25+
- [X] ~~cross-platform compatible~~ (the module user should link to `libmpv`)
2626
- [X] Add usage guide.
2727

2828
## Usage
2929

3030
- first fetch the package into your project:
31+
3132
```bash
3233
zig fetch --save https://github.com/hasanpasha/zmpv/archive/${DESIRED_COMMOT_HASH}.tar.gz
3334
```
3435
- import the package in your `build.zig` file:
36+
3537
```zig
3638
const zmpv_dep = b.dependency("zmpv", .{ .target = target, .optimize = optimize });
3739
exe.root_module.addImport("zmpv", zmpv_dep.module("zmpv"));
38-
exe.linkLibrary(zmpv_dep.artifact("zmpv_lib"));
40+
exe.linkSystemLibrary("mpv"); # in linux
3941
```
4042

4143
## Example
@@ -55,7 +57,7 @@ pub fn main() !void {
5557
5658
const filename = args[1];
5759
58-
const mpv = try Mpv.create(std.heap.page_allocator);
60+
const mpv = try Mpv.create(std.heap.page_allocator, null);
5961
6062
try mpv.set_option("osc", .Flag, .{ .Flag = true });
6163
try mpv.set_option("input-default-bindings", .Flag, .{ .Flag = true });

build.zig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ pub fn build(b: *std.Build) void {
77
const target = b.standardTargetOptions(.{});
88
const optimize = b.standardOptimizeOption(.{});
99

10-
const lib = b.addStaticLibrary(.{
11-
.name = "zmpv_lib",
12-
.root_source_file = .{ .path = "src/root.zig" },
13-
.target = target,
14-
.optimize = optimize,
15-
});
16-
17-
lib.linkLibC();
18-
lib.linkSystemLibrary("mpv");
19-
20-
b.installArtifact(lib);
21-
2210
const zmpv_module = b.addModule("zmpv", .{
2311
.root_source_file = .{ .path = "src/root.zig" },
2412
});

0 commit comments

Comments
 (0)