From c993209b763f1d00e2e003d6ea6fa6c5d1afec02 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:29 +0100 Subject: 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(-) (limited to 'launcher') 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 { -- cgit From e682c3e9b8f75599c89e10b4d7ffa7612d2bd2e9 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 27 Oct 2022 17:37:30 +0100 Subject: Fix: Correct exclusions for debug QT plugins Signed-off-by: TheLastRar --- launcher/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'launcher') 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 ) -- cgit From 653a953d2fee6a2c140e01dbbd204bde5d424be4 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Wed, 26 Oct 2022 01:44:30 +0100 Subject: CMake: Add zlib Signed-off-by: TheLastRar --- CMakeLists.txt | 18 ++++++++++++++++++ launcher/CMakeLists.txt | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'launcher') 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} -- cgit From f8ad1a052f78cb201aee3599214faa7ab644ee06 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sat, 29 Oct 2022 16:55:38 +0100 Subject: CMake: Support multi-configuration generators Signed-off-by: TheLastRar --- CMakeLists.txt | 17 ++++-- launcher/CMakeLists.txt | 138 ++++++++++++++++++++++++------------------------ 2 files changed, 80 insertions(+), 75 deletions(-) (limited to 'launcher') 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 - install( - DIRECTORY "${QT_PLUGINS_DIR}/imageformats" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "tga|tiff|mng" EXCLUDE - ) - # Icon engines - install( - DIRECTORY "${QT_PLUGINS_DIR}/iconengines" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "fontawesome" EXCLUDE - ) - # Platform plugins + # 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}/platforms" + DIRECTORY "${QT_PLUGINS_DIR}/styles" + CONFIGURATIONS Debug RelWithDebInfo 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" + DIRECTORY "${QT_PLUGINS_DIR}/styles" + 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 + 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 - REGEX "_debug\\." EXCLUDE - REGEX "\\.dSYM" EXCLUDE ) - # Platform plugins install( - DIRECTORY "${QT_PLUGINS_DIR}/platforms" + DIRECTORY "${QT_PLUGINS_DIR}/tls" + CONFIGURATIONS Release MinSizeRel DESTINATION ${PLUGIN_DEST_DIR} COMPONENT Runtime - REGEX "minimal|linuxfb|offscreen" EXCLUDE - REGEX "[^2]d\\." EXCLUDE + REGEX "dd\\." 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" -- cgit From e29259cd5511f25a4559ff1f8a4e9473ad81ee4e Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Tue, 1 Nov 2022 14:04:14 +0000 Subject: 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(-) (limited to 'launcher') 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"); -- cgit