Skip to content

Add zig compatibility #61

@gitbuda

Description

@gitbuda

SOURCE: https://discord.com/channels/842007348272169002/842008652377751582/1191840879812554834

export CC="zig cc"
export CXX="zig c++"
cmake ..
make

zig.build

exe.linkLibC();
exe.linkSystemLibrary("mgclient");

TODO: Add under examples

const mgclient = @cImport(
    @cInclude("mgclient.h"),
);
pub fn main() !void {
    const initialization = mgclient.mg_init();
    std.debug.print("we initialized mgclient? {d}\n", .{initialization});
    const mg_client_version = mgclient.mg_client_version();
    std.debug.print("Here is the mgclient version from zig: {s}\n", .{mg_client_version});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions