neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

build.zig (855B)


      1 const std = @import("std");
      2 
      3 pub fn build(b: *std.Build) !void {
      4    const target = b.standardTargetOptions(.{});
      5    const optimize = b.standardOptimizeOption(.{});
      6 
      7    const lib = b.addLibrary(.{
      8        .name = "unibilium",
      9        .linkage = .static,
     10        .root_module = b.createModule(.{
     11            .target = target,
     12            .optimize = optimize,
     13        }),
     14    });
     15 
     16    if (b.lazyDependency("unibilium", .{})) |upstream| {
     17        lib.addIncludePath(upstream.path(""));
     18 
     19        lib.installHeader(upstream.path("unibilium.h"), "unibilium.h");
     20 
     21        lib.linkLibC();
     22 
     23        lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
     24            "unibilium.c",
     25            "uninames.c",
     26            "uniutil.c",
     27        }, .flags = &.{"-DTERMINFO_DIRS=\"/etc/terminfo:/usr/share/terminfo\""} });
     28    }
     29 
     30    b.installArtifact(lib);
     31 }