update build.zig to zig 0.16.0
Some checks failed
Test CMake build / Cmake (push) Has been cancelled
Test CMake build / Cmake-1 (push) Has been cancelled
Test CMake build / Cmake-2 (push) Has been cancelled
Test CMake build / Cmake-3 (push) Has been cancelled
Test CMake build / Cmake-4 (push) Has been cancelled
Test CMake build / Cmake-5 (push) Has been cancelled
Test CMake build / Cmake-6 (push) Has been cancelled
Test CMake build / Cmake-7 (push) Has been cancelled
Test CMake build / Cmake-8 (push) Has been cancelled
Test CMake build / Cmake-9 (push) Has been cancelled
Test CMake build / Cmake-10 (push) Has been cancelled
Test CMake build / Cmake-11 (push) Has been cancelled
Test CMake build / Cmake-12 (push) Has been cancelled
Test CMake build / Cmake-13 (push) Has been cancelled
Test CMake build / Cmake-14 (push) Has been cancelled
Test CMake build / Cmake-15 (push) Has been cancelled
Test CMake build / Cmake-16 (push) Has been cancelled
Test CMake build / Cmake-17 (push) Has been cancelled
Check code style / Check code style (push) Has been cancelled
Test Make 32bit build / Make (push) Has been cancelled
Test Make 32bit build / Make-1 (push) Has been cancelled
Test Make 32bit build / Make-2 (push) Has been cancelled
Test Make 32bit build / Make-3 (push) Has been cancelled
Test Make 32bit build / Make-4 (push) Has been cancelled
Test Make 32bit build / Make-5 (push) Has been cancelled
Test Make 32bit build / Make-6 (push) Has been cancelled
Test Make 32bit build / Make-7 (push) Has been cancelled
Test Make 32bit build / Make-8 (push) Has been cancelled
Test Make 32bit build / Make-9 (push) Has been cancelled
Test Make build / Make (push) Has been cancelled
Test Make build / Make-1 (push) Has been cancelled
Test Make build / Make-2 (push) Has been cancelled
Test Make build / Make-3 (push) Has been cancelled
Test Make build / Make-4 (push) Has been cancelled
Test Make build / Make-5 (push) Has been cancelled
Test Make build / Make-6 (push) Has been cancelled
Test Make build / Make-7 (push) Has been cancelled
Test Make build / Make-8 (push) Has been cancelled
Test Make build / Make-9 (push) Has been cancelled
Test Make build / Make-10 (push) Has been cancelled
Test Make build / Make-11 (push) Has been cancelled
Test Make build / Make-12 (push) Has been cancelled
Test Make build / Make-13 (push) Has been cancelled
Test for memory leaks / Valgrind (push) Has been cancelled
Test Cmake build on Windows / CMake on Windows (push) Has been cancelled
Test Cmake build on Windows / CMake on Windows-1 (push) Has been cancelled
Test Cmake build on Windows / CMake on Windows-2 (push) Has been cancelled
Test Cmake build on Windows / CMake on Windows-3 (push) Has been cancelled
Test Cmake build on Windows / CMake on Windows-4 (push) Has been cancelled
Zig Build / build (macos-latest) (push) Has been cancelled
Zig Build / build (ubuntu-latest) (push) Has been cancelled
Zig Build / build (windows-latest) (push) Has been cancelled

This commit is contained in:
geemili 2026-04-15 16:09:14 -06:00 committed by John McNamara
parent 2894634d65
commit fdca3e44af
3 changed files with 24 additions and 23 deletions

3
.gitignore vendored
View file

@ -58,5 +58,6 @@ third_party/zlib-1.2.8/zlib.pc
*zig-cache/
zig-out/
zig-pkg/
.swiftpm/
.swiftpm/

View file

