Make it easier to create new examples

This commit is contained in:
Jakub Clark 2020-05-31 02:24:51 +02:00
parent 4b4021e982
commit 6346e8451a
8 changed files with 24 additions and 14 deletions

View file

@ -2,5 +2,5 @@
members = [ members = [
"lvgl", "lvgl",
"lvgl-sys", "lvgl-sys",
"examples/demo", "examples"
] ]

View file

@ -54,4 +54,10 @@ That is required, so we can safely provide Rust pointers through FFI. For that r
## Running the demo ## Running the demo
[This project contains an example that can run in a desktop simulator.](./examples/demo) [This project contains examples that can run in a desktop simulator.](./examples)
To run the `demo` example:
```shell
$ DEP_LV_CONFIG_PATH=`pwd`/examples/include cargo run --example demo
```

16
examples/Cargo.toml Normal file
View file

@ -0,0 +1,16 @@
[package]
name = "demo"
version = "0.1.0"
authors = ["Rafael Caricio <crates@caric.io>"]
edition = "2018"
publish = false
[dev-dependencies]
lvgl = { path = "../lvgl" }
lvgl-sys = { path = "../lvgl-sys" }
embedded-graphics = "0.6"
embedded-graphics-simulator = "0.2.0"
[[example]]
name = "demo"
path = "demo.rs"

View file

@ -1,12 +0,0 @@
From base of the repository, install LVGL git submodule.
```
git submodule update --init
```
Run this demo:
```
cd examples/demo/
DEP_LV_CONFIG_PATH=./include cargo run
```