Skip to content

Commit 3fcddf2

Browse files
authored
Merge pull request #9886 from iNavFlight/MrD-Update-WSL-docs-to-include-Ninja
Update Building in Windows 10 or 11 with Linux Subsystem.md
2 parents 005194e + 41366b3 commit 3fcddf2

1 file changed

Lines changed: 38 additions & 6 deletions

File tree

docs/development/Building in Windows 10 or 11 with Linux Subsystem.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Building in Windows 10 with Linux subsystem [Recommended]
1+
# Building in Windows 10/11 with Linux subsystem (WSL) [Recommended]
22

3-
Linux subsystem for Windows 10 is probably the simplest way of building INAV under Windows 10.
3+
Linux subsystem for Windows (WSL) 10/11 is probably the simplest way of building INAV under Windows.
44

55
## Setting up the environment
66

@@ -9,7 +9,6 @@ run `windows features`
99
enable `windows subsytem for linux`
1010
reboot
1111

12-
1312
Install Ubuntu:
1413
1. Go to Microsoft store https://www.microsoft.com/en-gb/store/b/home
1514
1. Search and install most recent Ubuntu LTS version
@@ -56,12 +55,12 @@ You can fix this with by remounting the drive using the following commands
5655
1. `sudo umount /mnt/c`
5756
2. `sudo mount -t drvfs C: /mnt/c -o metadata`
5857

59-
## Building (example):
58+
## Building with Make (example):
6059

61-
For detailed build instrusctions see [Building in Linux](Building%20in%20Linux.md)
60+
For detailed build instructions see [Building in Linux](Building%20in%20Linux.md)
6261

6362
Launch Ubuntu:
64-
Click Windows Start button then scroll and lauch "Ubuntu"
63+
Click Windows Start button then scroll and launch "Ubuntu"
6564

6665
Building from Ubuntu command line
6766

@@ -80,6 +79,39 @@ cd build
8079
make MATEKF722
8180
```
8281

82+
## Building with Ninja (example):
83+
84+
[Ninja](https://ninja-build.org/) is a popular cross-platform tool. It is both lightweight and executes parallel builds by default. It is advantageous to use this over the old _make_ method. There are detailed instructions for building with Ninja in [Building in Linux](Building%20in%20Linux.md#building-with-ninja).
85+
86+
Launch Ubuntu:
87+
Click Windows Start button. Then scroll and launch **Ubuntu**.
88+
89+
> [!TIP]
90+
> Before using Ninja, you will need to install it. From the Ubuntu command prompt type `sudo apt-get install ninja-build -y` and press enter.
91+
92+
Building from the command line:
93+
94+
First, change to the INAV directory with
95+
```cd /mnt/c/inav```
96+
97+
Before building, you will need to prepare the build environment. You only need to do this once, unless you reinstall WSL or cmake.
98+
99+
```
100+
mkdir build
101+
cd build
102+
cmake -GNinja ..
103+
```
104+
105+
From then on, you can build your target by calling the following from inside the build directory.
106+
```
107+
ninja MATEKF722
108+
```
109+
110+
If you want to build multiple targets. You can use:
111+
```
112+
ninja MATEKF722 MATEKF405SE SPEEDYBEEF405
113+
```
114+
83115
## Updating the documents
84116
```
85117
cd /mnt/c/inav

0 commit comments

Comments
 (0)