From aec9a05fbdfcbf553b4199f807b82fbeb93724ae Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Sat, 9 Oct 2021 01:09:34 +0200
Subject: [PATCH] [#19] Added how to build details

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 README.md            |  5 +++++
 doc/BUILD_LINUX.md   | 51 ++++++++++++++++++++++++++++++++++++++++++++
 doc/BUILD_MACOS.md   | 19 +++++++++++++++++
 doc/BUILD_WINDOWS.md | 35 ++++++++++++++++++++++++++++++
 4 files changed, 110 insertions(+)
 create mode 100644 doc/BUILD_LINUX.md
 create mode 100644 doc/BUILD_MACOS.md
 create mode 100644 doc/BUILD_WINDOWS.md

diff --git a/README.md b/README.md
index 8510d576..62efc4df 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,11 @@ More information about Git LFS [here](https://git-lfs.github.com/).
 Git submodules are used for libraries. 
 To download the submodules either clone using `git clone --recurse-submodules` or after `git clone` use `git submodule init` and `git submodule update`.
 
+Detailed build process:
+ - [How to build on Windows](doc/BUILD_WINDOWS.md)
+ - [How to build on macOS](doc/BUILD_MACOS.md)
+ - [How to build on Linux](doc/BUILD_LINUX.md)
+
 ### Dependencies (required):
 
 Most dependencies will be used via submodules but for example Vulkan needs to be installed correctly depending on your platform. So please setup your environment properly.
diff --git a/doc/BUILD_LINUX.md b/doc/BUILD_LINUX.md
new file mode 100644
index 00000000..61087182
--- /dev/null
+++ b/doc/BUILD_LINUX.md
@@ -0,0 +1,51 @@
+# How to build on Linux
+
+## How to build with GCC on Archlinux by the way
+
+1. Install required and useful tools to develop:
+```
+sudo pacman -S cmake gcc vulkan-icd-loader vulkan-headers vulkan-validation-layers vulkan-tools
+```
+2. Install the matching Vulkan drivers for your system:
+```
+# For discrete Nvidia GPUs:
+sudo pacman -S nvidia
+
+# For integrated or discrete Radeon GPUs:
+sudo pacman -S vulkan-radeon
+
+# For integrated or discrete Intel GPUs:
+sudo pacman -S vulkan-intel
+```
+3. Clone the repository and run the following commands:
+```
+mkdir debug
+cd debug
+cmake -DCMAKE_C_COMPILER="/usr/bin/gcc" -DCMAKE_CXX_COMPILER="/usr/bin/g++" -DCMAKE_BUILD_TYPE=Debug ..
+cmake --build .
+```
+
+## How to build with Clang on Archlinux by the way
+
+1. Install required and useful tools to develop:
+```
+sudo pacman -S cmake clang vulkan-icd-loader vulkan-headers vulkan-validation-layers vulkan-tools
+```
+2. Install the matching Vulkan drivers for your system:
+```
+# For discrete Nvidia GPUs:
+sudo pacman -S nvidia
+
+# For integrated or discrete Radeon GPUs:
+sudo pacman -S vulkan-radeon
+
+# For integrated or discrete Intel GPUs:
+sudo pacman -S vulkan-intel
+```
+3. Clone the repository and run the following commands:
+```
+mkdir debug
+cd debug
+cmake -DCMAKE_C_COMPILER="/usr/bin/clang" -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_BUILD_TYPE=Debug ..
+cmake --build .
+```
diff --git a/doc/BUILD_MACOS.md b/doc/BUILD_MACOS.md
new file mode 100644
index 00000000..c0b20bd1
--- /dev/null
+++ b/doc/BUILD_MACOS.md
@@ -0,0 +1,19 @@
+# How to build on macOS
+
+## How to build with Clang on macOS
+
+1. Install Homebrew
+2. Install required tools to compile:
+```
+brew install cmake llvm libomp
+```
+3. Download and install latest [vulkansdk-macos-*.dmg](https://vulkan.lunarg.com/doc/sdk/1.2.189.0/mac/getting_started.html) to ~/VulkanSDK
+4. Clone the repository and run the following commands:
+```
+mkdir debug
+cd debug
+export LDFLAGS="-L/usr/local/opt/llvm/lib"
+export CPPFLAGS="-I/usr/local/opt/llvm/include"
+cmake -DCMAKE_C_COMPILER="/usr/local/opt/llvm/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" -DCMAKE_BUILD_TYPE=Debug ..
+cmake --build .
+```
\ No newline at end of file
diff --git a/doc/BUILD_WINDOWS.md b/doc/BUILD_WINDOWS.md
new file mode 100644
index 00000000..4cb2a55c
--- /dev/null
+++ b/doc/BUILD_WINDOWS.md
@@ -0,0 +1,35 @@
+# How to build on Windows
+
+## How to build with MSVC on Windows
+
+1. Something, something, open VisualStudio
+2. Something, something, update VisualStudio
+3. Install VulkanSDK and restart
+4. Check for updates
+5. Create a project solution and fix the mess
+
+## How to build with GCC on Windows
+
+1. Install MSYS2
+2. Run "MSYS2 MSYS" from Start menu
+3. Enter the following commands into MSYS2 console:
+```
+pacman -Syu
+pacman -Su
+pacman -S --needed base-devel mingw-w64-x86_64-toolchain
+pacman -S cmake
+```
+4. Add to Path:
+```
+C:\msys64\usr\bin
+C:\msys64\usr\local\bin
+C:\msys64\mingw64\bin
+C:\msys64\mingw32\bin
+```
+5. Clone the repository and run the following commands:
+```
+mkdir debug
+cd debug
+cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe .. -G "Unix Makefiles"
+cmake --build .
+```
\ No newline at end of file
-- 
GitLab