gent-link 0.2.20

Connect Codex and Claude Code chats across machines with the Gent CLI and desktop companion.
#[cfg(target_os = "macos")]
mod macos_build;

#[cfg(target_os = "linux")]
fn linux_dependencies(emit_link_flags: bool) -> [pkg_config::Library; 2] {
    [
        pkg_config::Config::new()
            .cargo_metadata(emit_link_flags)
            .atleast_version("2.40")
            .probe("webkit2gtk-4.1")
            .expect("WebKitGTK 4.1 development headers"),
        pkg_config::Config::new()
            .cargo_metadata(emit_link_flags)
            .probe("dbusmenu-glib-0.4")
            .expect("libdbusmenu-glib development headers"),
    ]
}

fn main() {
    #[cfg(target_os = "linux")]
    {
        println!("cargo:rerun-if-changed=native/webkit.c");
        println!("cargo:rerun-if-changed=native/fullscreen.c");
        println!("cargo:rerun-if-changed=native/linux_tray.h");
        println!("cargo:rerun-if-changed=native/linux_tray.c");
        println!("cargo:rerun-if-changed=native/linux_panel.c");
        println!("cargo:rerun-if-changed=native/linux_workarea.c");
        println!("cargo:rerun-if-changed=native/linux_sni.c");
        let [webkit, dbusmenu] = linux_dependencies(false);
        cc::Build::new()
            .file("native/linux_tray.c")
            .file("native/linux_panel.c")
            .file("native/linux_workarea.c")
            .file("native/linux_sni.c")
            .includes(dbusmenu.include_paths)
            .file("native/fullscreen.c")
            .file("native/webkit.c")
            .includes(webkit.include_paths)
            .compile("gent_webkit");
        // GNU ld --as-needed must see the archive's unresolved symbols before its providers.
        linux_dependencies(true);
    }
    println!("cargo:rerun-if-env-changed=GENT_DESKTOP_BUILD_REVISION");
    #[cfg(target_os = "macos")]
    macos_build::build();
    let manifest = tauri_build::AppManifest::new().commands(&["gent_bridge", "gent_board"]);
    tauri_build::try_build(tauri_build::Attributes::new().app_manifest(manifest))
        .expect("could not prepare Gent Desktop");
}