From 39849cd561f238e1687eb0068b29c60b370b1764 Mon Sep 17 00:00:00 2001 From: Sebastian Oberschwendtner <sebastian.oberschwendtner@tum.de> Date: Fri, 1 Mar 2024 11:54:25 +0100 Subject: [PATCH] Adds windows build environment doc. --- .../screenshots/download-build-tools.png | 3 + docs/developer/build-environment/unix.md | 0 docs/developer/build-environment/windows.md | 75 +++++++++++++++++++ docs/developer/environment-cpp.md | 10 --- mkdocs.yml | 4 +- 5 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 docs/assets/images/screenshots/download-build-tools.png create mode 100644 docs/developer/build-environment/unix.md create mode 100644 docs/developer/build-environment/windows.md delete mode 100644 docs/developer/environment-cpp.md diff --git a/docs/assets/images/screenshots/download-build-tools.png b/docs/assets/images/screenshots/download-build-tools.png new file mode 100644 index 0000000..dc123ff --- /dev/null +++ b/docs/assets/images/screenshots/download-build-tools.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5d5e124c80f0df42d51c8168c8b082bcdddc6284cf50186096c6a3562e38c5f +size 47556 diff --git a/docs/developer/build-environment/unix.md b/docs/developer/build-environment/unix.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/developer/build-environment/windows.md b/docs/developer/build-environment/windows.md new file mode 100644 index 0000000..915f249 --- /dev/null +++ b/docs/developer/build-environment/windows.md @@ -0,0 +1,75 @@ +--- +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: + + +- 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 diff --git a/docs/developer/environment-cpp.md b/docs/developer/environment-cpp.md deleted file mode 100644 index 50653fd..0000000 --- a/docs/developer/environment-cpp.md +++ /dev/null @@ -1,10 +0,0 @@ - -## Build - -=== "Unix" - - When using Unix - -=== "Windows" - - When using windows \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 3a3da5e..9766863 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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' -- GitLab