diff --git a/awkbuild.zig b/awkbuild.zig index 1b05208..c048237 100644 --- a/awkbuild.zig +++ b/awkbuild.zig @@ -26,7 +26,7 @@ pub fn addAwk( .target = target, .optimize = optimize, }); - const install = b.addInstallArtifact(exe); + const install = b.addInstallArtifact(exe, .{}); exe.step.dependOn(&repo.step); // exe.step.dependOn(&config_step.step); const repo_path = repo.getPath(&exe.step); @@ -45,9 +45,9 @@ pub fn addAwk( "-std=c11", }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/gnu"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/gnu" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); diff --git a/build.zig b/build.zig index b9ed5c6..d94ce47 100644 --- a/build.zig +++ b/build.zig @@ -194,14 +194,14 @@ pub fn build(b: *std.build.Builder) void { // re-implements Build.installArtifact but also returns it fn installArtifact(b: *std.Build, artifact: anytype) *std.Build.Step.InstallArtifact { - const install = b.addInstallArtifact(artifact); + const install = b.addInstallArtifact(artifact, .{}); b.getInstallStep().dependOn(&install.step); return install; } fn addPosix(artifact: *std.build.LibExeObjStep, zig_posix: *std.build.LibExeObjStep) void { artifact.linkLibrary(zig_posix); - artifact.addIncludePath("inc" ++ std.fs.path.sep_str ++ "posix"); + artifact.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "posix" }); } fn addTest( @@ -219,8 +219,8 @@ fn addTest( .optimize = optimize, }); exe.addCSourceFiles(&.{"test" ++ std.fs.path.sep_str ++ "expect.c"}, &[_][]const u8{}); - exe.addIncludePath("inc" ++ std.fs.path.sep_str ++ "libc"); - exe.addIncludePath("inc" ++ std.fs.path.sep_str ++ "posix"); + exe.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "libc" }); + exe.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "posix" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); // TODO: should libc_only_std_static and zig_start be able to add library dependencies? @@ -256,7 +256,7 @@ fn addLibcTest( .target = target, .optimize = optimize, }); - lib.addIncludePath("inc" ++ std.fs.path.sep_str ++ "libc"); + lib.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "libc" }); lib.step.dependOn(&libc_test_repo.step); libc_test_step.dependOn(&lib.step); } @@ -276,9 +276,9 @@ fn addLibcTest( }); exe.addCSourceFiles(common_src, &[_][]const u8{}); exe.step.dependOn(&libc_test_repo.step); - exe.addIncludePath(libc_inc_path); - exe.addIncludePath("inc" ++ std.fs.path.sep_str ++ "libc"); - exe.addIncludePath("inc" ++ std.fs.path.sep_str ++ "posix"); + exe.addIncludePath(.{ .path = libc_inc_path }); + exe.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "libc" }); + exe.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "posix" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(libc_only_posix); @@ -328,10 +328,10 @@ fn addTinyRegexCTests( exe.addCSourceFiles(files.toOwnedSlice() catch unreachable, &[_][]const u8{ "-std=c99", }); - exe.addIncludePath(repo_path); + exe.addIncludePath(.{ .path = repo_path }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); @@ -368,7 +368,7 @@ fn addLua( .optimize = optimize, }); lua_exe.step.dependOn(&lua_repo.step); - const install = b.addInstallArtifact(lua_exe); + const install = b.addInstallArtifact(lua_exe, .{}); // doesn't compile for windows for some reason if (target.getOs().tag != .windows) { b.getInstallStep().dependOn(&install.step); @@ -392,13 +392,13 @@ fn addLua( "-std=c99", }); - lua_exe.addIncludePath("inc" ++ std.fs.path.sep_str ++ "libc"); + lua_exe.addIncludePath(.{ .path = "inc" ++ std.fs.path.sep_str ++ "libc" }); lua_exe.linkLibrary(libc_only_std_static); lua_exe.linkLibrary(libc_only_posix); lua_exe.linkLibrary(zig_start); // TODO: should libc_only_std_static and zig_start be able to add library dependencies? if (target.getOs().tag == .windows) { - lua_exe.addIncludePath("inc/win32"); + lua_exe.addIncludePath(.{ .path = "inc/win32" }); lua_exe.linkSystemLibrary("ntdll"); lua_exe.linkSystemLibrary("kernel32"); } @@ -462,9 +462,9 @@ fn addCmph( "-std=c11", }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/gnu"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/gnu" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); @@ -538,8 +538,8 @@ fn addYacc( "-std=c90", }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); @@ -590,10 +590,10 @@ fn addYabfc( "-std=c99", }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/linux"); - exe.addIncludePath("inc/gnu"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/linux" }); + exe.addIncludePath(.{ .path = "inc/gnu" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); @@ -631,7 +631,7 @@ fn addSecretGame( .target = target, .optimize = optimize, }); - const install = b.addInstallArtifact(exe); + const install = b.addInstallArtifact(exe, .{}); exe.step.dependOn(&repo.step); const repo_path = repo.getPath(&exe.step); var files = std.ArrayList([]const u8).init(b.allocator); @@ -645,10 +645,10 @@ fn addSecretGame( "-std=c90", }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/linux"); - exe.addIncludePath("inc/gnu"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/linux" }); + exe.addIncludePath(.{ .path = "inc/gnu" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); diff --git a/busybox/build.zig b/busybox/build.zig index 8bff177..6f8311f 100644 --- a/busybox/build.zig +++ b/busybox/build.zig @@ -54,7 +54,7 @@ pub fn add( .target = target, .optimize = optimize, }); - const install = b.addInstallArtifact(exe); + const install = b.addInstallArtifact(exe, .{}); exe.step.dependOn(&prep.step); const repo_path = repo.getPath(&exe.step); var files = std.ArrayList([]const u8).init(b.allocator); @@ -67,11 +67,11 @@ pub fn add( exe.addCSourceFiles(files.toOwnedSlice() catch unreachable, &[_][]const u8{ "-std=c99", }); - exe.addIncludePath(b.pathJoin(&.{ repo_path, "include" })); + exe.addIncludePath(.{ .path = b.pathJoin(&.{ repo_path, "include" }) }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/linux"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/linux" }); exe.linkLibrary(libc_only_std_static); //exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); diff --git a/gnumakebuild.zig b/gnumakebuild.zig index 1b660a3..a1f1203 100644 --- a/gnumakebuild.zig +++ b/gnumakebuild.zig @@ -73,7 +73,7 @@ pub fn addGnuMake( .target = target, .optimize = optimize, }); - const install = b.addInstallArtifact(exe); + const install = b.addInstallArtifact(exe, .{}); exe.step.dependOn(&repo.step); exe.step.dependOn(config_step); const repo_path = repo.getPath(&exe.step); @@ -82,7 +82,7 @@ pub fn addGnuMake( files.append(b.pathJoin(&.{ repo_path, "src", src })) catch unreachable; } - exe.addIncludePath(b.pathJoin(&.{ repo_path, "src" })); + exe.addIncludePath(.{ .path = b.pathJoin(&.{ repo_path, "src" }) }); exe.addCSourceFiles(files.toOwnedSlice() catch unreachable, &[_][]const u8{ "-std=c99", "-DHAVE_CONFIG_H", @@ -104,10 +104,10 @@ pub fn addGnuMake( //"-Wlogical-op", "-Wformat-signedness", "-Wduplicated-cond", }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/gnu"); - exe.addIncludePath("inc/alloca"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/gnu" }); + exe.addIncludePath(.{ .path = "inc/alloca" }); exe.linkLibrary(libc_only_std_static); exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); diff --git a/ncurses/build.zig b/ncurses/build.zig index 37bc399..7bd2f9b 100644 --- a/ncurses/build.zig +++ b/ncurses/build.zig @@ -151,7 +151,7 @@ pub fn add( // b.pathJoin(&.{"include", "curses.head"}), // .{ .subs = &.{ defs_sub } }, //); - const install = b.addInstallArtifact(exe); + const install = b.addInstallArtifact(exe, .{}); exe.step.dependOn(&prep.step); const repo_path = repo.getPath(&exe.step); var files = std.ArrayList([]const u8).init(b.allocator); @@ -161,13 +161,13 @@ pub fn add( exe.addCSourceFiles(files.toOwnedSlice() catch unreachable, &[_][]const u8{ "-std=c99", }); - exe.addIncludePath(b.pathJoin(&.{ repo_path, "include" })); - exe.addIncludePath(b.pathJoin(&.{ repo_path, "ncurses" })); + exe.addIncludePath(.{ .path = b.pathJoin(&.{ repo_path, "include" }) }); + exe.addIncludePath(.{ .path = b.pathJoin(&.{ repo_path, "ncurses" }) }); - exe.addIncludePath("inc/libc"); - exe.addIncludePath("inc/posix"); - exe.addIncludePath("inc/linux"); - //exe.addIncludePath("inc/gnu"); + exe.addIncludePath(.{ .path = "inc/libc" }); + exe.addIncludePath(.{ .path = "inc/posix" }); + exe.addIncludePath(.{ .path = "inc/linux" }); + //exe.addIncludePath(.{.path="inc/gnu"}); exe.linkLibrary(libc_only_std_static); //exe.linkLibrary(zig_start); exe.linkLibrary(zig_posix); diff --git a/ziglibcbuild.zig b/ziglibcbuild.zig index bd486d6..74d92fa 100644 --- a/ziglibcbuild.zig +++ b/ziglibcbuild.zig @@ -100,10 +100,10 @@ pub fn addLibc(builder: *std.build.Builder, opt: ZigLibcOptions) *std.build.LibE }; modules_options.addOption(bool, "cstd", include_cstd); if (include_cstd) { - lib.addCSourceFile(relpath("src" ++ std.fs.path.sep_str ++ "printf.c"), &c_flags); - lib.addCSourceFile(relpath("src" ++ std.fs.path.sep_str ++ "scanf.c"), &c_flags); + lib.addCSourceFile(.{ .file = .{ .path = relpath("src" ++ std.fs.path.sep_str ++ "printf.c") }, .flags = &c_flags }); + lib.addCSourceFile(.{ .file = .{ .path = relpath("src" ++ std.fs.path.sep_str ++ "scanf.c") }, .flags = &c_flags }); //, }); //, if (opt.target.getOsTag() == .linux) { - lib.addAssemblyFile(relpath("src/linux/jmp.s")); + lib.addAssemblyFile(.{ .path = relpath("src/linux/jmp.s") }); } } const include_posix = switch (opt.variant) { @@ -112,7 +112,7 @@ pub fn addLibc(builder: *std.build.Builder, opt: ZigLibcOptions) *std.build.LibE }; modules_options.addOption(bool, "posix", include_posix); if (include_posix) { - lib.addCSourceFile(relpath("src" ++ std.fs.path.sep_str ++ "posix.c"), &c_flags); + lib.addCSourceFile(.{ .file = .{ .path = relpath("src" ++ std.fs.path.sep_str ++ "posix.c") }, .flags = &c_flags }); } const include_linux = switch (opt.variant) { .only_linux, .full => true, @@ -120,8 +120,8 @@ pub fn addLibc(builder: *std.build.Builder, opt: ZigLibcOptions) *std.build.LibE }; modules_options.addOption(bool, "linux", include_linux); if (include_cstd or include_posix) { - lib.addIncludePath(relpath("inc" ++ std.fs.path.sep_str ++ "libc")); - lib.addIncludePath(relpath("inc" ++ std.fs.path.sep_str ++ "posix")); + lib.addIncludePath(.{ .path = relpath("inc" ++ std.fs.path.sep_str ++ "libc") }); + lib.addIncludePath(.{ .path = relpath("inc" ++ std.fs.path.sep_str ++ "posix") }); } const include_gnu = switch (opt.variant) { .only_gnu, .full => true, @@ -129,7 +129,7 @@ pub fn addLibc(builder: *std.build.Builder, opt: ZigLibcOptions) *std.build.LibE }; modules_options.addOption(bool, "gnu", include_gnu); if (include_gnu) { - lib.addIncludePath(relpath("inc" ++ std.fs.path.sep_str ++ "gnu")); + lib.addIncludePath(.{ .path = relpath("inc" ++ std.fs.path.sep_str ++ "gnu") }); } return lib; }