Skip to content

Commit

Permalink
Document SLINT_ENABLED/DISABLED_FEATURES target properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical committed Jul 4, 2024
1 parent 964de46 commit 7ab7dd6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/cpp/docs/cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ to discover and toggle features.
This works when compiling Slint as a package, using `cmake --build` and
`cmake --install`, or when including Slint using `FetchContent`.

If you need to check in your application's `CMakeLists.txt` whether a feature is enabled
or disabled, read the `SLINT_ENABLED_FEATURES` and `SLINT_DISABLED_FEATURES` target
properties from the `Slint::Slint` cmake target:

```cmake
get_target_property(slint_enabled_features Slint::Slint SLINT_ENABLED_FEATURES)
if ("BACKEND_WINIT" IN_LIST slint_enabled_features)
...
endif()
```

### Rust Flags

Slint uses [Corrosion](https://github.com/corrosion-rs/corrosion) to build Slint, which is developed in Rust. You can utilize [Corrosion's global CMake variables](https://corrosion-rs.github.io/corrosion/usage.html#global-corrosion-options) to control certain aspects of the Rust build process.
Expand Down

0 comments on commit 7ab7dd6

Please sign in to comment.