david-vanderson / dvui

Other
431 stars 36 forks source link

Add ability to disable backend linking/building #146

Closed VisenDev closed 1 month ago

VisenDev commented 1 month ago

Closes #144

Example usage in a project


    const dvui = b.dependency("dvui", .{
        .target = target,
        .optimize = optimize,
        .link_backend = false,
    });

   //raylib build can be customized here 
    const maybe_ray = dvui.builder.lazyDependency("raylib", .{ .target = target, .optimize = optimize });
    if (maybe_ray) |ray| {

        //link raylib against dvui
        dvui.module("backend_raylib").linkLibrary(ray.artifact("raylib"));

        //add raygui
        if (dvui.builder.lazyDependency("raygui", .{})) |raygui_dep| {
            if (dvui.builder.lazyImport(@import("dvui"), "raylib")) |raylib_build| {
                raylib_build.addRaygui(b, ray.artifact("raylib"), raygui_dep);
            }
        }
    }
david-vanderson commented 1 month ago

Thank you!