mirror of
https://github.com/pumpbin/pumpbin
synced 2026-03-15 07:14:30 -07:00
Implementing a Plug-in System with Extism. Serialize the Plugin struct with Cap'n Proto for backward compatibility. Refactor the project code.
29 lines
614 B
Rust
29 lines
614 B
Rust
fn build_capnp() {
|
|
capnpc::CompilerCommand::new()
|
|
.src_prefix("capnp")
|
|
.file("capnp/plugin.capnp")
|
|
.output_path("capnp")
|
|
.run()
|
|
.expect("schema compiler command");
|
|
}
|
|
|
|
fn main() {
|
|
#[cfg(debug_assertions)]
|
|
build_capnp();
|
|
|
|
#[cfg(target_os = "windows")]
|
|
{
|
|
let mut res = winresource::WindowsResource::new();
|
|
res.set_icon("logo/icon.ico");
|
|
res.compile().unwrap();
|
|
}
|
|
|
|
#[cfg(target_os = "macos")]
|
|
{
|
|
use std::fs;
|
|
|
|
let version = env!("CARGO_PKG_VERSION");
|
|
fs::write("VERSION", version).unwrap();
|
|
}
|
|
}
|