32 Commits

Author SHA1 Message Date
Shieldine
64bc6ea985 Mac: os: add build version and endianess check (#123)
* add os build number and actual endianess check, update readme

* remove unused import

* update readme

* refactor, remove weird character at the end of CPU model

* remove unused imports

* add whitespaces to defaults
2025-05-09 14:29:30 +02:00
BohdanBuinich
9107f80434 Retrieve free disk space macOS, Linux, and Windows. (#119)
* Retrieve free disk space macOS, Linux, and Windows.

This commit (and PR) introduces a **new function** to retrieve free disk space in a unified manner across macOS, Linux, and Windows.
It refactors existing logic to ensure consistency, readability, and maintainability.

- **Common**
  - Introduced a new function/method to retrieve free disk size in a consistent manner across platforms.

- **macOS**
  - Implemented a mount-based approach using `statfs()` to fetch free space.
  - Physical or container disks (like `disk0` or APFS containers) may return **-1** if they have **no** mounted filesystem.
    For example, APFS containers are not directly mounted but contain APFS volumes; only the volumes have valid mount points.

- **Linux**
  - Leveraged existing logic with `statvfs()` for retrieving free space.
  - Minor refactoring.

- **Windows**
  - Maintained the `GetLogicalDriveStrings()` + `GetDiskFreeSpaceEx()` approach for free size.

- Returning **-1** indicates an **unreachable** or **unmounted** filesystem. This behavior is most commonly seen on **macOS** with APFS containers or physical devices that are **not** directly mounted.
- In all scenarios, if the disk cannot be located or if the OS functions fail, **-1** is returned to signify no valid free-space calculation.

* feat: support getting volume paths (#2)

* fix: use the latest supported standard instead of forcing C++-11

* feat: support getting volume paths

* docs: update readme to add the volumes support

* Update CMakeLists.txt

reverted changes

* Update CMakeLists.txt

---------

Co-authored-by: Amin Ya <aminyahyaabadi74@gmail.com>
Co-authored-by: Leon Freist <freist.leon@gmail.com>
2025-04-23 21:11:35 +02:00
keineahnung2345
1976b51452 Release build instruction for windows (#110) 2024-10-13 17:50:43 +02:00
Hlongyu
46690dd367 rename hwinfo to lfreist-hwinfo when use find_package() (#107) 2024-08-31 16:26:05 +02:00
Leon Freist
82161e7bb5 cmake install; cmake fixes 2024-08-02 22:20:04 +02:00
Leon Freist
4e62ff713b cmake modules: static and shared builds 2024-07-24 15:43:12 +02:00
Amin Yahyaabadi
ef8fce2d91 feat: make hwinfo features modular (#98)
* feat: make hwinfo features modular

* fix: use the latest available C++ standard

* fix!: deprecate NO_OCL in favour of HWINFO_GPU_OPENCL

* doc: add docs for the modular targets/options

* fix: add preprocessor feature guards

* ci: test build of all features in ci

* fix: detect C++ standard after enabling C++ language
2024-07-24 08:41:46 +02:00
Shieldine
4329c4ca9e Mac: add battery capacity, charging status and serial number (#96) 2024-07-10 06:52:06 +02:00
Amin Yahyaabadi
5ce95ecd0e feat: add disk feature detection for MacOS (#91) 2024-07-07 20:08:05 +02:00
Shieldine
fdcf7321b0 MacOS: Implement/fix various functions (#86) 2024-06-15 22:23:19 +02:00
Arthur Baurens
2dbd208ba8 using target_link_library with PUBLIC access so that CMake can forwards includes automatically (#25) 2023-10-01 20:17:38 +02:00
Leon Freist
99f1d6dcc5 included miss-opencl 2023-09-28 11:40:04 +02:00
Leon Freist
2d0e92d536 Update README.md
update README.md
2023-07-04 20:30:40 +02:00
Leon Freist
6c0c423490 Update README.md
update README.md
2023-07-04 15:01:00 +02:00
Leon Freist
ae4f35ba1f init submodules in actions 2023-06-27 09:15:00 +02:00
Leon Freist
2677bdccc8 updated README.md and style 2022-12-14 08:55:04 +01:00
lfreist
d704fdfc73 format check 2022-11-28 10:18:13 +01:00
lfreist
8b1ea120e3 added API calls to functionality 2022-10-13 10:05:51 +02:00
lfreist
80ac1f2d85 added API calls to functionality 2022-10-13 10:02:51 +02:00
lfreist
b834ea6a64 added API calls to functionality 2022-10-13 10:01:50 +02:00
Leon Freist
097e015641 Update README.md 2022-09-21 16:56:05 +02:00
lfreist
c45ace85b0 battery implementation for linux 2022-09-21 16:55:28 +02:00
lfreist
b4bfd63f63 started implementing battery 2022-09-20 15:09:51 +02:00
lfreist
9d56cdbc0b Merge remote-tracking branch 'origin/main'
# Conflicts:
#	README.md
2022-09-20 14:45:22 +02:00
lfreist
8dfb8ca362 windows disk information 2022-09-17 17:14:56 +02:00
lfreist
ad2fd4270c started implementing battery 2022-09-11 16:08:54 +02:00
lfreist
685677d1a8 added current functionality to README.md 2022-09-02 12:11:17 +02:00
Leon Freist
9cec2050d1 Update README.md 2022-08-25 19:38:23 +02:00
Leon Freist
fce635fb20 Update README.md 2022-08-23 23:03:51 +02:00
lfreist
a1375660c6 initial commit 2022-08-23 14:56:43 +02:00
lfreist
b2c614cf8c initial commit 2022-08-23 14:48:26 +02:00
Leon Freist
dea1c8d4e1 Initial commit 2022-08-23 14:01:27 +02:00