|
libui-ng
A portable GUI library for C
|
This repository provides unofficial kojix2 builds of libui-ng. It builds and distributes patched binaries while maintaining API compatibility with upstream libui-ng.
Releases are available at https://github.com/kojix2/libui-ng/releases.
Upstream projects:
pre-build: build branch for release binaries, with downstream fixes and compatible API additions (uiVersion, uiControlOnDestroyed, uiTabSelected, uiTabSetSelected, uiTabOnSelected, and uiGridDelete). uiControlDestroy is also safe to call from user callbacks. Tags use commit-xxxxxxx.dev: development branch based on pre-build, with additional fixes and experimental APIs (uiToolbar, uiImageView, uiDrawImage). Tags use commit-xxxxxxx-experimental.Pre-build branches may be rebased or force-pushed. Use release tags when you need a stable reference. Build details and included changes are tracked by the tags attached to each release.
Primary build and release automation is defined in .github/workflows/cmake.yml.
MinGW-w64 builds currently support static libraries only.
With a multi-configuration generator such as Visual Studio or Xcode, select the configuration at build and test time instead:
Common options:
-DLIBUI_BUILD_TESTS=ON|OFF-DLIBUI_BUILD_EXAMPLES=ON|OFF-DLIBUI_FETCH_TEST_DEPS=ON|OFF-DCMAKE_BUILD_TYPE=Debug|Release with single-configuration generators-DBUILD_SHARED_LIBS=ON|OFFExample:
Manual QA tests are under test/qa. Linux GUI tests can be run headlessly with xvfb-run ctest --test-dir build --output-on-failure.
When tests are enabled, CMake first looks for cmocka 1.1.8 or newer. A top-level build fetches the pinned 1.1.8 source if needed; nested builds never access the network unless LIBUI_FETCH_TEST_DEPS=ON is explicitly requested.
Set the install prefix during setup:
Installed CMake packages can be consumed with:
The same libui::ui target is available through add_subdirectory() and FetchContent_MakeAvailable().
Create an application target and link it to libui:
libui_configure_application() applies the platform-specific build and runtime settings needed by an application target. Applications that manage these details themselves can omit it. For reproducible builds, replace pre-build with an immutable tag from the release page.
When libui is brought in through FetchContent or add_subdirectory, its tests and examples default to off. A top-level libui build enables them by default.
A minimal main.c is:
Release ZIP files are relocatable CMake install trees. They contain public headers under include/, native libraries under lib/ (and DLLs under bin/ on Windows), license metadata, and the installed libui-ng CMake package. Static and shared SDKs are published separately for each supported platform, architecture, and Debug/Release configuration. MSVC static SDKs are additionally published in md (/MD) and mt (/MT) variants; MSVC shared SDKs use md. Select the variant that matches the CRT linkage of the consuming application. The complete set of release asset names is recorded in cmake/release-archives.txt.
After extracting an SDK, CMake consumers can set its root as a prefix:
Non-CMake consumers, including Crystal and Ruby extensions, can use include/, lib/, and bin/ directly. Library filenames remain native to the toolchain: MSVC uses .lib, MinGW and Unix static builds use .a, Windows shared builds provide a .dll and import library, and Unix/macOS shared builds provide .so/.dylib files.
ui.h.examples.test.See CONTRIBUTING.md.