Skip to content

Commit 4870c18

Browse files
authored
Merge branch 'main' into remove-compiler-flags
2 parents 5b6789c + 242e569 commit 4870c18

File tree

3 files changed

+33
-47
lines changed

3 files changed

+33
-47
lines changed

docs/reference/target-declaration.mdx

+9-19
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A target specification may have optional parameters, the names and values of whi
2525

2626
- [**auth**](#auth): A boolean specifying to apply authorization between RTI and federates when federated execution.
2727
- [**build**](#build): A command to execute after code generation instead of the default compile command.
28-
- [**build-type**](#build-type): One of Release (the default), Debug, RelWithDebInfo and MinSizeRel.
28+
- [**build-type**](#build-type): One of Debug (the default), Release, RelWithDebInfo and MinSizeRel.
2929
- [**cargo-dependencies**](#cargo-dependencies): (Rust only) list of dependencies to include in the generated Cargo.toml file.
3030
- [**cargo-features**](#cargo-features): (Rust only) List of string names of features to include.
3131
- [**cmake-include**](#cmake): List of paths to cmake files to guide compilation.
@@ -54,7 +54,7 @@ c={
5454
`target C {
5555
auth: <true or false>
5656
build: <string>,
57-
build-type: <Release, Debug, RelWithDebInfo, or MinSizeRel>,
57+
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
5858
cmake-include: <string or list of strings>,
5959
compiler: <string>,
6060
docker: <true or false>,
@@ -70,9 +70,9 @@ c={
7070
}
7171
cpp={
7272
`target Cpp {
73-
build-type: <Release, Debug, RelWithDebInfo, or MinSizeRel>,
74-
compiler: <string>,
73+
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
7574
cmake-include: <string or list of strings>,
75+
compiler: <string>,
7676
external-runtime-path: <string>,
7777
export-dependency-graph <true or false>,
7878
fast: <true or false>,
@@ -217,25 +217,15 @@ This target does not currently support the `build` target option.
217217
<ShowIf ts py>
218218
This target does not currently support the `build-type` target option.
219219
</ShowIf>
220-
<ShowIf rs>
221-
This parameter works with `cargo` to specify how to compile the code. The following options are supported:
222-
223-
- `Release`: Optimization is turned on and debug information is missing.
224-
- `Debug`: Debug information is included in the executable.
225-
- `RelWithDebInfo`: Optimization with debug information.
226-
- `MinSizeRel`: Optimize for smallest size.
227-
228-
This defaults to `Release`.
229-
</ShowIf>
230-
<ShowIf c cpp>
231-
This parameter works with `cmake` to specify how to compile the code. The following options are supported:
220+
<ShowIf rs c cpp>
221+
This parameter specifies how to compile the code. The following options are supported:
232222

233-
- `Release`: Optimization is turned on and debug information is missing.
234-
- `Debug`: Debug information is included in the executable.
223+
- `Debug`: Optimization is disabled and debug information is included in the executable.
224+
- `Release`: Optimization is enabled and debug information is missing.
235225
- `RelWithDebInfo`: Optimization with debug information.
236226
- `MinSizeRel`: Optimize for smallest size.
237227

238-
This defaults to `Release`.
228+
This defaults to `Debug`.
239229
</ShowIf>
240230
</ShowIfs>
241231

versioned_docs/version-0.6.0/embedded/zephyr.mdx

+15-9
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,37 @@ are going to create next.
3636
git clone https://github.com/lf-lang/lf-west-template lf-zephyr-workspace && cd lf-zephyr-workspace
3737
```
3838

39-
2. Setup and activate a virtual environment
39+
2. Setup the virtual environment
4040
```
4141
python3 -m venv .venv
42+
```
43+
44+
3. Activate the virtual environment and source Zephyr's environment
45+
```
4246
source .venv/bin/activate
47+
source deps/zephyr/zephyr-env.sh
4348
```
4449

45-
3. Install `west`
50+
4. Install `west`
4651
```
4752
pip3 install west
4853
```
4954

5055
Now `west` is installed within a virtual environment. **This environment has to
51-
be activated every time you want to use west with LF**
56+
be activated every time you want to use west with LF; use `source env.sh` as a
57+
shorthand to activate both.**
5258

53-
4. Get the Zephyr source code
59+
5. Get the Zephyr source code
5460
```
5561
west update
5662
```
5763

58-
5. Export CMake packages for Zephyr
64+
6. Export CMake packages for Zephyr
5965
```
6066
west zephyr-export
6167
```
6268

63-
6. Install Python dependencies
69+
7. Install Python dependencies
6470
```
6571
pip install -r deps/zephyr/scripts/requirements.txt
6672
```
@@ -181,7 +187,8 @@ In this guide we have shown how LF Zephyr apps can be developed in a
181187
approach. When you give `lfc` a LF program with the `platform` target property
182188
set to `Zephyr`, it will generate a Zephyr project that can be built with
183189
`west`. For this to work, the environment variable `ZEPHYR_BASE` must be set to
184-
point to the Zephyr RTOS sources. To demonstrate this, create a simple example
190+
point to the Zephyr RTOS sources. This is done by sourcing `zephyr-env.sh` at
191+
the root of the Zephyr repository. To demonstrate this, create a simple example
185192
program:
186193
```
187194
cat >> LfcCentricZephyr.lf << 'END'
@@ -200,8 +207,7 @@ If `west` is installed in a virtual environment, activate it, and set up the
200207
environment. Assuming that the template is located at `/home/lf-zephyr-workspace`
201208

202209
```
203-
source /home/lf-zephyr-workspace/.venv/bin/activate
204-
export ZEPHYR_BASE=/home/lf-zephyr-workspace/deps/zephyr
210+
source /home/lf-zephyr-workspace/env.sh
205211
lfc LfcCentricZephyr.lf
206212
```
207213

versioned_docs/version-0.6.0/reference/target-declaration.mdx

+9-19
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A target specification may have optional parameters, the names and values of whi
2525

2626
- [**auth**](#auth): A boolean specifying to apply authorization between RTI and federates when federated execution.
2727
- [**build**](#build): A command to execute after code generation instead of the default compile command.
28-
- [**build-type**](#build-type): One of Release (the default), Debug, RelWithDebInfo and MinSizeRel.
28+
- [**build-type**](#build-type): One of Debug (the default), Release, RelWithDebInfo and MinSizeRel.
2929
- [**cargo-dependencies**](#cargo-dependencies): (Rust only) list of dependencies to include in the generated Cargo.toml file.
3030
- [**cargo-features**](#cargo-features): (Rust only) List of string names of features to include.
3131
- [**cmake-include**](#cmake): List of paths to cmake files to guide compilation.
@@ -55,7 +55,7 @@ c={
5555
`target C {
5656
auth: <true or false>
5757
build: <string>,
58-
build-type: <Release, Debug, RelWithDebInfo, or MinSizeRel>,
58+
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
5959
cmake-include: <string or list of strings>,
6060
compiler: <string>,
6161
compiler-flags: <string or list of strings>,
@@ -72,9 +72,9 @@ c={
7272
}
7373
cpp={
7474
`target Cpp {
75-
build-type: <Release, Debug, RelWithDebInfo, or MinSizeRel>,
76-
compiler: <string>,
75+
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
7776
cmake-include: <string or list of strings>,
77+
compiler: <string>,
7878
external-runtime-path: <string>,
7979
export-dependency-graph <true or false>,
8080
fast: <true or false>,
@@ -220,25 +220,15 @@ This target does not currently support the `build` target option.
220220
<ShowIf ts py>
221221
This target does not currently support the `build-type` target option.
222222
</ShowIf>
223-
<ShowIf rs>
224-
This parameter works with `cargo` to specify how to compile the code. The following options are supported:
225-
226-
- `Release`: Optimization is turned on and debug information is missing.
227-
- `Debug`: Debug information is included in the executable.
228-
- `RelWithDebInfo`: Optimization with debug information.
229-
- `MinSizeRel`: Optimize for smallest size.
230-
231-
This defaults to `Release`.
232-
</ShowIf>
233-
<ShowIf c cpp>
234-
This parameter works with `cmake` to specify how to compile the code. The following options are supported:
223+
<ShowIf rs c cpp>
224+
This parameter specifies how to compile the code. The following options are supported:
235225

236-
- `Release`: Optimization is turned on and debug information is missing.
237-
- `Debug`: Debug information is included in the executable.
226+
- `Debug`: Optimization is disabled and debug information is included in the executable.
227+
- `Release`: Optimization is enabled and debug information is missing.
238228
- `RelWithDebInfo`: Optimization with debug information.
239229
- `MinSizeRel`: Optimize for smallest size.
240230

241-
This defaults to `Release`.
231+
This defaults to `Debug`.
242232
</ShowIf>
243233
</ShowIfs>
244234

0 commit comments

Comments
 (0)