Skip to content

Commit 1e5985a

Browse files
committed
Update build instructions
1 parent 6559f95 commit 1e5985a

File tree

3 files changed

+118
-34
lines changed

3 files changed

+118
-34
lines changed

doc/build/Linux.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Linux Build Instructions
22

3+
The following tools will be needed:
4+
5+
1. C/C++ compiler
6+
2. Git
7+
3. CMake
8+
9+
> [!NOTE]
10+
> The recommended C/C++ compiler is Clang. But the project also should
11+
> compile with GCC.
12+
13+
> [!NOTE]
14+
> The recommended linker is [mold](https://github.com/rui314/mold).
15+
> Mold is a Modern Linker which supports multithreading. It is incredibly fast.
16+
317
## Fedora
418

519
```bash

doc/build/README.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@
22

33
After cloning, you must follow some instructions to be able to compile your project with algine.
44

5-
## Dependencies
5+
> [!NOTE]
6+
> It is strongly recommended to use Clang on both Windows and Linux.
67
7-
Some dependencies are already included into codebase, but some of them you need to download using git submodules:
8+
## Dependencies
89

9-
`git submodule update --init --recursive`
10+
All needed dependencies will be automatically downloaded using FetchContent.
1011

1112
## Options
1213

13-
| Option | Description | Required |
14-
|-----------------------------|---------------------------------------|-----------|
15-
| ALGINE_SECURE_OPERATIONS | enables Algine SOP | No |
16-
| ALGINE_SOP_LEVEL | sets SOP level | No |
17-
| ALGINE_LUA_PATH | path to Lua interpreter executable | No |
18-
| ALGINE_SOLGEN_PATH | path to solgen executable | No |
19-
| ALGINE_SOLGEN_ARGS | additional solgen args | No |
20-
| ALGINE_SOLGEN_CLANG_ARGS | additional solgen clang args | No |
21-
| ALGINE_SOLGEN_INPUT_CORE | relative paths to core files | No |
22-
| ALGINE_SOLGEN_INPUT_STD | relative paths to std files | No |
23-
| ALGINE_SOLGEN_CORE_CLASSES | list of core classes | No |
24-
| ALGINE_SOLGEN_STD_CLASSES | list of std classes | No |
25-
| ALGINE_QT_PLATFORM | switches to Qt platform | No |
14+
| Option | Description | Required |
15+
|------------------------------|---------------------------------------|-----------|
16+
| `ALGINE_SECURE_OPERATIONS` | enables Algine SOP | No |
17+
| `ALGINE_SOP_LEVEL` | sets SOP level | No |
18+
| `ALGINE_LUA_PATH` | path to Lua interpreter executable | No |
19+
| `ALGINE_SOLGEN_PATH` | path to solgen executable | No |
20+
| `ALGINE_SOLGEN_ARGS` | additional solgen args | No |
21+
| `ALGINE_SOLGEN_CLANG_ARGS` | additional solgen clang args | No |
22+
| `ALGINE_SOLGEN_INPUT_CORE` | relative paths to core files | No |
23+
| `ALGINE_SOLGEN_INPUT_STD` | relative paths to std files | No |
24+
| `ALGINE_SOLGEN_CORE_CLASSES` | list of core classes | No |
25+
| `ALGINE_SOLGEN_STD_CLASSES` | list of std classes | No |
26+
| `ALGINE_QT_PLATFORM` | switches to Qt platform | No |
27+
| `ALGINE_DEPS_DIR_POSTFIX` | sets postfix for dependencies dir | No |
28+
29+
> [!NOTE]
30+
> For platform-specific flags see the corresponding files.
2631
2732
## Platform-specific steps
2833

doc/build/Windows.md

+83-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,101 @@
11
# Windows Build Instructions
22

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.
438

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
740

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:
949

1050
```bash
1151
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
1368
make extensions
1469
```
1570

1671
## Symbolic links
1772

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.
1975

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).
2277

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
2479

25-
### Steps to change the policies
80+
| Option | Description | Required | Default |
81+
|---------------|---------------|----------|---------------------------|
82+
| `MSYS64_PATH` | path to MSYS2 | No | `$Env:SystemDrive/msys64` |
2683

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-
![Create symbolic links](https://i.stack.imgur.com/o8J8x.png)
32-
3. Double-click on the item and add yourself (or the whole `Users` group) to the list.
84+
## Notes
3385

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
3590
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

Comments
 (0)