rust-lang / cmake-rs

Rust build dependency for running cmake
https://docs.rs/cmake
Apache License 2.0
301 stars 121 forks source link

Set `CMAKE_SYSTEM_NAME=Generic` for bare-metal systems #187

Closed frankplow closed 3 weeks ago

frankplow commented 11 months ago

For targets without an operating system, the system name Generic is recommended in the CMake documentation:

CMAKE_SYSTEM_NAME

This variable is mandatory; it sets the name of the target system, i.e. to the same value as CMAKE_SYSTEM_NAME would have if CMake were run on the target system. Typical examples are “Linux” and “Windows.” It is used for constructing the file names of the platform files like Linux.cmake or Windows-gcc.cmake. If your target is an embedded system without an OS, set CMAKE_SYSTEM_NAME to “Generic.”

This helps with some project configurations I have found.