1
0
Fork 0
mirror of https://github.com/Detanup01/gbe_fork.git synced 2025-04-21 21:52:06 +02:00

add all msys2 steps in a spoiler + note about the current state

This commit is contained in:
otavepto 2024-06-12 21:47:30 +03:00
parent 5383987f66
commit 24a57319e5

View file

@ -62,7 +62,7 @@ You can also find instructions here in [README.release.md](./post_build/README.r
It is adviseable to always checkout submodules every now and then, to make sure they're up to date
```shell
git submodule update --recursive --remote
git submodule update --init --recursive --remote
```
### For Windows:
@ -71,7 +71,10 @@ You can also find instructions here in [README.release.md](./post_build/README.r
* Select the Workload `Desktop development with C++`
* In the `Individual componenets` scroll to the buttom and select the **latest** version of `Windows XX SDK (XX.X...)`
For example `Windows 11 SDK (10.0.22621.0)`
* Using `MSYS2` (very limited support): https://www.msys2.org/
* Using `MSYS2` **this is currently experimental and will not work due to ABI differences**: https://www.msys2.org/
<details>
<summary>steps</summary>
* To build 64-bit binaries use either the [environment](https://www.msys2.org/docs/environments/) `UCRT64` or `MINGW64` then install the GCC toolchain
`UCRT64`
```shell
@ -85,6 +88,8 @@ You can also find instructions here in [README.release.md](./post_build/README.r
```shell
pacman -S mingw-w64-i686-gcc
```
</details>
* Python 3.10 or above: https://www.python.org/downloads/windows/
After installation, make sure it works
```batch
@ -131,11 +136,14 @@ The only times you'll need to rebuild them is either when their separete build f
#### On Windows:
Open CMD in the repo folder, then run the following
* To build using `Visual Studio`
```batch
set "CMAKE_GENERATOR=Visual Studio 17 2022"
third-party\common\win\premake\premake5.exe --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --verbose --os=windows vs2022
```
* To build using `MSYS2`
```batch
set "CMAKE_GENERATOR=Visual Studio 17 2022"
third-party\common\win\premake\premake5.exe --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --verbose --os=windows vs2022
```
* To build using `MSYS2` **this is currently experimental and will not work due to ABI differences**
<details>
<summary>steps</summary>
*(Optional)* In both cases below, you can use `Clang` compiler instead of `GCC` by running these 2 commands in the same terminal instance
```shell
export CC="clang"
@ -152,6 +160,8 @@ third-party\common\win\premake\premake5.exe --file=premake5-deps.lua --64-build
./third-party/common/win/premake/premake5.exe --file=premake5-deps.lua --32-build --all-ext --all-build --verbose --os=windows gmake2
```
</details>
This will:
* Extract all third party dependencies from the folder `third-party` into the folder `build\deps\win`
* Build all dependencies
@ -177,7 +187,22 @@ This will:
## **Building the emu**
### On Windows:
Open CMD in the repo folder, then run the following
* For `MSYS2`
* For `Visual Studio 2022`
```batch
third-party\common\win\premake\premake5.exe --file=premake5.lua --genproto --os=windows vs2022
```
You can then go to the folder `build\project\vs2022\win` and open the produced `.sln` file in Visual Studio.
Or, if you prefer to do it from command line, open the `Developer Command Prompt for VS 2022` inside the above folder, then:
```batch
msbuild /nologo /v:n /p:Configuration=release,Platform=Win32 gbe.sln
msbuild /nologo /v:n /p:Configuration=release,Platform=x64 gbe.sln
```
* For `MSYS2` **this is currently experimental and will not work due to ABI differences**
<details>
<summary>steps</summary>
```shell
./third-party/common/win/premake/premake5.exe --file=premake5.lua --genproto --os=windows gmake2
@ -200,18 +225,8 @@ Open CMD in the repo folder, then run the following
```shell
make help
```
* For `Visual Studio 2022`
```batch
third-party\common\win\premake\premake5.exe --file=premake5.lua --genproto --os=windows vs2022
```
You can then go to the folder `build\project\vs2022\win` and open the produced `.sln` file in Visual Studio.
Or, if you prefer to do it from command line, open the `Developer Command Prompt for VS 2022` inside the above folder, then:
```batch
msbuild /nologo /v:n /p:Configuration=release,Platform=Win32 gbe.sln
msbuild /nologo /v:n /p:Configuration=release,Platform=x64 gbe.sln
```
</details>
This will build a release version of the emu in the folder `build\win\<toolchain>\release`
An example script `build_win_premake.bat` is available, check it out