aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/rust.yml6
-rw-r--r--.gitignore1
-rw-r--r--Cargo.example.toml75
-rw-r--r--Cargo.toml58
4 files changed, 78 insertions, 62 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index d1a7ade0b..178ccf89c 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -81,10 +81,8 @@ jobs:
81 with: 81 with:
82 path: target 82 path: target
83 key: ${{ runner.os }}-${{ matrix.target }} 83 key: ${{ runner.os }}-${{ matrix.target }}
84 - uses: actions-rs/cargo@v1 84 - name: Check
85 with: 85 run: cd ${{ matrix.package }} && cargo check --features=${{ matrix.features }} --target=${{ matrix.target }}
86 command: check
87 args: --package ${{ matrix.package }} --features=${{ matrix.features }} --target=${{ matrix.target }}
88 86
89 fmt: 87 fmt:
90 runs-on: ubuntu-latest 88 runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index 784c6bac0..893a87368 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
1target 1target
2Cargo.lock 2Cargo.lock
3third_party 3third_party
4/Cargo.toml \ No newline at end of file
diff --git a/Cargo.example.toml b/Cargo.example.toml
new file mode 100644
index 000000000..c946a460d
--- /dev/null
+++ b/Cargo.example.toml
@@ -0,0 +1,75 @@
1# This file is a template for a Cargo workspace for developer convenience.
2#
3# Since Cargo resolves all features for all crates in the workspace together,
4# it is not possible to have a workspace with all the crates together, since they
5# enable incompatible features. For example, nrf crates enable embassy-macros/nrf
6# and stm32 crates enable embassy-macros/stm32. embassy-macros doesn't support having
7# both of these features on at the same time, because it makes no sense.
8#
9# Instead, we provide this template so you can enable only the crates you're going to
10# work on. This makes eg rust-analyzer check-on-save and autocomplete work, but only
11# in these crates, without any feature conflict.
12#
13# Copy this file to `Cargo.toml` and uncomment one group of crates below.
14#
15# `/Cargo.toml` is already in .gitignore, so you don't commit it accidentally.
16
17[workspace]
18members = [
19 "embassy",
20 "embassy-traits",
21 "embassy-macros",
22 "embassy-extras",
23
24 # Uncomment ONLY ONE of the groups below.
25
26 # nRF
27 #"embassy-nrf",
28 #"embassy-nrf-examples",
29
30 # stm32
31 #"embassy-stm32",
32 #"embassy-stm32f4",
33 #"embassy-stm32l0",
34 #"embassy-stm32f4-examples",
35
36 # rp2040
37 #"embassy-rp",
38 #"embassy-rp-examples",
39
40 # std
41 #"embassy-std",
42 #"embassy-std-examples",
43]
44
45[profile.dev]
46codegen-units = 1
47debug = 2
48debug-assertions = true
49incremental = false
50opt-level = 3
51overflow-checks = true
52
53[profile.release]
54codegen-units = 1
55debug = 2
56debug-assertions = false
57incremental = false
58lto = "fat"
59opt-level = 's'
60overflow-checks = false
61
62# do not optimize proc-macro crates = faster builds from scratch
63[profile.dev.build-override]
64codegen-units = 8
65debug = false
66debug-assertions = false
67opt-level = 0
68overflow-checks = false
69
70[profile.release.build-override]
71codegen-units = 8
72debug = false
73debug-assertions = false
74opt-level = 0
75overflow-checks = false
diff --git a/Cargo.toml b/Cargo.toml
deleted file mode 100644
index bc3fcdd37..000000000
--- a/Cargo.toml
+++ /dev/null
@@ -1,58 +0,0 @@
1
2[workspace]
3members = [
4 "embassy",
5 "embassy-traits",
6 "embassy-nrf",
7 "embassy-stm32",
8 "embassy-stm32f4",
9 "embassy-stm32l0",
10 "embassy-nrf-examples",
11 "embassy-stm32f4-examples",
12 "embassy-macros",
13 "embassy-extras",
14]
15
16# embassy-std enables std-only features. Since Cargo resolves all features
17# for all crates in the workspace together, including it would result in
18# incompatible features enabled in embassy.
19exclude = [
20 "embassy-std",
21 "embassy-std-examples",
22 "embassy-rp",
23 "embassy-rp-examples",
24]
25
26[profile.dev]
27codegen-units = 1
28debug = 2
29debug-assertions = true
30incremental = false
31opt-level = 3
32overflow-checks = true
33
34[profile.release]
35codegen-units = 1
36debug = 2
37debug-assertions = false
38incremental = false
39lto = "fat"
40opt-level = 's'
41overflow-checks = false
42
43# do not optimize proc-macro crates = faster builds from scratch
44[profile.dev.build-override]
45codegen-units = 8
46debug = false
47debug-assertions = false
48opt-level = 0
49overflow-checks = false
50
51[profile.release.build-override]
52codegen-units = 8
53debug = false
54debug-assertions = false
55opt-level = 0
56overflow-checks = false
57
58[patch.crates-io]