|
1 | 1 | # Windows Build Instructions
|
2 | 2 |
|
3 |
| -## GLEW: make OpenGL extensions |
| 3 | +The following tools will be needed: |
| 4 | + |
| 5 | +1. [MSVC](https://visualstudio.microsoft.com/downloads/) |
| 6 | +2. [LLVM](https://releases.llvm.org/download.html) |
| 7 | +3. [MSYS2](https://www.msys2.org/) |
| 8 | +4. [Git](https://git-scm.com/downloads) |
| 9 | +5. [CMake](https://cmake.org/download/) |
| 10 | + |
| 11 | +> [!NOTE] |
| 12 | +> It is highly recommended to install LLVM and MSYS2 to its default |
| 13 | +> install paths. It will simplify building since you don't need to provide |
| 14 | +> additional options. |
| 15 | +
|
| 16 | +> [!NOTE] |
| 17 | +> MSYS2 is optional, but recommended. If you have MSYS2 installed, Algine |
| 18 | +> will be able to perform dependency (GLEW) configuration step automatically. |
| 19 | +> However, any other Unix environment can be used (e.g. WSL). |
| 20 | +> Read more: https://github.com/nigels-com/glew#code-generation |
| 21 | +
|
| 22 | +> [!NOTE] |
| 23 | +> In some IDEs (e.g. CLion, Visual Studio with installed CMake Tools) |
| 24 | +> CMake is bundled by default. |
| 25 | +
|
| 26 | +## LLVM |
| 27 | + |
| 28 | +In order to compile the project, you must use Clang compiler: |
| 29 | + |
| 30 | +| Tool | Binary | |
| 31 | +|--------------|-------------| |
| 32 | +| C compiler | clang.exe | |
| 33 | +| C++ compiler | clang++.exe | |
| 34 | + |
| 35 | +By default, the aforementioned binaries are located in `$Env:ProgramW6432/LLVM`. |
| 36 | + |
| 37 | +Tested on Windows 11, clang version 16.0.0, target: x86_64-pc-windows-msvc. |
4 | 38 |
|
5 |
| -In order to [make GLEW](https://github.com/nigels-com/glew#code-generation) OpenGL extensions you need |
6 |
| -to [install MSYS2](https://www.msys2.org) even if you are using Visual Studio (MSVC). |
| 39 | +## MSYS2 packages |
7 | 40 |
|
8 |
| -After successful installation open msys2 console and execute: |
| 41 | +The following packages must be installed in order to use MSYS2 to complete |
| 42 | +GLEW configuration: |
| 43 | + |
| 44 | +1. `make` |
| 45 | +2. `git` |
| 46 | +3. `python` (python 3) |
| 47 | + |
| 48 | +They can be installed in the following way: |
9 | 49 |
|
10 | 50 | ```bash
|
11 | 51 | pacman -S make git python
|
12 |
| -cd algine_root_folder/deps/glew-src |
| 52 | +``` |
| 53 | + |
| 54 | +## GLEW: make OpenGL extensions |
| 55 | + |
| 56 | +> [!NOTE] |
| 57 | +> If you have MSYS2 installed in `$Env:SystemDrive/msys64` with all needed packages, |
| 58 | +> you can skip this step. GLEW will be configured automatically. Note, that the |
| 59 | +> process can take some time. |
| 60 | +
|
| 61 | +> [!NOTE] |
| 62 | +> In order to [make GLEW](https://github.com/nigels-com/glew#code-generation) |
| 63 | +> OpenGL extensions, you need to have a Unix or Mac environment. For example, |
| 64 | +> it can be MSYS2, WSL, Linux distro etc. |
| 65 | +
|
| 66 | +```bash |
| 67 | +cd $algine_root_folder/deps-win/glew-src |
13 | 68 | make extensions
|
14 | 69 | ```
|
15 | 70 |
|
16 | 71 | ## Symbolic links
|
17 | 72 |
|
18 |
| -After building will be executed command `mklink`, which must be executed via administrator. |
| 73 | +Symlinks support is required in order to use Algine. Luckily, it can be enabled |
| 74 | +by enabling Developer mode in the settings. |
19 | 75 |
|
20 |
| -> Creation of symbolic links requires the `SeCreateSymbolicLinkPrivilege` (“Create symbolic links”), |
21 |
| -> which is granted only to administrators by default (but you can change that using security policy). |
| 76 | +For Windows 11: Settings -> Privacy & security -> For developers -> Developer Mode (on). |
22 | 77 |
|
23 |
| -This command is necessary so as not to increase the size of output directories and not to make unnecessary copying of libraries. |
| 78 | +## Options |
24 | 79 |
|
25 |
| -### Steps to change the policies |
| 80 | +| Option | Description | Required | Default | |
| 81 | +|---------------|---------------|----------|---------------------------| |
| 82 | +| `MSYS64_PATH` | path to MSYS2 | No | `$Env:SystemDrive/msys64` | |
26 | 83 |
|
27 |
| -1. Right click on `Start` → `Run` and launch `secpol.msc`. |
28 |
| -2. Open `Security Settings → Local Policies → User Rights Assignment` |
29 |
| - and select `Create symbolic links` (that represents `SeCreateSymbolicLinkPrivilege`). |
30 |
| - <br> |
31 |
| -  |
32 |
| -3. Double-click on the item and add yourself (or the whole `Users` group) to the list. |
| 84 | +## Notes |
33 | 85 |
|
34 |
| -The changes will apply when you log out and log in again. |
| 86 | +> [!NOTE] |
| 87 | +> If you are a CLion user, it is recommended to enable terminal emulation in the output |
| 88 | +> console to correctly display colors. |
| 89 | +> See https://www.jetbrains.com/help/clion/terminal-in-the-output-console.html#enable |
35 | 90 |
|
36 |
| -[<small>Source</small>](https://superuser.com/questions/124679/how-do-i-create-a-link-in-windows-7-home-premium-as-a-regular-user) |
| 91 | +> [!NOTE] |
| 92 | +> Warnings like |
| 93 | +> ``` |
| 94 | +> lld-link: warning: undefined symbol: void __cdecl algine_lua::registerLuaUsertype<class algine::ShapeBuilder>(class sol::basic_table_core<0, class sol::basic_reference<0>> &, void *) |
| 95 | +> >> referenced by D:\Development\Projects\cpp\algine\include\common\algine\core\lua\Lua.h:112 |
| 96 | +> ``` |
| 97 | +> mean that the specified classes are not listed in your `SolgenLists.lua`. |
| 98 | +> Bindings for the classes mentioned in the warnings are not the minimum required. |
| 99 | +> However, if you explicitly or implicitly try to use them from the Lua code, |
| 100 | +> the engine will crash. This means that these warnings can be safely ignored until |
| 101 | +> you use the bindings of the aforementioned classes. |
0 commit comments