From c993209b763f1d00e2e003d6ea6fa6c5d1afec02 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:29 +0100 Subject: [PATCH 01/20] Fix: Explicitly specify Version.h path MSVC uses a different search mechanism that ends up picking the mete Version.h Signed-off-by: TheLastRar --- launcher/modplatform/ModAPI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/modplatform/ModAPI.h b/launcher/modplatform/ModAPI.h index c7408835..703de143 100644 --- a/launcher/modplatform/ModAPI.h +++ b/launcher/modplatform/ModAPI.h @@ -39,7 +39,7 @@ #include #include -#include "Version.h" +#include "../Version.h" #include "net/NetJob.h" namespace ModPlatform { From fe347262e9785a4706a92d981275eb08b8f9c103 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:30 +0100 Subject: [PATCH 02/20] Fix: Using uint8_t in std::uniform_int_distribution is undefined Signed-off-by: TheLastRar --- tests/GZip_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/GZip_test.cpp b/tests/GZip_test.cpp index 1e762b2e..82503d81 100644 --- a/tests/GZip_test.cpp +++ b/tests/GZip_test.cpp @@ -24,7 +24,7 @@ slots: QByteArray compressed; QByteArray decompressed; std::default_random_engine eng((std::random_device())()); - std::uniform_int_distribution idis(0, std::numeric_limits::max()); + std::uniform_int_distribution idis(0, std::numeric_limits::max()); // initialize random buffer for(int i = 0; i < size; i++) From e682c3e9b8f75599c89e10b4d7ffa7612d2bd2e9 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 27 Oct 2022 17:37:30 +0100 Subject: [PATCH 03/20] Fix: Correct exclusions for debug QT plugins Signed-off-by: TheLastRar --- launcher/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 0dae47df..7998f4f5 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1127,7 +1127,7 @@ if(INSTALL_BUNDLE STREQUAL "full") DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime REGEX "minimal|linuxfb|offscreen" EXCLUDE - REGEX "d\\." EXCLUDE + REGEX "[^2]d\\." EXCLUDE REGEX "_debug\\." EXCLUDE REGEX "\\.dSYM" EXCLUDE ) @@ -1148,6 +1148,7 @@ if(INSTALL_BUNDLE STREQUAL "full") DIRECTORY "${QT_PLUGINS_DIR}/tls" DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime + REGEX "dd\\." EXCLUDE REGEX "_debug\\." EXCLUDE REGEX "\\.dSYM" EXCLUDE ) From e2e6d000644053d556347936ae46d1c0885199a4 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sun, 30 Oct 2022 14:43:31 +0000 Subject: [PATCH 04/20] CMake: Remove CMP0020 OLD Signed-off-by: TheLastRar --- CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed83c205..630cf0cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required(VERSION 3.15) # minimum version required by QuaZip -if(WIN32) - # In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows - cmake_policy(SET CMP0020 OLD) -endif() - project(Launcher) string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BUILD_DIR}" IS_IN_SOURCE_BUILD) From 6d4efc04434a5aa6e48b537f2fb19f58a02d6161 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:30 +0100 Subject: [PATCH 05/20] Libraries: Add zlib Signed-off-by: TheLastRar --- .gitmodules | 3 +++ libraries/zlib | 1 + 2 files changed, 4 insertions(+) create mode 160000 libraries/zlib diff --git a/.gitmodules b/.gitmodules index 8d034354..68fb2864 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "libraries/libnbtplusplus"] path = libraries/libnbtplusplus url = https://github.com/PrismLauncher/libnbtplusplus.git +[submodule "libraries/zlib"] + path = libraries/zlib + url = https://github.com/madler/zlib.git diff --git a/libraries/zlib b/libraries/zlib new file mode 160000 index 00000000..04f42cec --- /dev/null +++ b/libraries/zlib @@ -0,0 +1 @@ +Subproject commit 04f42ceca40f73e2978b50e93806c2a18c1281fc From 653a953d2fee6a2c140e01dbbd204bde5d424be4 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:30 +0100 Subject: [PATCH 06/20] CMake: Add zlib Signed-off-by: TheLastRar --- CMakeLists.txt | 18 ++++++++++++++++++ launcher/CMakeLists.txt | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 630cf0cf..3ed4d772 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,10 @@ set(Launcher_BUILD_TIMESTAMP "${TODAY}") ################################ 3rd Party Libs ################################ +if(NOT Launcher_FORCE_BUNDLED_LIBS) + find_package(ZLIB QUIET) +endif() + # Find the required Qt parts include(QtVersionlessBackport) if(Launcher_QT_VERSION_MAJOR EQUAL 5) @@ -306,6 +310,20 @@ add_subdirectory(libraries/systeminfo) # system information library add_subdirectory(libraries/hoedown) # markdown parser add_subdirectory(libraries/launcher) # java based launcher part for Minecraft add_subdirectory(libraries/javacheck) # java compatibility checker +if(NOT ZLIB_FOUND) + message(STATUS "Using bundled zlib") + set(SKIP_INSTALL_ALL ON) + add_subdirectory(libraries/zlib EXCLUDE_FROM_ALL) + + set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib" "${CMAKE_CURRENT_BINARY_DIR}/libraries/zlib") + set_target_properties(zlibstatic PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIR}") + add_library(ZLIB::ZLIB ALIAS zlibstatic) + set(ZLIB_LIBRARY ZLIB::ZLIB) + set(ZLIB_FOUND true) + find_package(ZLIB REQUIRED) +else() + message(STATUS "Using system zlib") +endif() if (FORCE_BUNDLED_QUAZIP) message(STATUS "Using bundled QuaZip") set(BUILD_SHARED_LIBS 0) # link statically to avoid conflicts. diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 7998f4f5..a54a25f9 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -539,9 +539,6 @@ set(ATLAUNCHER_SOURCES ################################ COMPILE ################################ -# we need zlib -find_package(ZLIB REQUIRED) - set(LOGIC_SOURCES ${CORE_SOURCES} ${PATHMATCHER_SOURCES} From 29c1639b1dd0a578046bb9227d6c8d53132a52b1 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Mon, 31 Oct 2022 01:14:25 +0000 Subject: [PATCH 07/20] CMake: Force bundled zlib to take our IPO settings Signed-off-by: TheLastRar --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ed4d772..08727ae2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,6 +312,7 @@ add_subdirectory(libraries/launcher) # java based launcher part for Minecraft add_subdirectory(libraries/javacheck) # java compatibility checker if(NOT ZLIB_FOUND) message(STATUS "Using bundled zlib") + set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) # Suppress cmake warnings and allow INTERPROCEDURAL_OPTIMIZATION for zlib set(SKIP_INSTALL_ALL ON) add_subdirectory(libraries/zlib EXCLUDE_FROM_ALL) From d52868c6c53935f3c12165e470ba3928295d747c Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:30 +0100 Subject: [PATCH 08/20] CI: Exclude zlib tests Signed-off-by: TheLastRar --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba8f9d38..b3c1a6ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,13 +223,13 @@ jobs: - name: Test if: runner.os != 'Windows' run: | - ctest --test-dir build --output-on-failure + ctest -E "^example64|example$" --test-dir build --output-on-failure - name: Test (Windows) if: runner.os == 'Windows' shell: msys2 {0} run: | - ctest --test-dir build --output-on-failure + ctest -E "^example64|example$" --test-dir build --output-on-failure ## # CODE SCAN From 1d38248194d4633327c22c2220299ebb10d0c495 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:31 +0100 Subject: [PATCH 09/20] Libraries: Add ECM Signed-off-by: TheLastRar --- .gitmodules | 3 +++ libraries/extra-cmake-modules | 1 + 2 files changed, 4 insertions(+) create mode 160000 libraries/extra-cmake-modules diff --git a/.gitmodules b/.gitmodules index 68fb2864..95274f15 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "libraries/zlib"] path = libraries/zlib url = https://github.com/madler/zlib.git +[submodule "libraries/extra-cmake-modules"] + path = libraries/extra-cmake-modules + url = https://github.com/KDE/extra-cmake-modules diff --git a/libraries/extra-cmake-modules b/libraries/extra-cmake-modules new file mode 160000 index 00000000..bbcbaff7 --- /dev/null +++ b/libraries/extra-cmake-modules @@ -0,0 +1 @@ +Subproject commit bbcbaff78283270c2beee69afd8d5b91da854af8 From e777c26a14ac4efb0c22557c38ec5cb9f1632368 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 27 Oct 2022 22:31:51 +0100 Subject: [PATCH 10/20] CMake: Add fallback to bundled ECM Signed-off-by: TheLastRar --- CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08727ae2..d9793485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,8 +60,20 @@ endif() option(BUILD_TESTING "Build the testing tree." ON) -find_package(ECM REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH};${CMAKE_MODULE_PATH}") +find_package(ECM QUIET NO_MODULE) +if(NOT ECM_FOUND) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") + message(STATUS "Using bundled ECM") + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}") + else() + message(FATAL_ERROR + " Could not find ECM\n \n" + " Either install ECM using the system package manager or clone submodules\n" + " Submodules can be cloned with 'git submodule update --init --recursive'") + endif() +else() + set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH};${CMAKE_MODULE_PATH}") +endif() include(CTest) include(ECMAddTests) if(BUILD_TESTING) From 12632ec404cd056c148c1c2ae026a023788b741e Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:30 +0100 Subject: [PATCH 11/20] CMake: Build flags for MSVC Signed-off-by: TheLastRar --- CMakeLists.txt | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9793485..bb0d6974 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,11 +27,37 @@ set(CMAKE_C_STANDARD_REQUIRED true) set(CMAKE_CXX_STANDARD 17) set(CMAKE_C_STANDARD 11) include(GenerateExportHeader) -set(CMAKE_CXX_FLAGS "-Wall -pedantic -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}") +if(MSVC) + # Use /W4 as /Wall includes unnesserey warnings such as added padding to structs + # /permissive- specify standards-conforming compiler behavior, also enabled by Qt6, default on with std:c++20 + # /GS Adds buffer security checks, default on but incuded anyway to mirror gcc's fstack-protector flag + set(CMAKE_CXX_FLAGS "/W4 /permissive- /GS ${CMAKE_CXX_FLAGS}") -# ATL's packlist needs more than the default 1 Mib stack on windows -if(WIN32) - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}") + # LINK accepts /SUBSYSTEM whics sets if we are a WINDOWS (gui) or a CONSOLE programs + # This implicitly selects an entrypoint specific to the subsystem selected + # qtmain/QtEntryPointLib provides the correct entrypoint (wWinMain) for gui programs + # Additinaly LINK autodetects we use a GUI so we can omit /SUBSYSTEM + # This allows tests to still use have console without using seperate linker flags + # /MANIFEST:NO disables generating a manifest file, we instead provide our own + # /STACK sets the stack reserve size, ATL's pack list needs 3-4 MiB as of November 2022, provide 8 MiB + set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST:NO /STACK:8388608 ${CMAKE_EXE_LINKER_FLAGS}") + + # See https://github.com/ccache/ccache/issues/1040 + # Note, CMake 3.25 replaces this with CMAKE_MSVC_DEBUG_INFORMATION_FORMAT + # See https://cmake.org/cmake/help/v3.25/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html + foreach(config DEBUG RELWITHDEBINFO) + foreach(lang C CXX) + set(flags_var "CMAKE_${lang}_FLAGS_${config}") + string(REGEX REPLACE "/Z[Ii]" "/Z7" ${flags_var} "${${flags_var}}") + endforeach() + endforeach() +else() + set(CMAKE_CXX_FLAGS "-Wall -pedantic -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}") + + # ATL's pack list needs more than the default 1 Mib stack on windows + if(WIN32) + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}") + endif() endif() # Fix build with Qt 5.13 From 372ce588cd2b851f47816ce6c16712ab0f2b522f Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:31 +0100 Subject: [PATCH 12/20] CI: Add MSVC Builds Signed-off-by: TheLastRar --- .github/workflows/build.yml | 94 +++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3c1a6ec..109f7ac0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: qt_host: linux qt_version: '6.2.4' qt_modules: 'qt5compat qtimageformats' + qt_tools: '' - os: windows-2022 name: "Windows-Legacy" @@ -38,6 +39,24 @@ jobs: msystem: clang64 qt_ver: 6 + - os: windows-2022 + name: "Windows-Legacy-MSVC" + msystem: '' + qt_ver: 5 + qt_host: windows + qt_version: '5.15.2' + qt_modules: '' + qt_tools: 'tools_openssl_x86' + + - os: windows-2022 + name: "Windows-MSVC" + msystem: '' + qt_ver: 6 + qt_host: windows + qt_version: '6.4.0' + qt_modules: 'qt5compat qtimageformats' + qt_tools: '' + - os: macos-12 name: macOS macosx_deployment_target: 10.15 @@ -45,6 +64,7 @@ jobs: qt_host: mac qt_version: '6.3.0' qt_modules: 'qt5compat qtimageformats' + qt_tools: '' - os: macos-12 name: macOS-Legacy @@ -53,6 +73,7 @@ jobs: qt_host: mac qt_version: '5.15.2' qt_modules: '' + qt_tools: '' runs-on: ${{ matrix.os }} @@ -82,7 +103,7 @@ jobs: languages: cpp, java - name: 'Setup MSYS2' - if: runner.os == 'Windows' + if: runner.os == 'Windows' && matrix.msystem != '' uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.msystem }} @@ -102,14 +123,23 @@ jobs: ccache:p ${{ matrix.qt_ver == 6 && 'qt6-5compat:p' || '' }} + - name: 'Setup MSVC for Ninja' + if: runner.os == 'Windows' && matrix.msystem == '' + uses: ilammy/msvc-dev-cmd@v1 + + - name: Force newer ccache + if: runner.os == 'Windows' && matrix.msystem == '' && inputs.build_type == 'Debug' + run: | + choco install ccache --version 4.7.1 + - name: Setup ccache - if: runner.os != 'Windows' && inputs.build_type == 'Debug' + if: (runner.os != 'Windows' || matrix.msystem == '') && inputs.build_type == 'Debug' uses: hendrikmuhs/ccache-action@v1.2.5 with: key: ${{ matrix.os }}-qt${{ matrix.qt_ver }} - - name: Setup ccache (Windows) - if: runner.os == 'Windows' && inputs.build_type == 'Debug' + - name: Setup ccache (Windows MinGW-w64) + if: runner.os == 'Windows' && matrix.msystem != '' && inputs.build_type == 'Debug' shell: msys2 {0} run: | ccache --set-config=cache_dir='${{ github.workspace }}\.ccache' @@ -124,8 +154,8 @@ jobs: run: | echo "CCACHE_VAR=ccache" >> $GITHUB_ENV - - name: Retrieve ccache cache (Windows) - if: runner.os == 'Windows' && inputs.build_type == 'Debug' + - name: Retrieve ccache cache (Windows MinGW-w64) + if: runner.os == 'Windows' && matrix.msystem != '' && inputs.build_type == 'Debug' uses: actions/cache@v3.0.11 with: path: '${{ github.workspace }}\.ccache' @@ -156,14 +186,15 @@ jobs: run: | sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 - - name: Install Qt (macOS and AppImage) - if: runner.os == 'Linux' && matrix.qt_ver == 6 || runner.os == 'macOS' + - name: Install Qt (macOS, AppImage & Windows MSVC) + if: runner.os == 'Linux' && matrix.qt_ver == 6 || runner.os == 'macOS' || (runner.os == 'Windows' && matrix.msystem == '') uses: jurplel/install-qt-action@v3 with: version: ${{ matrix.qt_version }} host: ${{ matrix.qt_host }} target: 'desktop' modules: ${{ matrix.qt_modules }} + tools: ${{ matrix.qt_tools }} cache: true cache-key-prefix: ${{ matrix.qt_host }}-${{ matrix.qt_version }}-"${{ matrix.qt_modules }}"-qt_cache @@ -190,12 +221,17 @@ jobs: run: | cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DMACOSX_SPARKLE_UPDATE_PUBLIC_KEY="" -DMACOSX_SPARKLE_UPDATE_FEED_URL="" -G Ninja - - name: Configure CMake (Windows) - if: runner.os == 'Windows' + - name: Configure CMake (Windows MinGW-w64) + if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} run: | cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja + - name: Configure CMake (Windows MSVC) + if: runner.os == 'Windows' && matrix.msystem == '' + run: | + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja + - name: Configure CMake (Linux) if: runner.os == 'Linux' run: | @@ -206,12 +242,12 @@ jobs: ## - name: Build - if: runner.os != 'Windows' + if: runner.os != 'Windows' || matrix.msystem == '' run: | cmake --build ${{ env.BUILD_DIR }} - - name: Build (Windows) - if: runner.os == 'Windows' + - name: Build (Windows MinGW-w64) + if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} run: | cmake --build ${{ env.BUILD_DIR }} @@ -221,12 +257,12 @@ jobs: ## - name: Test - if: runner.os != 'Windows' + if: runner.os != 'Windows' || matrix.msystem == '' run: | ctest -E "^example64|example$" --test-dir build --output-on-failure - - name: Test (Windows) - if: runner.os == 'Windows' + - name: Test (Windows MinGW-w64) + if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} run: | ctest -E "^example64|example$" --test-dir build --output-on-failure @@ -273,8 +309,8 @@ jobs: EOF fi - - name: Package (Windows) - if: runner.os == 'Windows' + - name: Package (Windows MinGW-w64) + if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} run: | cmake --install ${{ env.BUILD_DIR }} @@ -284,13 +320,31 @@ jobs: cp /clang32/bin/libcrypto-1_1.dll /clang32/bin/libssl-1_1.dll ./ fi - - name: Package (Windows, portable) - if: runner.os == 'Windows' + - name: Package (Windows MSVC) + if: runner.os == 'Windows' && matrix.msystem == '' + run: | + cmake --install ${{ env.BUILD_DIR }} + + cd ${{ env.INSTALL_DIR }} + if ("${{ matrix.qt_ver }}" -eq "5") + { + Copy-Item D:/a/PrismLauncher/Qt/Tools/OpenSSL/Win_x86/bin/libcrypto-1_1.dll -Destination libcrypto-1_1.dll + Copy-Item D:/a/PrismLauncher/Qt/Tools/OpenSSL/Win_x86/bin/libssl-1_1.dll -Destination libssl-1_1.dll + } + + - name: Package (Windows MinGW-w64, portable) + if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} run: | cp -r ${{ env.INSTALL_DIR }} ${{ env.INSTALL_PORTABLE_DIR }} # cmake install on Windows is slow, let's just copy instead cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }} --component portable + - name: Package (Windows MSVC, portable) + if: runner.os == 'Windows' && matrix.msystem == '' + run: | + cp -r ${{ env.INSTALL_DIR }} ${{ env.INSTALL_PORTABLE_DIR }} # cmake install on Windows is slow, let's just copy instead + cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }} --component portable + - name: Package (Windows, installer) if: runner.os == 'Windows' run: | From f8ad1a052f78cb201aee3599214faa7ab644ee06 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sat, 29 Oct 2022 16:55:38 +0100 Subject: [PATCH 13/20] CMake: Support multi-configuration generators Signed-off-by: TheLastRar --- CMakeLists.txt | 17 +++-- launcher/CMakeLists.txt | 146 ++++++++++++++++++++-------------------- 2 files changed, 84 insertions(+), 79 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb0d6974..f282c79f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,11 +74,18 @@ if(ENABLE_LTO) include(CheckIPOSupported) check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error) - if(ipo_supported AND (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")) - message(STATUS "IPO / LTO enabled") - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) - elseif(ipo_supported) - message(STATUS "Not enabling IPO / LTO on debug builds") + if(ipo_supported) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE) + if(CMAKE_BUILD_TYPE) + if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") + message(STATUS "IPO / LTO enabled") + else() + message(STATUS "Not enabling IPO / LTO on debug builds") + endif() + else() + message(STATUS "IPO / LTO will only be enabled for release builds") + endif() else() message(STATUS "IPO / LTO not supported: <${ipo_error}>") endif() diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index a54a25f9..fd1dd03b 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1059,97 +1059,95 @@ if(INSTALL_BUNDLE STREQUAL "full") COMPONENT Runtime ) # Bundle plugins - if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") - # Image formats + # Image formats + install( + DIRECTORY "${QT_PLUGINS_DIR}/imageformats" + CONFIGURATIONS Debug RelWithDebInfo + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "tga|tiff|mng" EXCLUDE + ) + install( + DIRECTORY "${QT_PLUGINS_DIR}/imageformats" + CONFIGURATIONS Release MinSizeRel + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "tga|tiff|mng" EXCLUDE + REGEX "d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + REGEX "\\.dSYM" EXCLUDE + ) + # Icon engines + install( + DIRECTORY "${QT_PLUGINS_DIR}/iconengines" + CONFIGURATIONS Debug RelWithDebInfo + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "fontawesome" EXCLUDE + ) + install( + DIRECTORY "${QT_PLUGINS_DIR}/iconengines" + CONFIGURATIONS Release MinSizeRel + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "fontawesome" EXCLUDE + REGEX "d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + REGEX "\\.dSYM" EXCLUDE + ) + # Platform plugins + install( + DIRECTORY "${QT_PLUGINS_DIR}/platforms" + CONFIGURATIONS Debug RelWithDebInfo + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "minimal|linuxfb|offscreen" EXCLUDE + ) + install( + DIRECTORY "${QT_PLUGINS_DIR}/platforms" + CONFIGURATIONS Release MinSizeRel + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "minimal|linuxfb|offscreen" EXCLUDE + REGEX "[^2]d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + REGEX "\\.dSYM" EXCLUDE + ) + # Style plugins + if(EXISTS "${QT_PLUGINS_DIR}/styles") install( - DIRECTORY "${QT_PLUGINS_DIR}/imageformats" + DIRECTORY "${QT_PLUGINS_DIR}/styles" + CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime - REGEX "tga|tiff|mng" EXCLUDE ) - # Icon engines install( - DIRECTORY "${QT_PLUGINS_DIR}/iconengines" + DIRECTORY "${QT_PLUGINS_DIR}/styles" + CONFIGURATIONS Release MinSizeRel DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime - REGEX "fontawesome" EXCLUDE - ) - # Platform plugins - install( - DIRECTORY "${QT_PLUGINS_DIR}/platforms" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "minimal|linuxfb|offscreen" EXCLUDE - ) - # Style plugins - if(EXISTS "${QT_PLUGINS_DIR}/styles") - install( - DIRECTORY "${QT_PLUGINS_DIR}/styles" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - ) - endif() - # TLS plugins (Qt 6 only) - if(EXISTS "${QT_PLUGINS_DIR}/tls") - install( - DIRECTORY "${QT_PLUGINS_DIR}/tls" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - ) - endif() - else() - # Image formats - install( - DIRECTORY "${QT_PLUGINS_DIR}/imageformats" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "tga|tiff|mng" EXCLUDE REGEX "d\\." EXCLUDE REGEX "_debug\\." EXCLUDE REGEX "\\.dSYM" EXCLUDE ) - # Icon engines + endif() + # TLS plugins (Qt 6 only) + if(EXISTS "${QT_PLUGINS_DIR}/tls") install( - DIRECTORY "${QT_PLUGINS_DIR}/iconengines" + DIRECTORY "${QT_PLUGINS_DIR}/tls" + CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime - REGEX "fontawesome" EXCLUDE - REGEX "d\\." EXCLUDE + ) + install( + DIRECTORY "${QT_PLUGINS_DIR}/tls" + CONFIGURATIONS Release MinSizeRel + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "dd\\." EXCLUDE REGEX "_debug\\." EXCLUDE REGEX "\\.dSYM" EXCLUDE ) - # Platform plugins - install( - DIRECTORY "${QT_PLUGINS_DIR}/platforms" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "minimal|linuxfb|offscreen" EXCLUDE - REGEX "[^2]d\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - REGEX "\\.dSYM" EXCLUDE - ) - # Style plugins - if(EXISTS "${QT_PLUGINS_DIR}/styles") - install( - DIRECTORY "${QT_PLUGINS_DIR}/styles" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "d\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - REGEX "\\.dSYM" EXCLUDE - ) - endif() - # TLS plugins (Qt 6 only) - if(EXISTS "${QT_PLUGINS_DIR}/tls") - install( - DIRECTORY "${QT_PLUGINS_DIR}/tls" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "dd\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - REGEX "\\.dSYM" EXCLUDE - ) - endif() endif() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in" From cc8456ec6bf239b1386796c5a9cb507dace30085 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 28 Oct 2022 11:51:55 +0100 Subject: [PATCH 14/20] CI: Use msbuild generator for msvc builds Signed-off-by: TheLastRar --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 109f7ac0..a067312a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,10 +123,6 @@ jobs: ccache:p ${{ matrix.qt_ver == 6 && 'qt6-5compat:p' || '' }} - - name: 'Setup MSVC for Ninja' - if: runner.os == 'Windows' && matrix.msystem == '' - uses: ilammy/msvc-dev-cmd@v1 - - name: Force newer ccache if: runner.os == 'Windows' && matrix.msystem == '' && inputs.build_type == 'Debug' run: | @@ -230,7 +226,17 @@ jobs: - name: Configure CMake (Windows MSVC) if: runner.os == 'Windows' && matrix.msystem == '' run: | - cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} + # https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix) + if ("${{ env.CCACHE_VAR }}") + { + Copy-Item C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.7.1-windows-x86_64/ccache.exe -Destination C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.7.1-windows-x86_64/cl.exe + echo "CLToolExe=cl.exe" >> $env:GITHUB_ENV + echo "CLToolPath=C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.7.1-windows-x86_64/" >> $env:GITHUB_ENV + echo "TrackFileAccess=false" >> $env:GITHUB_ENV + } + # Needed for ccache, but also speeds up compile + echo "UseMultiToolTask=true" >> $env:GITHUB_ENV - name: Configure CMake (Linux) if: runner.os == 'Linux' @@ -242,7 +248,7 @@ jobs: ## - name: Build - if: runner.os != 'Windows' || matrix.msystem == '' + if: runner.os != 'Windows' run: | cmake --build ${{ env.BUILD_DIR }} @@ -252,12 +258,17 @@ jobs: run: | cmake --build ${{ env.BUILD_DIR }} + - name: Build (Windows MSVC) + if: runner.os == 'Windows' && matrix.msystem == '' + run: | + cmake --build ${{ env.BUILD_DIR }} --config ${{ inputs.build_type }} + ## # TEST ## - name: Test - if: runner.os != 'Windows' || matrix.msystem == '' + if: runner.os != 'Windows' run: | ctest -E "^example64|example$" --test-dir build --output-on-failure @@ -267,6 +278,11 @@ jobs: run: | ctest -E "^example64|example$" --test-dir build --output-on-failure + - name: Test (Windows MSVC) + if: runner.os == 'Windows' && matrix.msystem == '' + run: | + ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }} + ## # CODE SCAN ## @@ -323,7 +339,7 @@ jobs: - name: Package (Windows MSVC) if: runner.os == 'Windows' && matrix.msystem == '' run: | - cmake --install ${{ env.BUILD_DIR }} + cmake --install ${{ env.BUILD_DIR }} --config ${{ inputs.build_type }} cd ${{ env.INSTALL_DIR }} if ("${{ matrix.qt_ver }}" -eq "5") From 4f327120ac34a7a530497bf0f6e2268d847fdb12 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sat, 29 Oct 2022 21:58:08 +0100 Subject: [PATCH 15/20] CI: Link to release libraries even in debug Signed-off-by: TheLastRar --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a067312a..063e3bc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -226,7 +226,7 @@ jobs: - name: Configure CMake (Windows MSVC) if: runner.os == 'Windows' && matrix.msystem == '' run: | - cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" # https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix) if ("${{ env.CCACHE_VAR }}") { diff --git a/CMakeLists.txt b/CMakeLists.txt index f282c79f..00eb1925 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,11 @@ if(MSVC) string(REGEX REPLACE "/Z[Ii]" "/Z7" ${flags_var} "${${flags_var}}") endforeach() endforeach() + + if(CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL "MultiThreadedDLL") + set(CMAKE_MAP_IMPORTED_CONFIG_DEBUG Release "") + set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release "") + endif() else() set(CMAKE_CXX_FLAGS "-Wall -pedantic -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}") From 3f75e1cb1db7c048207a8c8842489dc35bc2ffd2 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sun, 30 Oct 2022 14:03:40 +0000 Subject: [PATCH 16/20] CI: Build MSVC Legacy as 32bit Signed-off-by: TheLastRar --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 063e3bc1..adaf484b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: - os: ubuntu-20.04 qt_ver: 6 qt_host: linux + qt_arch: '' qt_version: '6.2.4' qt_modules: 'qt5compat qtimageformats' qt_tools: '' @@ -42,8 +43,10 @@ jobs: - os: windows-2022 name: "Windows-Legacy-MSVC" msystem: '' + architecture: 'win32' qt_ver: 5 qt_host: windows + qt_arch: 'win32_msvc2019' qt_version: '5.15.2' qt_modules: '' qt_tools: 'tools_openssl_x86' @@ -51,8 +54,10 @@ jobs: - os: windows-2022 name: "Windows-MSVC" msystem: '' + architecture: 'x64' qt_ver: 6 qt_host: windows + qt_arch: '' qt_version: '6.4.0' qt_modules: 'qt5compat qtimageformats' qt_tools: '' @@ -62,6 +67,7 @@ jobs: macosx_deployment_target: 10.15 qt_ver: 6 qt_host: mac + qt_arch: '' qt_version: '6.3.0' qt_modules: 'qt5compat qtimageformats' qt_tools: '' @@ -189,6 +195,7 @@ jobs: version: ${{ matrix.qt_version }} host: ${{ matrix.qt_host }} target: 'desktop' + arch: ${{ matrix.qt_arch }} modules: ${{ matrix.qt_modules }} tools: ${{ matrix.qt_tools }} cache: true @@ -226,7 +233,7 @@ jobs: - name: Configure CMake (Windows MSVC) if: runner.os == 'Windows' && matrix.msystem == '' run: | - cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" -A${{ matrix.architecture}} # https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix) if ("${{ env.CCACHE_VAR }}") { From 98444bd8656c396f4dd04721ddf7721910c07b48 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Mon, 31 Oct 2022 14:43:14 +0000 Subject: [PATCH 17/20] CI: Add VC variables before packaging on Windows Signed-off-by: TheLastRar --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adaf484b..3cf99760 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,7 @@ jobs: name: "Windows-Legacy-MSVC" msystem: '' architecture: 'win32' + vcvars_arch: 'amd64_x86' qt_ver: 5 qt_host: windows qt_arch: 'win32_msvc2019' @@ -55,6 +56,7 @@ jobs: name: "Windows-MSVC" msystem: '' architecture: 'x64' + vcvars_arch: 'amd64' qt_ver: 6 qt_host: windows qt_arch: '' @@ -332,6 +334,12 @@ jobs: EOF fi + - name: Add VC Enviroment Variables + if: runner.os == 'Windows' && matrix.msystem == '' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.vcvars_arch }} + - name: Package (Windows MinGW-w64) if: runner.os == 'Windows' && matrix.msystem != '' shell: msys2 {0} From 79a728d7d2a379799a2813b83a418ece1ff1aa3c Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Tue, 1 Nov 2022 13:46:30 +0000 Subject: [PATCH 18/20] Fix: Conflicting types for hoedown functions Signed-off-by: TheLastRar --- libraries/hoedown/src/autolink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/hoedown/src/autolink.c b/libraries/hoedown/src/autolink.c index 3063b1a0..3592b8e3 100644 --- a/libraries/hoedown/src/autolink.c +++ b/libraries/hoedown/src/autolink.c @@ -150,7 +150,7 @@ hoedown_autolink__www( uint8_t *data, size_t max_rewind, size_t size, - unsigned int flags) + hoedown_autolink_flags flags) { size_t link_end; @@ -186,7 +186,7 @@ hoedown_autolink__email( uint8_t *data, size_t max_rewind, size_t size, - unsigned int flags) + hoedown_autolink_flags flags) { size_t link_end, rewind; int nb = 0, np = 0; @@ -242,7 +242,7 @@ hoedown_autolink__url( uint8_t *data, size_t max_rewind, size_t size, - unsigned int flags) + hoedown_autolink_flags flags) { size_t link_end, rewind = 0, domain_len; From e29259cd5511f25a4559ff1f8a4e9473ad81ee4e Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Tue, 1 Nov 2022 14:04:14 +0000 Subject: [PATCH 19/20] Fix: Resolve ambiguous overload errors Clang-cl fails to select the correct function and instead errors Signed-off-by: TheLastRar --- launcher/modplatform/modrinth/ModrinthPackManifest.cpp | 2 +- launcher/net/HttpMetaCache.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/modplatform/modrinth/ModrinthPackManifest.cpp b/launcher/modplatform/modrinth/ModrinthPackManifest.cpp index a4620df9..96f54067 100644 --- a/launcher/modplatform/modrinth/ModrinthPackManifest.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackManifest.cpp @@ -140,7 +140,7 @@ auto loadIndexedVersion(QJsonObject &obj) -> ModpackVersion for (auto file_iter : files) { File indexed_file; auto parent = Json::requireObject(file_iter); - auto is_primary = Json::ensureBoolean(parent, "primary", false); + auto is_primary = Json::ensureBoolean(parent, (const QString)QStringLiteral("primary"), false); if (!is_primary) { auto filename = Json::ensureString(parent, "filename"); // Checking suffix here is fine because it's the response from Modrinth, diff --git a/launcher/net/HttpMetaCache.cpp b/launcher/net/HttpMetaCache.cpp index 42198b71..e242dcf4 100644 --- a/launcher/net/HttpMetaCache.cpp +++ b/launcher/net/HttpMetaCache.cpp @@ -242,7 +242,7 @@ void HttpMetaCache::Load() foo->local_changed_timestamp = Json::ensureDouble(element_obj, "last_changed_timestamp"); foo->remote_changed_timestamp = Json::ensureString(element_obj, "remote_changed_timestamp"); - foo->makeEternal(Json::ensureBoolean(element_obj, "eternal", false)); + foo->makeEternal(Json::ensureBoolean(element_obj, (const QString)QStringLiteral("eternal"), false)); if (!foo->isEternal()) { foo->current_age = Json::ensureDouble(element_obj, "current_age"); foo->max_age = Json::ensureDouble(element_obj, "max_age"); From 396a7994f9f485192b13f21a3dcf6710b50356ed Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Tue, 1 Nov 2022 19:59:37 +0000 Subject: [PATCH 20/20] Workflow: Add MSVC Builds to release workflow Signed-off-by: TheLastRar --- .github/workflows/trigger_release.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index e74e870a..d415b2b1 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -47,10 +47,12 @@ jobs: for d in PrismLauncher-Windows-*; do cd "${d}" || continue + MSVC="$(echo -n ${d} | grep -o MSVC || true)" LEGACY="$(echo -n ${d} | grep -o Legacy || true)" INST="$(echo -n ${d} | grep -o Setup || true)" PORT="$(echo -n ${d} | grep -o Portable || true)" NAME="PrismLauncher-Windows" + test -z "${MSVC}" && NAME="${NAME}-MinGW" || NAME="${NAME}-MSVC" test -z "${LEGACY}" || NAME="${NAME}-Legacy" test -z "${PORT}" || NAME="${NAME}-Portable" test -z "${INST}" || mv PrismLauncher-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe @@ -72,14 +74,20 @@ jobs: PrismLauncher-Linux-${{ env.VERSION }}.tar.gz PrismLauncher-Linux-Portable-${{ env.VERSION }}.tar.gz PrismLauncher-Linux-${{ env.VERSION }}-x86_64.AppImage - PrismLauncher-Windows-Legacy-${{ env.VERSION }}.zip PrismLauncher-Linux-Qt6-${{ env.VERSION }}.tar.gz PrismLauncher-Linux-Qt6-Portable-${{ env.VERSION }}.tar.gz - PrismLauncher-Windows-Legacy-Portable-${{ env.VERSION }}.zip - PrismLauncher-Windows-Legacy-Setup-${{ env.VERSION }}.exe - PrismLauncher-Windows-${{ env.VERSION }}.zip - PrismLauncher-Windows-Portable-${{ env.VERSION }}.zip - PrismLauncher-Windows-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MinGW-Legacy-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-Legacy-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-Legacy-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MinGW-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MinGW-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MSVC-Legacy-${{ env.VERSION }}.zip + PrismLauncher-Windows-MSVC-Legacy-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MSVC-Legacy-Setup-${{ env.VERSION }}.exe + PrismLauncher-Windows-MSVC-${{ env.VERSION }}.zip + PrismLauncher-Windows-MSVC-Portable-${{ env.VERSION }}.zip + PrismLauncher-Windows-MSVC-Setup-${{ env.VERSION }}.exe PrismLauncher-macOS-${{ env.VERSION }}.tar.gz PrismLauncher-macOS-Legacy-${{ env.VERSION }}.tar.gz PrismLauncher-${{ env.VERSION }}.tar.gz