From 8cace06df9e51f3d98c7c453fcf816678cf265f3 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 14 Jul 2025 14:44:28 +0300 Subject: [PATCH] move libarchive outside bundle libs Signed-off-by: Trial97 --- CMakeLists.txt | 26 +++++++++---------- launcher/minecraft/mod/Mod.h | 2 -- launcher/minecraft/mod/ModDetails.h | 4 --- .../modplatform/flame/FlamePackExportTask.cpp | 1 - 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 705bb695b..8dfe02f89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -349,29 +349,29 @@ else() pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode) endif() -if(NOT Launcher_FORCE_BUNDLED_LIBS) +# Find libarchive through CMake packages, mainly for vcpkg +find_package(LibArchive QUIET) +# CMake packages aren't available in most distributions of libarchive, so fallback to pkg-config +if(NOT LibArchive_FOUND) find_package(PkgConfig REQUIRED) - pkg_check_modules(libarchive IMPORTED_TARGET libarchive) + pkg_check_modules(libarchive REQUIRED IMPORTED_TARGET libarchive) +endif() + + +if(NOT Launcher_FORCE_BUNDLED_LIBS) # Find toml++ find_package(tomlplusplus 3.2.0 QUIET) # Fallback to pkg-config (if available) if CMake files aren't found if(NOT tomlplusplus_FOUND) - pkg_check_modules(tomlplusplus IMPORTED_TARGET tomlplusplus>=3.2.0) + find_package(PkgConfig QUIET) + if(PkgConfig_FOUND) + pkg_check_modules(tomlplusplus IMPORTED_TARGET tomlplusplus>=3.2.0) + endif() endif() # Find cmark find_package(cmark QUIET) - - find_package(LibArchive 3.7.8 QUIET) - # Fallback to pkg-config (if available) if CMake files aren't found - if(NOT LibArchive_FOUND) - pkg_check_modules(LibArchive IMPORTED_TARGET LibArchive>=3.7.8) - endif() - - # Find qrcodegencpp-cmake - find_package(qrcodegencpp QUIET) - endif() include(ECMQtDeclareLoggingCategory) diff --git a/launcher/minecraft/mod/Mod.h b/launcher/minecraft/mod/Mod.h index eceb8c256..c548f5350 100644 --- a/launcher/minecraft/mod/Mod.h +++ b/launcher/minecraft/mod/Mod.h @@ -44,8 +44,6 @@ #include #include -#include - #include "ModDetails.h" #include "Resource.h" diff --git a/launcher/minecraft/mod/ModDetails.h b/launcher/minecraft/mod/ModDetails.h index 9195c0368..9b81f561f 100644 --- a/launcher/minecraft/mod/ModDetails.h +++ b/launcher/minecraft/mod/ModDetails.h @@ -35,14 +35,10 @@ #pragma once -#include - #include #include #include -#include "minecraft/mod/MetadataHandler.h" - struct ModLicense { QString name = {}; QString id = {}; diff --git a/launcher/modplatform/flame/FlamePackExportTask.cpp b/launcher/modplatform/flame/FlamePackExportTask.cpp index b3ad4b606..1166dc99c 100644 --- a/launcher/modplatform/flame/FlamePackExportTask.cpp +++ b/launcher/modplatform/flame/FlamePackExportTask.cpp @@ -30,7 +30,6 @@ #include #include "Application.h" #include "Json.h" -#include "MMCZip.h" #include "archive/ExportToZipTask.h" #include "minecraft/PackProfile.h" #include "minecraft/mod/ModFolderModel.h"