Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zig compatibility #61

Open
gitbuda opened this issue May 19, 2024 · 0 comments
Open

Add zig compatibility #61

gitbuda opened this issue May 19, 2024 · 0 comments

Comments

@gitbuda
Copy link
Member

gitbuda commented May 19, 2024

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});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant