#imgui #ui #graphics #docking #multiview

dear-imgui-build-support

Build helpers for dear-imgui-sys family: compose archive names, prebuilt download/extract, manifest helpers

2 unstable releases

Uses new Rust 2024

new 0.2.0 Jan 12, 2026
0.1.0 Sep 26, 2025

#2444 in GUI

Download history 163/week @ 2025-09-22 115/week @ 2025-09-29 148/week @ 2025-10-06 94/week @ 2025-10-13 114/week @ 2025-10-20 45/week @ 2025-10-27 53/week @ 2025-11-03 45/week @ 2025-11-10 62/week @ 2025-11-17 88/week @ 2025-11-24 55/week @ 2025-12-01 115/week @ 2025-12-08 107/week @ 2025-12-15 99/week @ 2025-12-22 97/week @ 2025-12-29 64/week @ 2026-01-05

370 downloads per month
Used in 20 crates (6 directly)

MIT/Apache

19KB
414 lines

dear-imgui-build-support

Build helper utilities shared by dear-imgui-sys and its extensions.

This crate is intended for use in build scripts (build.rs) and internal packaging tools. It centralizes common logic around naming prebuilt archives, generating manifests, and downloading/extracting prebuilt static libraries.

Features

  • Compose archive names in a consistent scheme: <crate>-prebuilt-<version>-<target>-<link>[<extra>][-<crt>].tar.gz
  • Compose a manifest.txt describing the prebuilt contents (version, target, link type, CRT, features)
  • Download .tar.gz archives (HTTP(S), optional feature download) and extract to a cache
  • Utility helpers to build candidate GitHub release URLs

API Sketch

use build_support::{
    compose_archive_name,
    compose_manifest_bytes,
    expected_lib_name,
    release_tags,
    release_candidate_urls,
    download_prebuilt,
    extract_archive_to_cache,
    prebuilt_cache_root_from_env_or_target,
};

let name = compose_archive_name(
    "dear-imgui", env!("CARGO_PKG_VERSION"), target_triple, "static", None, crt_suffix,
);

let manifest = compose_manifest_bytes(
    "dear-imgui", env!("CARGO_PKG_VERSION"), target_triple, "static", crt_suffix, Some("freetype"),
);

let cache_root = prebuilt_cache_root_from_env_or_target(&manifest_dir, "IMGUI_SYS_CACHE_DIR", "dear-imgui-prebuilt");
let lib_name = expected_lib_name(target_env, "dear_imgui");
let lib_dir = download_prebuilt(&cache_root, url, &lib_name, target_env)?;

Blocking HTTP and TLS

HTTP(S) download support is behind the feature download, which enables ureq (with rustls). By default, the crate does not pull in an HTTP client.

download_prebuilt() always accepts local file paths (including file://...) without requiring the download feature. Note that extracting .tar.gz archives requires the feature archive (enabled automatically by download).

When to Use

  • In build.rs of dear-imgui-sys and extension -sys crates to handle optional prebuilt flows.
  • In internal packaging tools (e.g., bin/package) to ensure archive names and manifests are consistent.

Docs.rs / Offline Builds

This crate is not required for docs.rs. For crates that generate bindings at build time, consider checking in src/bindings_pregenerated.rs and copying/sanitizing it in build.rs during docs.rs builds.

License

Dual-licensed under MIT or Apache-2.0.

Dependencies

~0–12MB
~111K SLoC