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
- Host: GitHub
- URL: https://github.com/mattnite/zig-libssh2
- Owner: mattnite
- License: mit
- Created: 2021-12-17T16:42:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T00:00:48.000Z (about 2 years ago)
- Last Synced: 2025-03-29T03:02:24.678Z (about 1 year ago)
- Topics: build, ssh, zig, zig-package
- Language: Zig
- Homepage:
- Size: 18.6 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libssh2 build package
[](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);
}
```