-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathHOWTO-Build (msys2).txt
More file actions
129 lines (101 loc) · 3.09 KB
/
HOWTO-Build (msys2).txt
File metadata and controls
129 lines (101 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
HOW TO COMPILE REALRTCW WITH MSYS2 + VS CODE (NO CYGWIN)
============================================
PREREQUISITES
- Windows 10 or newer
- MSYS2 installed (e.g. C:\msys64)
- Visual Studio Code installed
============================================
STEP 1: INSTALL + UPDATE MSYS2
1. Download and install from https://www.msys2.org/
2. Open "MSYS2 MSYS" from Start Menu
3. Run:
pacman -Syu
(close shell if it tells you to)
4. Reopen and run:
pacman -Su
============================================
STEP 2: INSTALL TOOLCHAIN and additional libraries
1. Open "MSYS2 MinGW 64-bit" shell (IMPORTANT).
2. Run:
pacman -S --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-gdb mingw-w64-x86_64-make
This installs:
- gcc
- g++
- gdb
- mingw32-make (used instead of make)
3. After that run installation of additional ffmpeg libraries:
pacman -U https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-ffmpeg-8.0.1-3-any.pkg.tar.zst
pacman -U https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-ffmpeg-python-0.2.0-8-any.pkg.tar.zst
This install the specified version of ffmpeg libraries.
or run:
pacman -S mingw-w64-x86_64-ffmpeg
This install the lastest version of ffmpeg libraries.
============================================
STEP 3: PREPARE YOUR PROJECT
Put RealRTCW project into something like:
C:\Dev\RealRTCW
(Don't put it inside MSYS2 folder.)
============================================
STEP 4: OPEN VS CODE
Option 1 (Recommended):
Open MSYS2 MinGW64 shell and run:
cd /c/Dev/RealRTCW
code .
Option 2:
Add this to ~/.bashrc:
export PATH=$PATH:'/c/Users/<YourName>/AppData/Local/Programs/Microsoft VS Code/bin'
Then run:
source ~/.bashrc
============================================
STEP 5: CREATE .vscode/tasks.json
Inside RealRTCW project folder, create .vscode directory.
Create tasks.json with this content:
{
"version": "2.0.0",
"tasks": [
{
"label": "build-steam",
"type": "shell",
"command": "ARCH=x86_64 STEAM=1 mingw32-make",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"],
"options": {
"shell": {
"executable": "C:/msys64/usr/bin/bash.exe",
"args": ["-c"]
}
}
},
{
"label": "build-nonsteam",
"type": "shell",
"command": "ARCH=x86_64 mingw32-make",
"group": "build",
"problemMatcher": ["$gcc"],
"options": {
"shell": {
"executable": "C:/msys64/usr/bin/bash.exe",
"args": ["-c"]
}
}
}
]
}
============================================
COMMON ISSUES
- make not found:
Use mingw32-make, not make
- still using /usr/bin/make:
Add alias: alias make='mingw32-make' in ~/.bashrc
- code command not found:
Add VS Code path to PATH in ~/.bashrc:
export PATH=$PATH:'/c/Users/<YourName>/AppData/Local/Programs/Microsoft VS Code/bin'
- build folder name:
Folder may be called release-mingw32-x86_64 (normal)
============================================
DONE!
- Ctrl+Shift+B to build
- Or Ctrl+Shift+P > Tasks: Run Task > choose version