-
Notifications
You must be signed in to change notification settings - Fork 2
/
RAVBA.txt
79 lines (60 loc) · 3.83 KB
/
RAVBA.txt
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
==== Setup repository ====
$ git clone https://github.com/RetroAchievements/RAVBA.git
$ cd RAVBA
$ git submodule init
$ git submodule update --recursive
==== Create debug vcxproj ====
From a VS2019 x64 native tools command prompt
$ mkdir vsbuild
$ cd vsbuild
$ cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static -DSDL2_STATIC=ON -DSFML_STATIC_LIBRARIES=ON -DENABLE_RETROACHIEVEMENTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_VERSION=8.1 -T v142
$ cmake --build .
This prepares a VS solution (VBA-M.sln) in the vsbuild directory that can be opened in Visual Studio.
Note that because this solution was generated by cmake, the only valid build configuration is Debug.
You can also build it from the VS2019 x64 command prompt as follows:
$ msbuild /m visualboyadvance-m.vcxproj -p:Configuration=Debug
==== Create release ====
Unfortunately, the vcpkg build creates a bunch of dependencies on libraries on whatever machine the build was performed on. In particular, when building on Windows 10, the resulting binary can only be run on Windows 10.
To work around this, we cross compile from linux. Using an Ubuntu VM, checkout the code, then run the following commands:
~/source/RAVBA$ export BUILD_ENV=mingw-w32
~/source/RAVBA$ ./installdeps --no-ffmpeg win32
~/source/RAVBA$ mkdir build && cd build
~/source/RAVBA/build$ /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON -DENABLE_RETROACHIEVEMENTS=ON -DCMAKE_SYSTEM_VERSION=7.0 -DENABLE_LTO=OFF -DENABLE_NLS=OFF -DENABLE_FFMPEG=OFF -DENABLE_ONLINEUPDATES=OFF
If you get an error about libssl.so.1.1 not being found:
$ mkdir $HOME/opt && cd $HOME/opt
$ wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
$ tar -zxvf openssl-1.1.1o.tar.gz
$ cd openssl-1.1.1o
$ ./config && make && make test
$ mkdir $HOME/opt/lib
$ mv $HOME/opt/openssl-1.1.1o/libcrypto.so.1.1 $HOME/opt/lib/
$ mv $HOME/opt/openssl-1.1.1o/libssl.so.1.1 $HOME/opt/lib/
$ export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH
~/source/RAVBA$ make -j2
NOTE: the linux build process will not generate the src/wx/RA_BuildVer.h file, so copy it from the Windows machine and manually update it to the correct version.
#define RAVBA_VERSION "1.1.0.0"
#define RAVBA_VERSION_SHORT "1.1.0"
#define RAVBA_VERSION_MAJOR 1
#define RAVBA_VERSION_MINOR 1
#define RAVBA_VERSION_PATCH 0
#define RAVBA_VERSION_REVISION 0
#define RAVBA_VERSION_PRODUCT "1.1.0"
The one benefit of doing this is we end up with a single binary, whereas there's 7 or 8 additional DLLs generated in the Windows project.
For x64 build:
~/source/RAVBA$ export BUILD_ENV=mingw-w64
~/source/RAVBA$ ./installdeps --no-ffmpeg win64
~/source/RAVBA$ mkdir build64 && cd build64
~/source/RAVBA/build64$ /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON -DENABLE_RETROACHIEVEMENTS=ON -DCMAKE_SYSTEM_VERSION=7.0 -DENABLE_LTO=OFF -DENABLE_NLS=OFF -DENABLE_FFMPEG=OFF -DENABLE_ONLINEUPDATES=OFF
~/source/RAVBA/build64$ make -j2
==== MXE ====
If you get an error about optional not being defined, it's because the default prebuilt MXE doesn't support c++17.
(See https://github.com/mxe/mxe/issues/2626). To work around that, you have to build mxe yourself.
~/source$ git clone https://github.com/mxe/mxe.git
~/source$ sudo apt-get install lzip python-is-python3
~/source$ cd mxe
~/source/mxe$ make MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' gcc zlib ffmpeg gettext sdl2 sfml openal wxwidgets
- this takes around an hour!
~/source/mxe$ cd ~/RAVBA/build64
~/source/RAVBA/build64$ export PATH=~/source/mxe/usr/bin:$PATH
~/source/RAVBA/build64$ x86_64-w64-mingw32.static-cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON -DENABLE_RETROACHIEVEMENTS=ON -DCMAKE_SYSTEM_VERSION=7.0 -DENABLE_LTO=OFF -DENABLE_NLS=OFF -DENABLE_FFMPEG=OFF -DENABLE_ONLINEUPDATES=OFF
~/source/RAVBA/build64$ make -j2