Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/thechampagne/webview-zig

⚡ Zig binding & wrapper for a tiny cross-platform webview library to build modern cross-platform GUIs.
https://github.com/thechampagne/webview-zig

library webview zig zig-package ziglang

Last synced: 3 days ago
JSON representation

⚡ Zig binding & wrapper for a tiny cross-platform webview library to build modern cross-platform GUIs.

Awesome Lists containing this project

README

        

# webview-zig

[![](https://img.shields.io/github/v/tag/thechampagne/webview-zig?label=version)](https://github.com/thechampagne/webview-zig/releases/latest) [![](https://img.shields.io/github/license/thechampagne/webview-zig)](https://github.com/thechampagne/webview-zig/blob/main/LICENSE)

Zig binding for a tiny cross-platform **webview** library to build modern cross-platform GUIs.



### Requirements
- [Zig Compiler](https://ziglang.org/) - **0.12.0**
- Unix
- [GTK3](https://gtk.org/) and [WebKitGTK](https://webkitgtk.org/)
- Windows
- [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
- macOS
- [WebKit](https://webkit.org/)

### Usage
#### Auto
```
zig fetch --save https://github.com/thechampagne/webview-zig/archive/refs/heads/main.tar.gz
```
#### Manual
`build.zig.zon`:
```zig
.{
.dependencies = .{
.webview = .{
.url = "https://github.com/thechampagne/webview-zig/archive/refs/heads/main.tar.gz" ,
//.hash = "12208586373679a455aa8ef874112c93c1613196f60137878d90ce9d2ae8fb9cd511",
},
},
}
```
`build.zig`:
```zig
const webview = b.dependency("webview", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("webview", webview.module("webview"));
exe.linkLibrary(webview.artifact("webviewStatic")); // or "webviewShared" for shared library
// exe.linkSystemLibrary("webview"); to link with installed prebuilt library without building
```

### References
- [webview](https://github.com/webview/webview) - **0.10.0**

### License

This repo is released under the [MIT License](https://github.com/thechampagne/webview-zig/blob/main/LICENSE).

Third party code:
- [external/webview](https://github.com/thechampagne/webview-zig/tree/main/external/webview) licensed under the [MIT License](https://github.com/thechampagne/webview-zig/tree/main/external/webview/LICENSE).
- [external/WebView2](https://github.com/thechampagne/webview-zig/tree/main/external/WebView2) licensed under the [BSD-3-Clause License](https://github.com/thechampagne/webview-zig/tree/main/external/WebView2/LICENSE).