An open API service indexing awesome lists of open source software.

https://github.com/mattnite/zig-libssh2

compile libssh2 in your build.zig
https://github.com/mattnite/zig-libssh2

build ssh zig zig-package

Last synced: about 1 year ago
JSON representation

compile libssh2 in your build.zig

Awesome Lists containing this project

README

          

# libssh2 build package

[![ci](https://github.com/mattnite/zig-libssh2/actions/workflows/ci.yml/badge.svg)](https://github.com/mattnite/zig-libssh2/actions/workflows/ci.yml)

## Like this project?

If you like this project or other works of mine, please consider [donating to or sponsoring me](https://github.com/sponsors/mattnite) on Github [:heart:](https://github.com/sponsors/mattnite)

## How to use

This repo contains code for your `build.zig` that can statically compile libssh2.

### Link to your application

In order to statically link libssh2 into your application:

```zig
const libssh2 = @import("path/to/libssh2.zig");

pub fn build(b: *std.build.Builder) void {
// ...

const lib = libssh2.create(b, target, optimize);

const exe = b.addExecutable(.{
.name = "my-program",
.root_source_file = .{ .path = "src/main.zig" },
});
lib.link(exe);
}
```