Skip to content

OS module

Stanislav Vasilev edited this page Mar 4, 2025 · 17 revisions

Caution

The OS module and its submodules are not available when targeting WASM

The OS module provides many utility headers and functions for working with the underlying operating system. The module also includes a wide variety of submodules:

  • DBusUtils - Includes the UntitledDBusUtils library to make dealing with the C DBus API safer and easier
  • UExec - Includes the UntitledExec library for a cross-platform exec-like functions and utilities
  • XDG Integration - Includes the UntitledXDGBasedir library for handling usage of XDG base directories
  • Open module - Integrates the UntitledOpen library for opening URIs and files using a default application or native file picker

To enable the module, update your uvproj.yaml file like this

name: "MyProject"
version: "1.0.0.0"
engine-version: "1.0.0.0"
enabled-modules:
  os: true

Then, regenerate the modules cache by running the following command:

user $ ./UVKBuildTool --generate <project directory>

After that, refresh your CMake project with cmake ..!

The module needs to stay enabled for any submodules to be enabled!

Checking for the module

To check for the module at compile time, use the UIMGUI_OS_MODULE_ENABLED macro.

Runtime checking can be done using the os member of the ModuleSettings struct. More info can be found here.

Clone this wiki locally