|
Uni20
Asynchronous tensor and runtime library.
|
Uni20 records CMake build metadata in a generated C++ header. The same generated data backs the C++ API, the Python binding, and the terminal example.
Include <uni20/buildinfo.hpp> and query the current build:
current() returns a lightweight view with string fields for the generator, build type, system, and compiler, plus two spans:
info.build_options: UNI20_* cache options and dependency settings.info.detected_environment: detected UNI20_DETECTED_* entries.Each entry has:
The Python binding exposes the same data as a dictionary:
The dictionary has scalar fields such as generator, build_type, and cxx_compiler_id, plus build_options and detected_environment sub-dictionaries. Each sub-dictionary entry has a value field and, when available, a help field.
Use buildinfo_pretty() when a formatted string is more convenient than the raw dictionary:
Build and run the C++ example:
The example uses the common presentation layer for color, glyphs, display-cell width handling, and wrapping. It does not define build-info-specific environment variables. Existing general controls apply:
UNI20_GLYPHS: selects emoji, unicode, or ascii semantic glyphs.UNI20_CHARSET: selects utf8, escape, or replace text rendering.UNI20_COLOR: selects auto, forced color, or disabled color.NO_COLOR: disables automatic ANSI color output when set to a non-empty value.COLUMNS: overrides destination-specific terminal width detection for wrapping when set to a positive integer.UNI20_FALLBACK_TERMINAL_WIDTH: CMake cache setting for non-terminal output width; defaults to 132.