diff --git a/windows/README.md b/windows/README.md index ebd2919e..580df581 100644 --- a/windows/README.md +++ b/windows/README.md @@ -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. @@ -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 @@ -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). diff --git a/windows/build_editor.cmd b/windows/build_editor.cmd new file mode 100644 index 00000000..d3d2afa7 --- /dev/null +++ b/windows/build_editor.cmd @@ -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. diff --git a/windows/build_qt5.cmd b/windows/build_qt5.cmd deleted file mode 100644 index 96bca033..00000000 --- a/windows/build_qt5.cmd +++ /dev/null @@ -1,12 +0,0 @@ -:: Builds the dependencies for EasyRPG Editor Qt - -call helper\prepare.cmd - -:: Depend on icu-easyrpg -:: FIXME: Delete this when vcpkg implements "Provides:" -powershell -Command "(Get-Content ports\qt5-base\CONTROL) -replace 'icu', 'icu-easyrpg' | Out-File -encoding ASCII 'ports\qt5-base\CONTROL'" - -:: Build 64-bit libraries -vcpkg install --triplet x64-windows-static --recurse^ - expat[core]^ - qt5[core,multimedia,svg,declarative,extras] diff --git a/windows/download_qt6.cmd b/windows/download_qt6.cmd new file mode 100644 index 00000000..0fb57c11 --- /dev/null +++ b/windows/download_qt6.cmd @@ -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 diff --git a/windows/helper/prepare.cmd b/windows/helper/prepare.cmd index 9f7d0ef0..9087d14f 100644 --- a/windows/helper/prepare.cmd +++ b/windows/helper/prepare.cmd @@ -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 diff --git a/windows/helper/x64-windows-static-easyrpgeditor.cmake b/windows/helper/x64-windows-static-easyrpgeditor.cmake new file mode 100644 index 00000000..a75de6db --- /dev/null +++ b/windows/helper/x64-windows-static-easyrpgeditor.cmake @@ -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)