Skip to content
Snippets Groups Projects
Commit 39849cd5 authored by Sebastian Oberschwendtner's avatar Sebastian Oberschwendtner
Browse files

Adds windows build environment doc.

parent 1b45bd04
No related branches found
No related tags found
2 merge requests!76Draft: Updated Python code example,!73Initial open source version
docs/assets/images/screenshots/download-build-tools.png

130 B

---
title: Setup Windows Environment
summary: How to create the C++ build environment on Windows
authors:
- Sebastian Oberschwendtner
date: 2024-03-01
---
## Introduction
We recommend to use the Windows compiler for the best experience and to create programs which are easily distributable to other Windows machines.
The tools used are:
- Compiler: `Clang` or `MSVC`
- Generator tool: `CMake`
- Package manager: `vcpkg`
>You can use _Visual Studio_ as your IDE which will integrate everything, but since we are not prescribing any IDE, this will only show you how to setup the build tools. :point_up:
---
## Install Build Tools
- Download the build tools from Microsoft: [Download Build Tools :octicons-link-external-16:](https://visualstudio.microsoft.com/downloads/?q=build+tools#build-tools-for-visual-studio-2022)
The page should like something like this:
![Download Build Tools](../../assets/images/screenshots/download-build-tools.png)
- Execute the installer and install at least these components:
- *Desktop development with C++*
- *C++ CMake tools for Windows*
- *C++ Clang Compiler for Windows*
- *C++ Clang tools for Windows*
!!! attention
The latest Version of Visual Studio can change throughout time. Just download the latest one and keep a note which version that is.
---
## Install CMake
- Download and Install the lates Release of **CMake**: [Download CMake :octicons-link-external-16:](https://cmake.org/download/)
!!! note
Install at least **Version 3.25**!
- Enable the option to make **CMake** available in *PATH*.
---
## Install vcpkg
*vcpkg* is the open-source package manager maintained by Microsoft we use to install and manage our dependencies.
- Follow the instructions [here :octicons-link-external-16:](https://vcpkg.io/en/getting-started)
!!! warning
Make sure to use the install path `C:\dev\vcpkg` as mentioned in the *get started* guide!
⇒ The getting started guide also explains how to install packages and use them with **Cmake**.
Make sure your IDE is configured to pass the additional parameters needed to include *vcpkg* to **CMake**, which is:
```sh
-DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake
```
---
## Building via terminal
- First make sure all required dependencies are installed using **vcpgk**!
- Configure the project you want to build with **CMake**:
```sh
cmake -B build -S . -G "Visual Studio 17 2022" -A x64 -T ClangCL,host=x64 -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake
```
!!! tip
The version of *Visual Studio* depends on which version of the build tools you have installed! :point_up:
- Build in *Debug* mode:
```sh
cmake --build build --config=Debug
```
\ No newline at end of file
## Build
=== "Unix"
When using Unix
=== "Windows"
When using windows
\ No newline at end of file
......@@ -94,7 +94,9 @@ nav:
- 'How to Contribute': 'developer/contribute.md'
- 'Build Environment':
- 'IDE Setup': 'developer/ide-setup.md'
- 'C++ Environment': 'developer/environment-cpp.md'
- 'C++ Environment':
- 'Windows': 'developer/build-environment/windows.md'
- 'Unix': 'developer/build-environment/unix.md'
- 'Python Environment': 'developer/environment-python.md'
- 'Build Instructions':
- 'Prerequisites': 'developer/prerequisites.md'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment