Skip to content

Commit

Permalink
zig: lazybuild
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Sep 3, 2023
1 parent c902705 commit 2c3c42f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
16 changes: 8 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ fn make_example(b: *std.Build, info: BuildInfo) void {
});

if (info.filetype == .c or info.filetype == .cpp)
example.addCSourceFile(info.path, &.{
example.addCSourceFile(.{ .file = .{ .path = info.path }, .flags = &.{
"-Wall",
"-Werror",
"-Wextra",
});
} });

if (info.sdl_enabled) {
const libsdl_dep = b.dependency("libsdl", .{
Expand All @@ -102,13 +102,13 @@ fn make_example(b: *std.Build, info: BuildInfo) void {
});
const libvlcpp = libvlcpp_dep.artifact("vlcpp");
example.installLibraryHeaders(libvlcpp);
example.addIncludePath("zig-out/include");
example.addIncludePath(.{ .path = "zig-out/include" });
}

if (info.target.isDarwin()) {
// Custom path
example.addIncludePath("/usr/local/include");
example.addLibraryPath("/usr/local/lib");
example.addIncludePath(.{ .path = "/usr/local/include" });
example.addLibraryPath(.{ .path = "/usr/local/lib" });

// Link Frameworks
example.linkFramework("Foundation");
Expand All @@ -119,8 +119,8 @@ fn make_example(b: *std.Build, info: BuildInfo) void {
example.linkSystemLibrary("vlc");
} else if (info.target.isWindows()) {
// msys2/clang - CI
example.addIncludePath(msys2Inc(info.target));
example.addLibraryPath(msys2Lib(info.target));
example.addIncludePath(.{ .path = msys2Inc(info.target) });
example.addLibraryPath(.{ .path = msys2Lib(info.target) });
example.linkSystemLibraryName("vlc.dll");
example.want_lto = false;
} else {
Expand Down Expand Up @@ -149,7 +149,7 @@ fn checkVersion() bool {
return false;
}

const needed_version = std.SemanticVersion.parse("0.11.0-dev.4183") catch unreachable;
const needed_version = std.SemanticVersion.parse("0.11.0") catch unreachable;
const version = builtin.zig_version;
const order = version.order(needed_version);
return order != .lt;
Expand Down
8 changes: 2 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
.name = "libvlc",
.version = "0.2.0",
.dependencies = .{
// .libsdl = .{
// .url = "https://github.com/andrewrk/sdl/archive/73c38318443a98b80d7cd0cd1e18a190a85e842f.tar.gz",
// .hash = "12202047e83332d37477811513bd6446c567efa6f03c4ae5e57585412b4ad8129cae",
// },
.libvlcpp = .{
.url = "https://github.com/kassane/libvlcpp/archive/05c04d2cdf6be4ef7b5a918b596884fda07a37ce.tar.gz",
.hash = "1220ce41db782667e870339f61716ca95b4ec8f621d5193faa295b8f5a6dae5cd4a7",
.url = "https://github.com/kassane/libvlcpp/archive/00424d823873612c795f59eb1fc9a29c7360782a.tar.gz",
.hash = "12206324828247b2a8a4ec8a86e40e0ef8846971f95083e70dfb3acee2b1aa10ca5e",
},
},
}

0 comments on commit 2c3c42f

Please sign in to comment.