Skip to content

Get the name of the OS, useful for dumps and debug!

License

Notifications You must be signed in to change notification settings

CoolLibs/os_name

Repository files navigation

os_name

Usage

std::string const name = Cool::os_name();
// Might return:
// "Windows 10.0.19041.2546"
// "Ubuntu 22.04.2 LTS"
// "MacOS 11.7.4"

Good to know: We cache the result so calling this function is extremely cheap after the first time.

Including

To add this library to your project, simply add these two lines to your CMakeLists.txt:

add_subdirectory(path/to/os_name)
target_link_libraries(${PROJECT_NAME} PRIVATE os_name::os_name)

Then include it as:

#include <os_name/os_name.hpp>

Running the tests

Simply use "tests/CMakeLists.txt" to generate a project, then run it.
If you are using VSCode and the CMake extension, this project already contains a .vscode/settings.json that will use the right CMakeLists.txt automatically.

About

Get the name of the OS, useful for dumps and debug!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published