diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-12-13 20:17:13 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-12-13 20:36:41 +0100 |
commit | bc5a4cf5fcc70e30028ff8fa91dca075896b2764 (patch) | |
tree | 24b7fe9cc18a8deb3b30ee6f1265152ba8ad628f /build.zig | |
parent | 4d639d934ec56b53e8f4776a7a0794f05b5451b6 (diff) |
Include all libxcb utils (wm, util, image, errors, cursor)
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 59 |
1 files changed, 43 insertions, 16 deletions
@@ -14,29 +14,37 @@ pub fn build(b: *std.Build) void { const libXcb = buildXcb(b, &target, optimize, single_threaded); lib.linkLibrary(libXcb); - lib.addIncludePath(.{ .path = "depends/libxcb/include" }); - lib.addIncludePath(.{ .path = "depends/libxcb-keysyms" }); - lib.addIncludePath(.{ .path = "depends/libxcb/depends/xorgproto/include" }); - lib.addIncludePath(.{ .path = "depends/libxcb-render-util" }); lib.linkLibC(); lib.strip = optimize != std.builtin.OptimizeMode.Debug; lib.want_lto = optimize != std.builtin.OptimizeMode.Debug; lib.single_threaded = single_threaded; + lib.addIncludePath(.{ .path = "depends/libxcb/include" }); lib.installHeadersDirectory("depends/libxcb/include", "."); - lib.installHeadersDirectoryOptions(.{ - .source_dir = .{ .path = "depends/libxcb-keysyms" }, - .install_dir = .header, - .install_subdir = ".", - .exclude_extensions = &.{ ".c" }, - }); - lib.installHeadersDirectoryOptions(.{ - .source_dir = .{ .path = "depends/libxcb-render-util" }, - .install_dir = .header, - .install_subdir = ".", - .exclude_extensions = &.{ ".c" }, - }); + + lib.addIncludePath(.{ .path = "depends/libxcb/depends/xorgproto/include" }); lib.installHeadersDirectory("depends/libxcb/depends/xorgproto/include", "."); + + const util_deps = [_][]const u8 { + "depends/libxcb-keysyms", + "depends/libxcb-render-util", + "depends/libxcb-wm", + "depends/libxcb-util", + "depends/libxcb-image", + "depends/libxcb-errors", + "depends/libxcb-cursor", + }; + + for(&util_deps) |dep| { + lib.addIncludePath(.{ .path = dep }); + lib.installHeadersDirectoryOptions(.{ + .source_dir = .{ .path = dep }, + .install_dir = .header, + .install_subdir = ".", + .exclude_extensions = &.{ ".c" }, + }); + } + b.installArtifact(lib); } @@ -177,6 +185,25 @@ fn buildXcb(b: *std.Build, target: *const std.zig.CrossTarget, optimize: std.bui "depends/libxcb-render-util/xcb/cache.c", "depends/libxcb-render-util/xcb/glyph.c", "depends/libxcb-render-util/xcb/util.c", + + // libxcb-wm + "depends/libxcb-wm/xcb/icccm.c", + + // libxcb-util + "depends/libxcb-util/xcb/event.c", + "depends/libxcb-util/xcb/xcb_aux.c", + "depends/libxcb-util/xcb/atoms.c", + + // libxcb-image + "depends/libxcb-image/xcb/xcb_image.c", + + // libxcb-errors + "depends/libxcb-errors/xcb/xcb_errors.c", + + // libxcb-cursor + "depends/libxcb-cursor/xcb/parse_cursor_file.c", + "depends/libxcb-cursor/xcb/load_cursor.c", + "depends/libxcb-cursor/xcb/cursor.c", }, .flags = &.{ "-DHAVE_CONFIG_H", |