|
| 1 | +# Set-up build environment on Windows |
| 2 | +Before you can compile and run the demo you need to install the following tools and libraries: |
| 3 | + |
| 4 | +- Any C/C++ compiler (MSVC is recommended, but GCC works as well) |
| 5 | +- CMake |
| 6 | +- Ninja (**Optional**, but recommended as generating for MSBuild is very slow!) |
| 7 | +- Any code editor (This guide will use VSCode, as it is free and easy to configure with CMake) |
| 8 | + |
| 9 | +!!! note |
| 10 | + |
| 11 | + Although any recent enough C/C++ compiler can be used. |
| 12 | + |
| 13 | + **This guide will only use the MSVC compiler!** |
| 14 | + |
| 15 | + This choice was made as this compiler is also used for all other CLFML projects. |
| 16 | + |
| 17 | + |
| 18 | +## Installing MSVC16 (2019 edition) & CMake |
| 19 | +The MSVC compiler (and CMake) can be installed by either installing VS BuildTools or Visual Studio 2019. |
| 20 | + |
| 21 | +**This guide will use the VS BuildTools method, as we don't need the Visual Studio IDE**. |
| 22 | + |
| 23 | +There are multiple ways you can download and install VS BuildTools 2019; |
| 24 | + |
| 25 | +- Manually downloading and installing using this [link](https://aka.ms/vs/16/release/vs_buildtools.exe) |
| 26 | +- Using chocolatey: |
| 27 | + ```choco install visualstudio2019buildtools``` |
| 28 | +- Using winget: |
| 29 | +```winget install --id=Microsoft.VisualStudio.2019.BuildTools -e``` |
| 30 | + |
| 31 | +### Manually installing VS Build Tools 2019 |
| 32 | +1. [Download and run this installer](https://aka.ms/vs/16/release/vs_buildtools.exe). |
| 33 | +2. Select these options: |
| 34 | + |
| 35 | +3. After installation, reboot your machine! |
| 36 | + |
| 37 | + |
| 38 | +## Installing Ninja |
| 39 | +1. [Download the latest Ninja release for Windows!](https://github.com/ninja-build/ninja/releases) |
| 40 | +2. Unzip this ninja-win.zip to `C:\ninja-win` |
| 41 | +3. Open the environment variables editor using the Windows Startup Menu ([Try this guide if you can't find it](https://www.imatest.com/docs/editing-system-environment-variables/#Windows)) |
| 42 | +4. Add the `C:\ninja-win` path to the PATH variable; |
| 43 | +5. Open a commandline window and check if Ninja is correctly installed by running the `ninja` command! |
| 44 | + |
| 45 | + |
| 46 | +## Installing VSCode (with plugins) |
| 47 | +VSCode is an easy to use code-editor with CMake support (using the CMake Tools plugin). |
| 48 | + |
| 49 | +To set-up VSCode the follow these steps: |
| 50 | + |
| 51 | +1. [Download and install VSCode using the installer](https://code.visualstudio.com/download) |
| 52 | +2. Follow the initial set-up wizard in vscode (if freshly installed) |
| 53 | +3. Download and install this plugin pack: |
| 54 | + - C/C++ Extension Pack (Microsoft) |
| 55 | + |
| 56 | +## Compiling and running the example |
| 57 | +The library contains an example demonstrating the usage and functionality of this library. |
| 58 | + |
| 59 | +To compile and run this example: |
| 60 | + |
| 61 | +1. Clone this repo: |
| 62 | +``` |
| 63 | +git clone https://github.com/CLFML/lowwi.git |
| 64 | +``` |
| 65 | + |
| 66 | +2. Open the cloned repo folder in vscode; `File->Open Folder` |
| 67 | + |
| 68 | +3. Select Ninja as build generator by pressing **CRTL+SHIFT+P**->**"CMake: Open CMake Tools Extension Settings"**->**"@ext:ms-vscode.cmake-tools generator"** |
| 69 | + Now type Ninja (with capital N into the generator field!). |
| 70 | +  |
| 71 | + |
| 72 | +4. Select the `MSVC amd64 kit`by pressing CTRL+SHIFT+p and selecting `CMake: Select a kit`. |
| 73 | + |
| 74 | +5. CMake will now configure; By default it will configure as Debug build, this has a significant performance hit. |
| 75 | + To change to release with debug info (which has optimizations turned on, but is still debuggable). Press CTRL+SHIFT+p again and enter `CMake: Select Variant`-> `RelWithDebInfo` |
| 76 | +  |
| 77 | + |
| 78 | +6. Let CMake Finish configuring your build configuration. **Then click on the Play button on the blue bar on the bottom of screen**, CMake might ask which target to launch, select the `Lowwi_demo_mic` target. |
| 79 | +  |
| 80 | + |
| 81 | +7. After build is finished, it will launch the demo which uses your microphone to detect the **"Hey Mycroft"** wakeword. |
0 commit comments