mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
doc: Add a section for targeting MCUs in the C++ documentation
Fixes #4180
This commit is contained in:
parent
03bed1a4eb
commit
d44717a11d
1 changed files with 22 additions and 1 deletions
|
@ -160,7 +160,28 @@ Set up the environment and build:
|
|||
cd <PROJECT_ROOT>
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DRust_CARGO_TARGET=aarch64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/slint/install/path ...
|
||||
cmake -DRust_CARGO_TARGET=aarch64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/slint/install/path ..
|
||||
cmake --build .
|
||||
cmake --install .
|
||||
```
|
||||
|
||||
#### Microcontrollers
|
||||
|
||||
To target a Microcontroller environment, all of the following additional CMake configuration options must be set when compiling Slint:
|
||||
|
||||
| Option | Description |
|
||||
|---------------------------------------------------------------|----------------------------------------------------------------------|
|
||||
| `-DSLINT_FEATURE_FREESTANDING=ON` | Enables building for environments without a standard library. |
|
||||
| `-DBUILD_SHARED_LIBS=OFF` | Disables shared library support and instead builds Slint statically. |
|
||||
| `-DSLINT_FEATURE_RENDERER_SOFTWARE=ON` | Enable support for the software renderer. |
|
||||
| `-DDEFAULT_SLINT_EMBED_RESOURCES=embed-for-software-renderer` | Default to pre-compiling images and fonts. |
|
||||
|
||||
|
||||
For example, if you're targeting an MCU with a ARM Cortex-M processor, the complete command line for CMake could look like this:
|
||||
|
||||
```sh
|
||||
cmake -DRust_CARGO_TARGET=thumbv7em-none-eabihf -DSLINT_FEATURE_FREESTANDING=ON
|
||||
-DBUILD_SHARED_LIBS=OFF -DSLINT_FEATURE_RENDERER_SOFTWARE=ON
|
||||
-DDEFAULT_SLINT_EMBED_RESOURCES=embed-for-software-renderer
|
||||
..
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue