Skip to content

Commit 9dac569

Browse files
authored
Merge pull request #210 from Ghabry/windows-qt6
Windows: Add Qt6 and Editor install script
2 parents f51c899 + b5b4514 commit 9dac569

7 files changed

Lines changed: 85 additions & 19 deletions

File tree

macos/download_qt6.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Downloads the Qt6 precompiled libraries
4+
# These are the official ones from the Qt Project
5+
# Compiling Qt6 is not feasible as it takes hours
6+
7+
curl -LO "https://github.com/miurahr/aqtinstall/releases/download/v3.3.0/aqt-macos"
8+
9+
chmod +x aqt-macos
10+
11+
./aqt-macos install-qt -O qt mac desktop 6.10.1 clang_64 -m all

windows/README.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The ARM architecture is not supported.
1111

1212
## Compiling
1313

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

1717
This bootstraps vcpkg and builds all required libraries.
1818

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

29-
## After compiling
30-
31-
### Environment setup
29+
## Environment setup
3230

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

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

35+
## Compile instructions for EasyRPG Player
36+
3737
### Configuring
3838

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

74-
When the build type is different to Debug, you must set the correct build type
75-
manually in Visual Studio, otherwise you will get strange build errors.
74+
## Compile instructions for EasyRPG Editor
75+
76+
### Enabling Long Path Support
77+
78+
Compiling the editor fails because the path length of the Kirigami dependency
79+
exceeds the legacy Windows limit of 260 characters.
80+
81+
To resolve this issue, either enable long path support in the Windows 11
82+
Developer Settings, or run the following command in PowerShell as an
83+
administrator:
84+
85+
```psh
86+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
87+
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
88+
```
89+
90+
### Configuring
91+
92+
Open the "Developer Command Prompt for Visual Studio 2022" from the Start menu
93+
and navigate to your _EasyRPG Editor_ directory.
94+
95+
To configure the editor run:
96+
97+
```
98+
cmake --preset windows-x64-vs2022-[BUILD_TYPE]
99+
```
100+
101+
liblcf is not provided by the buildscript. Either compile it yourself or use
102+
the triplet `windows-x64-vs2022-liblcf-[BUILD_TYPE]` to build it as part of
103+
the Editor.
104+
105+
Options for ``[BUILD_TYPE]``:
106+
107+
- ``debug``: Debug build
108+
- ``relwithdebinfo``: Release build with debug symbols
109+
- ``release``: Release build without debug symbols
110+
111+
### Building
112+
113+
Open the ``EasyRPG_Editor.sln`` file created in ``build\[PRESET]`` in Visual
114+
Studio (``[PRESET]`` is equal to the value after ``--preset`` above).

windows/build_editor.cmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:: Builds the dependencies for EasyRPG Editor
2+
3+
call helper\prepare.cmd
4+
5+
:: Build 64-bit libraries
6+
vcpkg install --triplet x64-windows-static-easyrpgeditor --recurse^
7+
zlib[core] expat[core] inih[cpp] nlohmann-json[core] glaze[core]
8+
9+
:: Other dependencies such as Kirigami are built via vcpkg.json and a custom
10+
:: overlay in the editor repository. This makes updating them easier.

windows/build_qt5.cmd

Lines changed: 0 additions & 12 deletions
This file was deleted.

windows/download_qt6.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:: Downloads the Qt6 precompiled libraries
2+
:: These are the official ones from the Qt Project
3+
:: Compiling Qt6 is not feasible as it takes hours
4+
5+
curl -LO "https://github.com/miurahr/aqtinstall/releases/download/v3.3.0/aqt.exe"
6+
7+
aqt install-qt -O qt windows desktop 6.10.1 win64_msvc2022_64 -m all

windows/helper/prepare.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ git restore -s 50ca16008cebab427e90a98f8ffc34208b215dba ports/fmt
1818
:: Optimize the debug libraries
1919
copy ..\helper\windows.cmake scripts\toolchains\windows.cmake
2020

21+
:: add custom editor triplet
22+
copy ..\helper\x64-windows-static-easyrpgeditor.cmake triplets\x64-windows-static-easyrpgeditor.cmake
23+
2124
:: Copy custom portfiles
2225
:: ICU static data file
2326
xcopy /Y /I /E ..\icu-easyrpg ports\icu-easyrpg
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x64)
2+
# Qt6 uses the dynamic CRT (/MD)
3+
# The CRT must match for all linked libraries
4+
set(VCPKG_CRT_LINKAGE dynamic)
5+
set(VCPKG_LIBRARY_LINKAGE static)
6+
# Use our downloaded Qt6 prebuild
7+
# Compiling Qt6 manually takes hours
8+
set(VCPKG_ENV_PASSTHROUGH Qt6_Path)

0 commit comments

Comments
 (0)