Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update for zig 14 #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ pub fn build(b: *std.Build) !void {

////////////////////////////////////////////////////////////
//// CudaZ Module
const cudaz_module = b.addModule("cudaz", .{ .root_source_file = .{ .path = "src/lib.zig" } });
cudaz_module.addIncludePath(.{ .path = cuda_include_dir });
const cudaz_module = b.addModule("cudaz", .{ .root_source_file = b.path("./src/lib.zig") });
cudaz_module.addIncludePath(.{ .cwd_relative = cuda_include_dir });

const lib_paths = [_][]const u8{
"lib",
Expand All @@ -81,7 +81,7 @@ pub fn build(b: *std.Build) !void {

inline for (lib_paths) |lib_path| {
const path = try std.fmt.allocPrint(b.allocator, "{s}/{s}", .{ cuda_folder, lib_path });
cudaz_module.addLibraryPath(.{ .path = path });
cudaz_module.addLibraryPath(.{ .cwd_relative = path });
}

////////////////////////////////////////////////////////////
Expand All @@ -108,7 +108,7 @@ pub fn build(b: *std.Build) !void {
while (try dir_iterator.next()) |item| {
if (item.kind == .file) {
const test_path = try std.fmt.allocPrint(b.allocator, "{s}/{s}", .{ "test", item.path });
const sub_test = b.addTest(.{ .name = item.path, .root_source_file = .{ .path = test_path }, .target = target, .optimize = optimize });
const sub_test = b.addTest(.{ .name = item.path, .root_source_file = b.path(test_path), .target = target, .optimize = optimize });
// Add Module
sub_test.root_module.addImport("cudaz", cudaz_module);

Expand All @@ -135,7 +135,7 @@ pub fn build(b: *std.Build) !void {
//// Clean the cache folders and artifacts

// Creates a binary that cleans up zig artifact folders
const clean = b.addExecutable(.{ .name = "clean", .root_source_file = .{ .path = "bin/delete-zig-cache.zig" }, .target = target, .optimize = optimize });
const clean = b.addExecutable(.{ .name = "clean", .root_source_file = b.path("bin/delete-zig-cache.zig"), .target = target, .optimize = optimize });

// Creates a run step
const clean_step = b.addRunArtifact(clean);
Expand Down
4 changes: 2 additions & 2 deletions example/custom_type/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const std = @import("std");

pub fn build(b: *std.Build) !void {
// exe points to main.zig that uses cudaz
const exe = b.addExecutable(.{ .name = "main", .root_source_file = .{ .path = "src/main.zig" }, .target = b.host });
exe.addIncludePath(.{ .path = "c" });
const exe = b.addExecutable(.{ .name = "main", .root_source_file = b.path("src/main.zig"), .target = b.host });
exe.addIncludePath(b.path("c"));
// Point to cudaz dependency
const cudaz_dep = b.dependency(
"cudaz",
Expand Down
2 changes: 1 addition & 1 deletion example/increment/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const std = @import("std");

pub fn build(b: *std.Build) !void {
// exe points to main.zig that uses cudaz
const exe = b.addExecutable(.{ .name = "main", .root_source_file = .{ .path = "src/main.zig" }, .target = b.host });
const exe = b.addExecutable(.{ .name = "main", .root_source_file = b.path("src/main.zig"), .target = b.host });

// Point to cudaz dependency
const cudaz_dep = b.dependency(
Expand Down