Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The ARM architecture is not supported.

## Compiling

- For EasyRPG Player: Run build.cmd
- For EasyRPG Editor: (currently unsupported)
- For EasyRPG Player: Run `build.cmd`
- For EasyRPG Editor: Run `download_qt6.cmd` and `build_editor.cmd`

This bootstraps vcpkg and builds all required libraries.

Expand All @@ -26,14 +26,14 @@ prebuilt version. Run ``download_prebuilt.cmd`` to obtain them.
This precompiled version will only work on the latest version of Visual Studio
2022. If you are using a different version, please compile it yourself.

## After compiling

### Environment setup
## Environment setup

Run ``setup_env.cmd`` once to configure the necessary environment variables.

Then log out of Windows to ensure that the changes take effect.

## Compile instructions for EasyRPG Player

### Configuring

Open the "Developer Command Prompt for Visual Studio 2022" from the Start menu
Expand Down Expand Up @@ -71,5 +71,30 @@ Player.
Open the ``EasyRPG_Player.sln`` file created in ``build\[PRESET]`` in Visual
Studio (``[PRESET]`` is equal to the value after ``--preset`` above).

When the build type is different to Debug, you must set the correct build type
manually in Visual Studio, otherwise you will get strange build errors.
## Compile instructions for EasyRPG Editor

### Configuring

Open the "Developer Command Prompt for Visual Studio 2022" from the Start menu
and navigate to your _EasyRPG Editor_ directory.

To configure the editor run:

```
cmake --preset windows-x64-vs2022-[BUILD_TYPE]
```

liblcf is not provided by the buildscript. Either compile it yourself or use
the triplet `windows-x64-vs2022-liblcf-[BUILD_TYPE]` to build it as part of
the Editor.

Options for ``[BUILD_TYPE]``:

- ``debug``: Debug build
- ``relwithdebinfo``: Release build with debug symbols
- ``release``: Release build without debug symbols

### Building

Open the ``EasyRPG_Editor.sln`` file created in ``build\[PRESET]`` in Visual
Studio (``[PRESET]`` is equal to the value after ``--preset`` above).
10 changes: 10 additions & 0 deletions windows/build_editor.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:: Builds the dependencies for EasyRPG Editor

call helper\prepare.cmd

:: Build 64-bit libraries
vcpkg install --triplet x64-windows-static-easyrpgeditor --recurse^
zlib[core] expat[core] inih[cpp] nlohmann-json[core]

:: Other dependencies such as Kirigami are built via vcpkg.json and a custom
:: overlay in the editor repository. This makes updating them easier.
12 changes: 0 additions & 12 deletions windows/build_qt5.cmd

This file was deleted.

7 changes: 7 additions & 0 deletions windows/download_qt6.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:: Downloads the Qt6 precompiled libraries
:: These are the official ones from the Qt Project
:: Compiling Qt6 is not feasible as it takes hours

curl -LO "https://github.com/miurahr/aqtinstall/releases/download/v3.3.0/aqt.exe"

aqt install-qt -O qt windows desktop 6.10.1 win64_msvc2022_64 -m all
3 changes: 3 additions & 0 deletions windows/helper/prepare.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ git restore -s 50ca16008cebab427e90a98f8ffc34208b215dba ports/fmt
:: Optimize the debug libraries
copy ..\helper\windows.cmake scripts\toolchains\windows.cmake

:: add custom editor triplet
copy ..\helper\x64-windows-static-easyrpgeditor.cmake triplets\x64-windows-static-easyrpgeditor.cmake

:: Copy custom portfiles
:: ICU static data file
xcopy /Y /I /E ..\icu-easyrpg ports\icu-easyrpg
Expand Down
8 changes: 8 additions & 0 deletions windows/helper/x64-windows-static-easyrpgeditor.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
# Qt6 uses the dynamic CRT (/MD)
# The CRT must match for all linked libraries
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
# Use our downloaded Qt6 prebuild
# Compiling Qt6 manually takes hours
set(VCPKG_ENV_PASSTHROUGH Qt6_Path)