lazybios 3.0.0
Lightweight SMBIOS/DMI parsing library
Loading...
Searching...
No Matches
Building and Integration

Build requirements, CMake integration, pkg-config integration, and logging options.

Requirements

lazybios requires a C99 compiler and CMake 3.15 or newer. The library has no third-party runtime dependencies. A supported SMBIOS data source is required only when reading from the host; file-based parsing can be used on any build platform supported by the codebase.

On macOS, CMake locates and links the system IOKit and CoreFoundation frameworks required by the AppleSMBIOS backend. Linux, Windows, ReactOS, OpenBSD, FreeBSD and its derivatives, NetBSD, SunOS (Solaris/illumos), DragonFly BSD, Haiku, BeOS, QNX Neutrino, and MINIX 3 use interfaces supplied by their base systems; CMake selects the matching backend source for the target operating system (including ReactOS via cmake-files/reactOS.cmake). An unrecognized target selects the generic /dev/mem source, which assumes a POSIX-like x86 environment.

Operating system definition macros (such as OS_LINUX, OS_WINDOWS, OS_REACTOS, OS_MACOS, OS_FREEBSD, OS_OPENBSD, OS_NETBSD, OS_DRAGONFLY, OS_SUNOS, OS_HAIKU, OS_BEOS, OS_QNX, OS_MINIX, and OS_GENERIC) are centrally managed and defined by CMake compile definitions rather than compiler-provided host preprocessor macros in internal headers, ensuring reliable cross-compilation behavior. File-based parsing is the portable alternative.

Building from source

cmake -S . -B build
cmake --build build

The build produces the shared lazybios library and the lazybios_test inspection executable.

Testing

Enable and run the deterministic semantic test suite with:

cmake -S . -B build -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build --output-on-failure

Installing

cmake --install build

The installation exports a CMake package, installs the public header, and installs a pkg-config metadata file.

CMake consumers

find_package(lazybios REQUIRED)
target_link_libraries(your_target PRIVATE lazybios::lazybios)

pkg-config consumers

pkg-config --cflags --libs lazybios

Logging configuration

LAZYBIOS_QUIET disables library logging. LAZYBIOS_DEBUG enables debug messages in addition to ordinary diagnostics. Configure either behavior with its corresponding CMake option:

cmake -S . -B build -DLAZYBIOS_QUIET=ON
cmake -S . -B build -DLAZYBIOS_DEBUG=ON

When neither option is enabled, normal library diagnostics remain active.

See also
Getting Started
Testing, Fuzzing, and Regressions
Context and Data Loading