@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void {
}
if (tests)
lib.root_module.addCMacro("TESTING", "");
lib.addCSourceFiles(.{
lib.root_module.addCSourceFiles(.{
.files = &.{
"src/vml.c",
"src/chartsheet.c",
@ -67,7 +67,7 @@ pub fn build(b: *std.Build) void {
// minizip
if (minizip) {
lib.addCSourceFiles(.{
lib.root_module.addCSourceFiles(.{
.files = switch (lib.rootModuleTarget().os.tag) {
.windows => minizip_src ++ [_][]const u8{
"third_party/minizip/iowin32.c",
@ -79,37 +79,37 @@ pub fn build(b: *std.Build) void {
}
const zlib = buildZlib(b, options);
lib.linkLibrary(zlib);
lib.root_module.linkLibrary(zlib);
lib.installLibraryHeaders(zlib);
// md5
if (!md5)
lib.addCSourceFile(.{
lib.root_module.addCSourceFile(.{
.file = b.path("third_party/md5/md5.c"),
.flags = cflags,
})
else
lib.linkSystemLibrary("crypto");
lib.root_module.linkSystemLibrary("crypto", .{});
// dtoa
if (dtoa)
lib.addCSourceFile(.{
lib.root_module.addCSourceFile(.{
.file = b.path("third_party/dtoa/emyg_dtoa.c"),
.flags = cflags,
});
// tmpfileplus
if (stdtmpfile)
lib.addCSourceFile(.{
lib.root_module.addCSourceFile(.{
.file = b.path("third_party/tmpfileplus/tmpfileplus.c"),
.flags = cflags,
})
else
lib.root_module.addCMacro("USE_STANDARD_TMPFILE", "");
lib.addIncludePath(b.path("include"));
lib.addIncludePath(b.path("third_party"));
lib.linkLibC();
lib.root_module.addIncludePath(b.path("include"));
lib.root_module.addIncludePath(b.path("third_party"));
lib.root_module.link_libc = true;
// get headers on include to zig-out/include
lib.installHeadersDirectory(b.path("include"), "", .{});
@ -280,15 +280,15 @@ fn buildExe(b: *std.Build, info: BuildExec) void {
.name = info.filename(),
.root_module = createModule(b, info.options),
});
exe.addCSourceFile(.{
exe.root_module.addCSourceFile(.{
.file = b.path(info.path),
.flags = cflags,
});
exe.linkLibrary(info.lib);
exe.root_module.linkLibrary(info.lib);
for (info.lib.root_module.include_dirs.items) |include| {
exe.root_module.include_dirs.append(b.allocator, include) catch @panic("OOM");
}
exe.linkLibC();
exe.root_module.link_libc = true;
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
@ -310,20 +310,20 @@ fn buildTest(b: *std.Build, info: BuildExec) void {
.root_module = createModule(b, info.options),
});
exe.root_module.addCMacro("TESTING", "");
exe.addCSourceFile(.{
exe.root_module.addCSourceFile(.{
.file = b.path(info.path),
.flags = cflags,
});
exe.addCSourceFile(.{
exe.root_module.addCSourceFile(.{
.file = b.path("test/unit/test_all.c"),
.flags = cflags,
});
exe.addIncludePath(b.path("test/unit"));
exe.linkLibrary(info.lib);
exe.root_module.addIncludePath(b.path("test/unit"));
exe.root_module.linkLibrary(info.lib);
for (info.lib.root_module.include_dirs.items) |include| {
exe.root_module.include_dirs.append(b.allocator, include) catch @panic("OOM");
}
exe.linkLibC();
exe.root_module.link_libc = true;
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
@ -383,8 +383,8 @@ fn buildZlib(b: *std.Build, options: BuildConfig) *std.Build.Step.Compile {
.target = options.target,
.optimize = options.optimize,
})) |zlib_path| {
libz.addIncludePath(zlib_path.path(""));
libz.addCSourceFiles(.{
libz.root_module.addIncludePath(zlib_path.path(""));
libz.root_module.addCSourceFiles(.{
.root = zlib_path.path(""),
.files = &.{
"adler32.c",
@ -408,6 +408,6 @@ fn buildZlib(b: *std.Build, options: BuildConfig) *std.Build.Step.Compile {
libz.installHeader(zlib_path.path("zconf.h"), "zconf.h");
libz.installHeader(zlib_path.path("zlib.h"), "zlib.h");
}
libz.linkLibC();
libz.root_module.link_libc = true;
return libz;
}

View file

@ -2,7 +2,7 @@
.name = .libxlsxwriter,
.version = "1.1.9",
.fingerprint = 0xa28d9a85f22fad0e,
.minimum_zig_version = "0.15.1",
.minimum_zig_version = "0.16.0",
.dependencies = .{
.zlib = .{
.url = "git+https://github.com/madler/zlib#v1.3.1",