diff --git a/CMakeLists.txt b/CMakeLists.txt index cfff5ae26..411c4b160 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.2.0) string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BUILD_DIR}" IS_IN_SOURCE_BUILD) if(IS_IN_SOURCE_BUILD) @@ -34,8 +34,10 @@ set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars) ######## Set compiler flags ######## include(UseCXX14) include(Coverage) +include(GenerateExportHeader) set(CMAKE_CXX_FLAGS " -Wall ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type") +set(CMAKE_CXX_VISIBILITY_PRESET hidden) # cmake code needed for the coverity scan upload include(Coverity) diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index 1ba19bc2f..1cc37a5db 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -323,7 +323,7 @@ if(WIN32) set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::WinMain) endif(WIN32) -include_directories(../logic) +include_directories(../logic ${CMAKE_CURRENT_BINARY_DIR}/../logic) # Qt 5 stuff qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS}) diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 891842b52..b50d01600 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -1105,6 +1105,8 @@ void MainWindow::instanceFromZipPack(QString instName, QString instGroup, QStrin errorMsg += tr("Not an instance"); CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); return; + default: + break; } newInstance->setName(instName); diff --git a/application/pages/OtherLogsPage.h b/application/pages/OtherLogsPage.h index 9a5a6ed45..564b26d21 100644 --- a/application/pages/OtherLogsPage.h +++ b/application/pages/OtherLogsPage.h @@ -70,7 +70,7 @@ private: private: Ui::OtherLogsPage *ui; QString m_path; - RecursiveFileSystemWatcher *m_watcher; QString m_currentFile; IPathMatcher::Ptr m_fileFilter; + RecursiveFileSystemWatcher *m_watcher; }; diff --git a/logic/BaseInstaller.h b/logic/BaseInstaller.h index d4f43beb7..dd8040855 100644 --- a/logic/BaseInstaller.h +++ b/logic/BaseInstaller.h @@ -17,6 +17,8 @@ #include +#include "multimc_logic_export.h" + class OneSixInstance; class QDir; class QString; @@ -25,7 +27,7 @@ class Task; struct BaseVersion; typedef std::shared_ptr BaseVersionPtr; -class BaseInstaller +class MULTIMC_LOGIC_EXPORT BaseInstaller { public: BaseInstaller(); diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h index 070a98387..7fbd5de56 100644 --- a/logic/BaseInstance.h +++ b/logic/BaseInstance.h @@ -28,6 +28,8 @@ #include "launch/MessageLevel.h" #include "pathmatcher/IPathMatcher.h" +#include "multimc_logic_export.h" + class QDir; class Task; class LaunchTask; @@ -44,7 +46,7 @@ typedef std::shared_ptr InstancePtr; * To create a new instance type, create a new class inheriting from this class * and implement the pure virtual functions. */ -class BaseInstance : public QObject, public std::enable_shared_from_this +class MULTIMC_LOGIC_EXPORT BaseInstance : public QObject, public std::enable_shared_from_this { Q_OBJECT protected: diff --git a/logic/BaseVersionList.h b/logic/BaseVersionList.h index ce36e2866..e8d0cca7e 100644 --- a/logic/BaseVersionList.h +++ b/logic/BaseVersionList.h @@ -20,8 +20,8 @@ #include #include "BaseVersion.h" - -class Task; +#include "tasks/Task.h" +#include "multimc_logic_export.h" /*! * \brief Class that each instance type's version list derives from. @@ -35,7 +35,7 @@ class Task; * all have a default implementation, but they can be overridden by plugins to * change the behavior of the list. */ -class BaseVersionList : public QAbstractListModel +class MULTIMC_LOGIC_EXPORT BaseVersionList : public QAbstractListModel { Q_OBJECT public: diff --git a/logic/CMakeLists.txt b/logic/CMakeLists.txt index fce89ac8a..1f6b62bfb 100644 --- a/logic/CMakeLists.txt +++ b/logic/CMakeLists.txt @@ -308,7 +308,9 @@ if(WIN32) endif() # Add common library -add_library(MultiMC_logic STATIC ${LOGIC_SOURCES}) +add_library(MultiMC_logic SHARED ${LOGIC_SOURCES}) + +generate_export_header(MultiMC_logic) # Use system zlib on unix and Qt ZLIB on Windows if(UNIX) @@ -328,3 +330,5 @@ target_link_libraries(MultiMC_logic xz-embedded unpack200 iconfix libUtil Logica ${ZLIB_LIBRARIES} ${MultiMC_LINK_ADDITIONAL_LIBS}) add_dependencies(MultiMC_logic QuaZIP) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/logic/Env.h b/logic/Env.h index a53a62cb7..b81cfa629 100644 --- a/logic/Env.h +++ b/logic/Env.h @@ -4,6 +4,8 @@ #include #include +#include "multimc_logic_export.h" + class IconList; class QNetworkAccessManager; class HttpMetaCache; @@ -15,7 +17,7 @@ class BaseVersion; #endif #define ENV (Env::getInstance()) -class Env +class MULTIMC_LOGIC_EXPORT Env { friend class MultiMC; private: diff --git a/logic/Exception.h b/logic/Exception.h index 2664910eb..0dae39a06 100644 --- a/logic/Exception.h +++ b/logic/Exception.h @@ -6,7 +6,9 @@ #include #include -class Exception : public std::exception +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT Exception : public std::exception { public: Exception(const QString &message) : std::exception(), m_message(message) @@ -30,12 +32,3 @@ public: private: QString m_message; }; - -#define DECLARE_EXCEPTION(name) \ - class name##Exception : public ::Exception \ - { \ - public: \ - name##Exception(const QString &message) : Exception(message) \ - { \ - } \ - } diff --git a/logic/FileSystem.h b/logic/FileSystem.h index e70f31656..a66e7ead8 100644 --- a/logic/FileSystem.h +++ b/logic/FileSystem.h @@ -4,10 +4,17 @@ #include "Exception.h" +#include "multimc_logic_export.h" + namespace FS { -DECLARE_EXCEPTION(FileSystem); -void write(const QString &filename, const QByteArray &data); -QByteArray read(const QString &filename); +class MULTIMC_LOGIC_EXPORT FileSystemException : public ::Exception +{ +public: + FileSystemException(const QString &message) : Exception(message) {} +}; + +void MULTIMC_LOGIC_EXPORT write(const QString &filename, const QByteArray &data); +QByteArray MULTIMC_LOGIC_EXPORT read(const QString &filename); } diff --git a/logic/GZip.h b/logic/GZip.h index cd9f53d83..7ccf1d385 100644 --- a/logic/GZip.h +++ b/logic/GZip.h @@ -1,7 +1,9 @@ #pragma once #include -class GZip +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT GZip { public: static bool inflate(const QByteArray &compressedBytes, QByteArray &uncompressedBytes); diff --git a/logic/InstanceList.h b/logic/InstanceList.h index 07a71ffb5..1799080a9 100644 --- a/logic/InstanceList.h +++ b/logic/InstanceList.h @@ -21,10 +21,12 @@ #include "BaseInstance.h" +#include "multimc_logic_export.h" + class BaseInstance; class QDir; -class InstanceList : public QAbstractListModel +class MULTIMC_LOGIC_EXPORT InstanceList : public QAbstractListModel { Q_OBJECT private: diff --git a/logic/Json.h b/logic/Json.h index 55f0cfc16..f03f777ab 100644 --- a/logic/Json.h +++ b/logic/Json.h @@ -16,7 +16,11 @@ namespace Json { -DECLARE_EXCEPTION(Json); +class MULTIMC_LOGIC_EXPORT JsonException : public ::Exception +{ +public: + JsonException(const QString &message) : Exception(message) {} +}; /// @throw FileSystemException void write(const QJsonDocument &doc, const QString &filename); diff --git a/logic/MMCStrings.h b/logic/MMCStrings.h index b2dd3912f..5606b9099 100644 --- a/logic/MMCStrings.h +++ b/logic/MMCStrings.h @@ -2,7 +2,9 @@ #include +#include "multimc_logic_export.h" + namespace Strings { - int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs); + int MULTIMC_LOGIC_EXPORT naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs); } diff --git a/logic/MMCZip.h b/logic/MMCZip.h index 0107d7a66..a31670791 100644 --- a/logic/MMCZip.h +++ b/logic/MMCZip.h @@ -7,6 +7,8 @@ #include "SeparatorPrefixTree.h" #include +#include "multimc_logic_export.h" + class QuaZip; namespace MMCZip @@ -19,7 +21,7 @@ namespace MMCZip * \param recursive Whether to pack sub-directories as well or only files. * \return true if success, false otherwise. */ - bool compressSubDir(QuaZip *zip, QString dir, QString origDir, QSet &added, + bool MULTIMC_LOGIC_EXPORT compressSubDir(QuaZip *zip, QString dir, QString origDir, QSet &added, QString prefix = QString(), const SeparatorPrefixTree <'/'> * blacklist = nullptr); /** @@ -29,23 +31,23 @@ namespace MMCZip * \param recursive Whether to pack the subdirectories as well, or just regular files. * \return true if success, false otherwise. */ - bool compressDir(QString zipFile, QString dir, QString prefix = QString(), const SeparatorPrefixTree <'/'> * blacklist = nullptr); + bool MULTIMC_LOGIC_EXPORT compressDir(QString zipFile, QString dir, QString prefix = QString(), const SeparatorPrefixTree <'/'> * blacklist = nullptr); /// filter function for @mergeZipFiles - passthrough - bool noFilter(QString key); + bool MULTIMC_LOGIC_EXPORT noFilter(QString key); /// filter function for @mergeZipFiles - ignores METAINF - bool metaInfFilter(QString key); + bool MULTIMC_LOGIC_EXPORT metaInfFilter(QString key); /** * Merge two zip files, using a filter function */ - bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet &contained, std::function filter); + bool MULTIMC_LOGIC_EXPORT mergeZipFiles(QuaZip *into, QFileInfo from, QSet &contained, std::function filter); /** * take a source jar, add mods to it, resulting in target jar */ - bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList& mods); + bool MULTIMC_LOGIC_EXPORT createModdedJar(QString sourceJarPath, QString targetJarPath, const QList& mods); /** * Extract a whole archive. @@ -55,5 +57,5 @@ namespace MMCZip * left empty. * \return The list of the full paths of the files extracted, empty on failure. */ - QStringList extractDir(QString fileCompressed, QString dir = QString()); + QStringList MULTIMC_LOGIC_EXPORT extractDir(QString fileCompressed, QString dir = QString()); } \ No newline at end of file diff --git a/logic/RecursiveFileSystemWatcher.h b/logic/RecursiveFileSystemWatcher.h index a2a9e7e3d..07bce0b90 100644 --- a/logic/RecursiveFileSystemWatcher.h +++ b/logic/RecursiveFileSystemWatcher.h @@ -4,7 +4,9 @@ #include #include "pathmatcher/IPathMatcher.h" -class RecursiveFileSystemWatcher : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT RecursiveFileSystemWatcher : public QObject { Q_OBJECT public: diff --git a/logic/auth/AuthSession.h b/logic/auth/AuthSession.h index 2ac170fab..dede90a9e 100644 --- a/logic/auth/AuthSession.h +++ b/logic/auth/AuthSession.h @@ -4,13 +4,15 @@ #include #include +#include "multimc_logic_export.h" + struct User { QString id; QMultiMap properties; }; -struct AuthSession +struct MULTIMC_LOGIC_EXPORT AuthSession { bool MakeOffline(QString offline_playername); diff --git a/logic/auth/MojangAccount.h b/logic/auth/MojangAccount.h index 47ebf91b0..5cf8a0f2f 100644 --- a/logic/auth/MojangAccount.h +++ b/logic/auth/MojangAccount.h @@ -25,6 +25,9 @@ #include #include "AuthSession.h" +#include "multimc_logic_export.h" +MULTIMC_LOGIC_EXPORT + class Task; class YggdrasilTask; class MojangAccount; @@ -58,7 +61,7 @@ enum AccountStatus * Said information may include things such as that account's username, client token, and access * token if the user chose to stay logged in. */ -class MojangAccount : public QObject +class MULTIMC_LOGIC_EXPORT MojangAccount : public QObject { Q_OBJECT public: /* construction */ diff --git a/logic/auth/MojangAccountList.h b/logic/auth/MojangAccountList.h index b68343f2f..49b71fabb 100644 --- a/logic/auth/MojangAccountList.h +++ b/logic/auth/MojangAccountList.h @@ -22,6 +22,8 @@ #include "auth/MojangAccount.h" +#include "multimc_logic_export.h" + /*! * \brief List of available Mojang accounts. * This should be loaded in the background by MultiMC on startup. @@ -31,7 +33,7 @@ * all have a default implementation, but they can be overridden by subclasses to * change the behavior of the list. */ -class MojangAccountList : public QAbstractListModel +class MULTIMC_LOGIC_EXPORT MojangAccountList : public QAbstractListModel { Q_OBJECT public: @@ -126,7 +128,7 @@ public: * If the username given is an empty string, sets the active account to nothing. */ virtual void setActiveAccount(const QString &username); - + /*! * Returns true if any of the account is at least Validated */ diff --git a/logic/forge/ForgeInstaller.h b/logic/forge/ForgeInstaller.h index ae30177f1..0de762b6e 100644 --- a/logic/forge/ForgeInstaller.h +++ b/logic/forge/ForgeInstaller.h @@ -20,11 +20,13 @@ #include #include +#include "multimc_logic_export.h" + class MinecraftProfile; class ForgeInstallTask; struct ForgeVersion; -class ForgeInstaller : public BaseInstaller +class MULTIMC_LOGIC_EXPORT ForgeInstaller : public BaseInstaller { friend class ForgeInstallTask; public: diff --git a/logic/forge/ForgeVersionList.h b/logic/forge/ForgeVersionList.h index 35af32331..e2e8c3f87 100644 --- a/logic/forge/ForgeVersionList.h +++ b/logic/forge/ForgeVersionList.h @@ -25,7 +25,9 @@ #include "net/NetJob.h" #include "forge/ForgeVersion.h" -class ForgeVersionList : public BaseVersionList +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT ForgeVersionList : public BaseVersionList { Q_OBJECT public: diff --git a/logic/ftb/FTBPlugin.h b/logic/ftb/FTBPlugin.h index 30913d190..6851d8a52 100644 --- a/logic/ftb/FTBPlugin.h +++ b/logic/ftb/FTBPlugin.h @@ -2,8 +2,10 @@ #include +#include "multimc_logic_export.h" + // Pseudo-plugin for FTB related things. Super derpy! -class FTBPlugin +class MULTIMC_LOGIC_EXPORT FTBPlugin { public: static void initialize(SettingsObjectPtr globalSettings); diff --git a/logic/icons/IconList.h b/logic/icons/IconList.h index cc2ba5c43..971db8242 100644 --- a/logic/icons/IconList.h +++ b/logic/icons/IconList.h @@ -25,9 +25,11 @@ #include "settings/Setting.h" #include "Env.h" // there is a global icon list inside Env. +#include "multimc_logic_export.h" + class QFileSystemWatcher; -class IconList : public QAbstractListModel +class MULTIMC_LOGIC_EXPORT IconList : public QAbstractListModel { Q_OBJECT public: diff --git a/logic/icons/MMCIcon.h b/logic/icons/MMCIcon.h index cf087aa45..753e916d0 100644 --- a/logic/icons/MMCIcon.h +++ b/logic/icons/MMCIcon.h @@ -17,7 +17,10 @@ #include #include #include -struct MMCImage + +#include "multimc_logic_export.h" + +struct MULTIMC_LOGIC_EXPORT MMCImage { QIcon icon; QString filename; @@ -28,7 +31,7 @@ struct MMCImage } }; -struct MMCIcon +struct MULTIMC_LOGIC_EXPORT MMCIcon { enum Type : unsigned { diff --git a/logic/java/JavaChecker.h b/logic/java/JavaChecker.h index a25eef939..3399f07e8 100644 --- a/logic/java/JavaChecker.h +++ b/logic/java/JavaChecker.h @@ -3,6 +3,8 @@ #include #include +#include "multimc_logic_export.h" + class JavaChecker; @@ -20,7 +22,7 @@ struct JavaCheckResult typedef std::shared_ptr QProcessPtr; typedef std::shared_ptr JavaCheckerPtr; -class JavaChecker : public QObject +class MULTIMC_LOGIC_EXPORT JavaChecker : public QObject { Q_OBJECT public: diff --git a/logic/java/JavaUtils.h b/logic/java/JavaUtils.h index cde3050e9..d4dd2409f 100644 --- a/logic/java/JavaUtils.h +++ b/logic/java/JavaUtils.h @@ -27,7 +27,9 @@ #include #endif -class JavaUtils : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT JavaUtils : public QObject { Q_OBJECT public: diff --git a/logic/java/JavaVersionList.h b/logic/java/JavaVersionList.h index d78f9e7c2..905a5a7bd 100644 --- a/logic/java/JavaVersionList.h +++ b/logic/java/JavaVersionList.h @@ -22,6 +22,8 @@ #include "tasks/Task.h" #include "java/JavaCheckerJob.h" +#include "multimc_logic_export.h" + class JavaListLoadTask; struct JavaVersion : public BaseVersion @@ -54,7 +56,7 @@ struct JavaVersion : public BaseVersion typedef std::shared_ptr JavaVersionPtr; -class JavaVersionList : public BaseVersionList +class MULTIMC_LOGIC_EXPORT JavaVersionList : public BaseVersionList { Q_OBJECT public: diff --git a/logic/launch/LaunchTask.h b/logic/launch/LaunchTask.h index bd0485c8b..eb13a72dd 100644 --- a/logic/launch/LaunchTask.h +++ b/logic/launch/LaunchTask.h @@ -22,7 +22,9 @@ #include "LoggedProcess.h" #include "LaunchStep.h" -class LaunchTask: public Task +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT LaunchTask: public Task { Q_OBJECT protected: diff --git a/logic/launch/steps/CheckJava.cpp b/logic/launch/steps/CheckJava.cpp index 92c65d0ac..9c5fd404d 100644 --- a/logic/launch/steps/CheckJava.cpp +++ b/logic/launch/steps/CheckJava.cpp @@ -57,7 +57,6 @@ void CheckJava::executeTask() if (javaUnixTime != storedUnixTime) { m_JavaChecker = std::make_shared(); - bool successful = false; QString errorLog; QString version; emit logLine(tr("Checking Java version..."), MessageLevel::MultiMC); diff --git a/logic/launch/steps/LaunchMinecraft.cpp b/logic/launch/steps/LaunchMinecraft.cpp index 4cde2d9f8..954380031 100644 --- a/logic/launch/steps/LaunchMinecraft.cpp +++ b/logic/launch/steps/LaunchMinecraft.cpp @@ -81,8 +81,8 @@ void LaunchMinecraft::on_state(LoggedProcess::State state) case LoggedProcess::Finished: { m_parent->setPid(-1); - auto exitCode = m_process.exitCode(); //FIXME: make this work again + // auto exitCode = m_process.exitCode(); // m_postlaunchprocess.processEnvironment().insert("INST_EXITCODE", QString(exitCode)); // run post-exit emitSucceeded(); diff --git a/logic/launch/steps/TextPrint.h b/logic/launch/steps/TextPrint.h index 3846bf84d..fdd9014a7 100644 --- a/logic/launch/steps/TextPrint.h +++ b/logic/launch/steps/TextPrint.h @@ -19,7 +19,13 @@ #include #include -class TextPrint: public LaunchStep +#include "multimc_logic_export.h" + +/* + * FIXME: maybe do not export + */ + +class MULTIMC_LOGIC_EXPORT TextPrint: public LaunchStep { Q_OBJECT public: diff --git a/logic/liteloader/LiteLoaderInstaller.h b/logic/liteloader/LiteLoaderInstaller.h index 490d2107a..5afa4f6c7 100644 --- a/logic/liteloader/LiteLoaderInstaller.h +++ b/logic/liteloader/LiteLoaderInstaller.h @@ -21,7 +21,9 @@ #include "BaseInstaller.h" #include "liteloader/LiteLoaderVersionList.h" -class LiteLoaderInstaller : public BaseInstaller +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT LiteLoaderInstaller : public BaseInstaller { public: LiteLoaderInstaller(); diff --git a/logic/liteloader/LiteLoaderVersionList.h b/logic/liteloader/LiteLoaderVersionList.h index f3f783490..e25f2c64b 100644 --- a/logic/liteloader/LiteLoaderVersionList.h +++ b/logic/liteloader/LiteLoaderVersionList.h @@ -25,6 +25,8 @@ #include "net/NetJob.h" #include +#include "multimc_logic_export.h" + class LLListLoadTask; class QNetworkReply; @@ -65,7 +67,7 @@ public: }; typedef std::shared_ptr LiteLoaderVersionPtr; -class LiteLoaderVersionList : public BaseVersionList +class MULTIMC_LOGIC_EXPORT LiteLoaderVersionList : public BaseVersionList { Q_OBJECT public: diff --git a/logic/minecraft/LegacyInstance.h b/logic/minecraft/LegacyInstance.h index 0930c2902..8663dabac 100644 --- a/logic/minecraft/LegacyInstance.h +++ b/logic/minecraft/LegacyInstance.h @@ -17,10 +17,12 @@ #include "minecraft/MinecraftInstance.h" +#include "multimc_logic_export.h" + class ModList; class Task; -class LegacyInstance : public MinecraftInstance +class MULTIMC_LOGIC_EXPORT LegacyInstance : public MinecraftInstance { Q_OBJECT public: diff --git a/logic/minecraft/LwjglVersionList.h b/logic/minecraft/LwjglVersionList.h index 9584f837b..84abaab1f 100644 --- a/logic/minecraft/LwjglVersionList.h +++ b/logic/minecraft/LwjglVersionList.h @@ -24,10 +24,12 @@ #include "BaseVersion.h" #include "BaseVersionList.h" +#include "multimc_logic_export.h" + class LWJGLVersion; typedef std::shared_ptr PtrLWJGLVersion; -class LWJGLVersion : public BaseVersion +class MULTIMC_LOGIC_EXPORT LWJGLVersion : public BaseVersion { public: LWJGLVersion(const QString &name, const QString &url) @@ -60,7 +62,7 @@ protected: QString m_url; }; -class LWJGLVersionList : public BaseVersionList +class MULTIMC_LOGIC_EXPORT LWJGLVersionList : public BaseVersionList { Q_OBJECT public: diff --git a/logic/minecraft/MinecraftInstance.h b/logic/minecraft/MinecraftInstance.h index 39a51b9ab..b3af2fe8c 100644 --- a/logic/minecraft/MinecraftInstance.h +++ b/logic/minecraft/MinecraftInstance.h @@ -3,9 +3,11 @@ #include "minecraft/Mod.h" #include +#include "multimc_logic_export.h" + class ModList; -class MinecraftInstance: public BaseInstance +class MULTIMC_LOGIC_EXPORT MinecraftInstance: public BaseInstance { public: MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir); diff --git a/logic/minecraft/MinecraftProfile.h b/logic/minecraft/MinecraftProfile.h index d97f7bb8b..6f56e8484 100644 --- a/logic/minecraft/MinecraftProfile.h +++ b/logic/minecraft/MinecraftProfile.h @@ -25,10 +25,13 @@ #include "VersionFile.h" #include "JarMod.h" +#include "multimc_logic_export.h" + class ProfileStrategy; class OneSixInstance; -class MinecraftProfile : public QAbstractListModel + +class MULTIMC_LOGIC_EXPORT MinecraftProfile : public QAbstractListModel { Q_OBJECT friend class ProfileStrategy; diff --git a/logic/minecraft/MinecraftVersion.h b/logic/minecraft/MinecraftVersion.h index 3795cb41c..234e55662 100644 --- a/logic/minecraft/MinecraftVersion.h +++ b/logic/minecraft/MinecraftVersion.h @@ -24,11 +24,13 @@ #include "VersionFile.h" #include "VersionSource.h" +#include "multimc_logic_export.h" + class MinecraftProfile; class MinecraftVersion; typedef std::shared_ptr MinecraftVersionPtr; -class MinecraftVersion : public BaseVersion, public ProfilePatch +class MULTIMC_LOGIC_EXPORT MinecraftVersion : public BaseVersion, public ProfilePatch { public: /* methods */ bool usesLegacyLauncher(); diff --git a/logic/minecraft/MinecraftVersionList.h b/logic/minecraft/MinecraftVersionList.h index 8e45d35ab..110f8a664 100644 --- a/logic/minecraft/MinecraftVersionList.h +++ b/logic/minecraft/MinecraftVersionList.h @@ -24,10 +24,12 @@ #include "minecraft/MinecraftVersion.h" #include +#include "multimc_logic_export.h" + class MCVListLoadTask; class MCVListVersionUpdateTask; -class MinecraftVersionList : public BaseVersionList +class MULTIMC_LOGIC_EXPORT MinecraftVersionList : public BaseVersionList { Q_OBJECT private: diff --git a/logic/minecraft/ModList.h b/logic/minecraft/ModList.h index 70eb55691..823854ed9 100644 --- a/logic/minecraft/ModList.h +++ b/logic/minecraft/ModList.h @@ -22,6 +22,8 @@ #include "minecraft/Mod.h" +#include "multimc_logic_export.h" + class LegacyInstance; class BaseInstance; class QFileSystemWatcher; @@ -30,7 +32,7 @@ class QFileSystemWatcher; * A legacy mod list. * Backed by a folder. */ -class ModList : public QAbstractListModel +class MULTIMC_LOGIC_EXPORT ModList : public QAbstractListModel { Q_OBJECT public: diff --git a/logic/minecraft/OneSixInstance.cpp b/logic/minecraft/OneSixInstance.cpp index 6cea55d2e..57fa0a68e 100644 --- a/logic/minecraft/OneSixInstance.cpp +++ b/logic/minecraft/OneSixInstance.cpp @@ -292,7 +292,7 @@ std::shared_ptr OneSixInstance::createJarModdingTask() class JarModTask : public Task { public: - explicit JarModTask(std::shared_ptr inst) : m_inst(inst), Task(nullptr) + explicit JarModTask(std::shared_ptr inst) : Task(nullptr), m_inst(inst) { } virtual void executeTask() diff --git a/logic/minecraft/OneSixInstance.h b/logic/minecraft/OneSixInstance.h index 429023669..963bd152a 100644 --- a/logic/minecraft/OneSixInstance.h +++ b/logic/minecraft/OneSixInstance.h @@ -20,7 +20,9 @@ #include "minecraft/MinecraftProfile.h" #include "minecraft/ModList.h" -class OneSixInstance : public MinecraftInstance +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT OneSixInstance : public MinecraftInstance { Q_OBJECT public: diff --git a/logic/minecraft/SkinUtils.h b/logic/minecraft/SkinUtils.h index bab9d45e2..5584bf6cd 100644 --- a/logic/minecraft/SkinUtils.h +++ b/logic/minecraft/SkinUtils.h @@ -17,7 +17,9 @@ #include +#include "multimc_logic_export.h" + namespace SkinUtils { -QPixmap getFaceFromCache(QString username, int height = 64, int width = 64); +QPixmap MULTIMC_LOGIC_EXPORT getFaceFromCache(QString username, int height = 64, int width = 64); } diff --git a/logic/minecraft/VersionFilterData.h b/logic/minecraft/VersionFilterData.h index 339e3891d..98db24840 100644 --- a/logic/minecraft/VersionFilterData.h +++ b/logic/minecraft/VersionFilterData.h @@ -4,6 +4,8 @@ #include #include +#include "multimc_logic_export.h" + struct FMLlib { QString filename; @@ -29,4 +31,4 @@ struct VersionFilterData // Currently discouraged java version (anything equal and above will be discouraged) QString discouragedJavaVersion; }; -extern VersionFilterData g_VersionFilterData; +extern VersionFilterData MULTIMC_LOGIC_EXPORT g_VersionFilterData; diff --git a/logic/net/ByteArrayDownload.h b/logic/net/ByteArrayDownload.h index a5d8cebe7..e2fc2911d 100644 --- a/logic/net/ByteArrayDownload.h +++ b/logic/net/ByteArrayDownload.h @@ -16,8 +16,10 @@ #pragma once #include "NetAction.h" +#include "multimc_logic_export.h" + typedef std::shared_ptr ByteArrayDownloadPtr; -class ByteArrayDownload : public NetAction +class MULTIMC_LOGIC_EXPORT ByteArrayDownload : public NetAction { Q_OBJECT public: diff --git a/logic/net/CacheDownload.h b/logic/net/CacheDownload.h index 7f95a69dc..f640b740f 100644 --- a/logic/net/CacheDownload.h +++ b/logic/net/CacheDownload.h @@ -20,19 +20,22 @@ #include #include -class INetworkValidator +#include "multimc_logic_export.h" + +/* FIXME: move to its own file(s) */ +class MULTIMC_LOGIC_EXPORT INetworkValidator { public: virtual ~INetworkValidator() {} virtual void validate(const QByteArray &data) = 0; }; -class JsonValidator : public INetworkValidator +class MULTIMC_LOGIC_EXPORT JsonValidator : public INetworkValidator { public: void validate(const QByteArray &data) override; }; -class MD5HashValidator : public INetworkValidator +class MULTIMC_LOGIC_EXPORT MD5HashValidator : public INetworkValidator { public: explicit MD5HashValidator(const QByteArray &expected) @@ -44,7 +47,7 @@ private: }; typedef std::shared_ptr CacheDownloadPtr; -class CacheDownload : public NetAction +class MULTIMC_LOGIC_EXPORT CacheDownload : public NetAction { Q_OBJECT private: diff --git a/logic/net/HttpMetaCache.h b/logic/net/HttpMetaCache.h index 042f66bf2..fba3fe5a0 100644 --- a/logic/net/HttpMetaCache.h +++ b/logic/net/HttpMetaCache.h @@ -19,9 +19,11 @@ #include #include +#include "multimc_logic_export.h" + class HttpMetaCache; -struct MetaEntry +struct MULTIMC_LOGIC_EXPORT MetaEntry { QString base; QString path; @@ -35,7 +37,7 @@ struct MetaEntry typedef std::shared_ptr MetaEntryPtr; -class HttpMetaCache : public QObject +class MULTIMC_LOGIC_EXPORT HttpMetaCache : public QObject { Q_OBJECT public: diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h index 9e4656c7d..85a8bf830 100644 --- a/logic/net/NetJob.h +++ b/logic/net/NetJob.h @@ -24,10 +24,12 @@ #include "tasks/Task.h" #include "QObjectPtr.h" +#include "multimc_logic_export.h" + class NetJob; typedef QObjectPtr NetJobPtr; -class NetJob : public Task +class MULTIMC_LOGIC_EXPORT NetJob : public Task { Q_OBJECT public: diff --git a/logic/net/PasteUpload.h b/logic/net/PasteUpload.h index e353f4214..11850c716 100644 --- a/logic/net/PasteUpload.h +++ b/logic/net/PasteUpload.h @@ -4,7 +4,9 @@ #include #include -class PasteUpload : public Task +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT PasteUpload : public Task { Q_OBJECT public: diff --git a/logic/net/URLConstants.h b/logic/net/URLConstants.h index 01d1482b6..b04f44ba5 100644 --- a/logic/net/URLConstants.h +++ b/logic/net/URLConstants.h @@ -17,6 +17,8 @@ #include +#include "multimc_logic_export.h" + namespace URLConstants { extern const QString AWS_DOWNLOAD_BASE; @@ -26,7 +28,7 @@ extern const QString AWS_DOWNLOAD_INDEXES; extern const QString ASSETS_BASE; extern const QString RESOURCE_BASE; extern const QString LIBRARY_BASE; -extern const QString SKINS_BASE; +MULTIMC_LOGIC_EXPORT extern const QString SKINS_BASE; extern const QString AUTH_BASE; extern const QString FORGE_LEGACY_URL; extern const QString FORGE_GRADLE_URL; diff --git a/logic/news/NewsChecker.h b/logic/news/NewsChecker.h index effa80bf5..b8b90728d 100644 --- a/logic/news/NewsChecker.h +++ b/logic/news/NewsChecker.h @@ -23,7 +23,9 @@ #include "NewsEntry.h" -class NewsChecker : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT NewsChecker : public QObject { Q_OBJECT public: diff --git a/logic/notifications/NotificationChecker.h b/logic/notifications/NotificationChecker.h index 92bc23dc1..a2d92ab90 100644 --- a/logic/notifications/NotificationChecker.h +++ b/logic/notifications/NotificationChecker.h @@ -5,7 +5,9 @@ #include "net/NetJob.h" #include "net/CacheDownload.h" -class NotificationChecker : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT NotificationChecker : public QObject { Q_OBJECT diff --git a/logic/resources/IconResourceHandler.h b/logic/resources/IconResourceHandler.h index 6f933ad4b..44fafc078 100644 --- a/logic/resources/IconResourceHandler.h +++ b/logic/resources/IconResourceHandler.h @@ -4,7 +4,9 @@ #include "ResourceHandler.h" -class IconResourceHandler : public ResourceHandler +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT IconResourceHandler : public ResourceHandler { public: explicit IconResourceHandler(const QString &key); diff --git a/logic/resources/Resource.h b/logic/resources/Resource.h index 40a6d8717..63e97b889 100644 --- a/logic/resources/Resource.h +++ b/logic/resources/Resource.h @@ -9,6 +9,8 @@ #include "ResourceObserver.h" #include "TypeMagic.h" +#include "multimc_logic_export.h" + class ResourceHandler; /** Frontend class for resources @@ -27,7 +29,7 @@ class ResourceHandler; * * @note Always pass resource around using Resource::Ptr! Copy and move constructors are disabled for a reason. */ -class Resource : public std::enable_shared_from_this +class MULTIMC_LOGIC_EXPORT Resource : public std::enable_shared_from_this { // only allow creation from Resource::create and disallow passing around non-pointers explicit Resource(const QString &resource); diff --git a/logic/resources/ResourceHandler.h b/logic/resources/ResourceHandler.h index a4f638ec9..f09d89048 100644 --- a/logic/resources/ResourceHandler.h +++ b/logic/resources/ResourceHandler.h @@ -3,6 +3,8 @@ #include #include +#include "multimc_logic_export.h" + class Resource; /** Base class for things that can retrieve a resource. @@ -11,7 +13,7 @@ class Resource; * call Resource::registerHandler(""), where is the * prefix of the resource ("web", "icon", etc.) */ -class ResourceHandler +class MULTIMC_LOGIC_EXPORT ResourceHandler { public: virtual ~ResourceHandler() {} diff --git a/logic/resources/ResourceObserver.h b/logic/resources/ResourceObserver.h index ef946c326..cf4fa619c 100644 --- a/logic/resources/ResourceObserver.h +++ b/logic/resources/ResourceObserver.h @@ -5,12 +5,13 @@ #include #include +#include "multimc_logic_export.h" class QVariant; class Resource; /// Base class for things that can use a resource -class ResourceObserver +class MULTIMC_LOGIC_EXPORT ResourceObserver { public: virtual ~ResourceObserver(); @@ -39,7 +40,7 @@ private: * * If no name is given an attempt to find a default property for some common classes is done. */ -class QObjectResourceObserver : public QObject, public ResourceObserver +class MULTIMC_LOGIC_EXPORT QObjectResourceObserver : public QObject, public ResourceObserver { public: explicit QObjectResourceObserver(QObject *target, const char *property = nullptr); @@ -57,7 +58,7 @@ private: * * We need Func in order to std::forward the function */ template -class FunctionResourceObserver : public ResourceObserver +class MULTIMC_LOGIC_EXPORT FunctionResourceObserver : public ResourceObserver { std::function m_function; public: diff --git a/logic/screenshots/ImgurAlbumCreation.h b/logic/screenshots/ImgurAlbumCreation.h index f4adf6f24..469174e47 100644 --- a/logic/screenshots/ImgurAlbumCreation.h +++ b/logic/screenshots/ImgurAlbumCreation.h @@ -2,8 +2,10 @@ #include "net/NetAction.h" #include "Screenshot.h" +#include "multimc_logic_export.h" + typedef std::shared_ptr ImgurAlbumCreationPtr; -class ImgurAlbumCreation : public NetAction +class MULTIMC_LOGIC_EXPORT ImgurAlbumCreation : public NetAction { public: explicit ImgurAlbumCreation(QList screenshots); diff --git a/logic/screenshots/ImgurUpload.h b/logic/screenshots/ImgurUpload.h index f6f4c3a16..0a766b8f2 100644 --- a/logic/screenshots/ImgurUpload.h +++ b/logic/screenshots/ImgurUpload.h @@ -2,8 +2,10 @@ #include "net/NetAction.h" #include "Screenshot.h" +#include "multimc_logic_export.h" + typedef std::shared_ptr ImgurUploadPtr; -class ImgurUpload : public NetAction +class MULTIMC_LOGIC_EXPORT ImgurUpload : public NetAction { public: explicit ImgurUpload(ScreenshotPtr shot); diff --git a/logic/settings/INIFile.h b/logic/settings/INIFile.h index f32c55918..5013eb2df 100644 --- a/logic/settings/INIFile.h +++ b/logic/settings/INIFile.h @@ -19,8 +19,10 @@ #include #include +#include "multimc_logic_export.h" + // Sectionless INI parser (for instance config files) -class INIFile : public QMap +class MULTIMC_LOGIC_EXPORT INIFile : public QMap { public: explicit INIFile(); diff --git a/logic/settings/INISettingsObject.h b/logic/settings/INISettingsObject.h index a93eea786..426b62f50 100644 --- a/logic/settings/INISettingsObject.h +++ b/logic/settings/INISettingsObject.h @@ -21,10 +21,12 @@ #include "settings/SettingsObject.h" +#include "multimc_logic_export.h" + /*! * \brief A settings object that stores its settings in an INIFile. */ -class INISettingsObject : public SettingsObject +class MULTIMC_LOGIC_EXPORT INISettingsObject : public SettingsObject { Q_OBJECT public: diff --git a/logic/settings/Setting.h b/logic/settings/Setting.h index fd8147950..6d53ac6d0 100644 --- a/logic/settings/Setting.h +++ b/logic/settings/Setting.h @@ -20,21 +20,23 @@ #include #include +#include "multimc_logic_export.h" + class SettingsObject; /*! * */ -class Setting : public QObject +class MULTIMC_LOGIC_EXPORT Setting : public QObject { Q_OBJECT public: /** * Construct a Setting - * + * * Synonyms are all the possible names used in the settings object, in order of preference. * First synonym is the ID, which identifies the setting in MultiMC. - * + * * defVal is the default value that will be returned when the settings object * doesn't have any value for this setting. */ diff --git a/logic/settings/SettingsObject.h b/logic/settings/SettingsObject.h index 0f299c5d2..821939030 100644 --- a/logic/settings/SettingsObject.h +++ b/logic/settings/SettingsObject.h @@ -21,6 +21,8 @@ #include #include +#include "multimc_logic_export.h" + class Setting; class SettingsObject; @@ -38,7 +40,7 @@ typedef std::shared_ptr SettingsObjectPtr; * * \sa Setting */ -class SettingsObject : public QObject +class MULTIMC_LOGIC_EXPORT SettingsObject : public QObject { Q_OBJECT public: diff --git a/logic/status/StatusChecker.h b/logic/status/StatusChecker.h index 28283eb31..c1a54dbac 100644 --- a/logic/status/StatusChecker.h +++ b/logic/status/StatusChecker.h @@ -21,7 +21,9 @@ #include -class StatusChecker : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT StatusChecker : public QObject { Q_OBJECT public: diff --git a/logic/tasks/SequentialTask.h b/logic/tasks/SequentialTask.h index 1c90765ce..69031095e 100644 --- a/logic/tasks/SequentialTask.h +++ b/logic/tasks/SequentialTask.h @@ -5,7 +5,9 @@ #include #include -class SequentialTask : public Task +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT SequentialTask : public Task { Q_OBJECT public: diff --git a/logic/tasks/Task.h b/logic/tasks/Task.h index 04899c69b..2b0ccbcdd 100644 --- a/logic/tasks/Task.h +++ b/logic/tasks/Task.h @@ -18,7 +18,9 @@ #include #include -class Task : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT Task : public QObject { Q_OBJECT public: diff --git a/logic/tools/BaseExternalTool.h b/logic/tools/BaseExternalTool.h index be23036d7..fe1b5dc65 100644 --- a/logic/tools/BaseExternalTool.h +++ b/logic/tools/BaseExternalTool.h @@ -3,11 +3,13 @@ #include #include +#include "multimc_logic_export.h" + class BaseInstance; class SettingsObject; class QProcess; -class BaseExternalTool : public QObject +class MULTIMC_LOGIC_EXPORT BaseExternalTool : public QObject { Q_OBJECT public: @@ -19,7 +21,7 @@ protected: SettingsObjectPtr globalSettings; }; -class BaseDetachedTool : public BaseExternalTool +class MULTIMC_LOGIC_EXPORT BaseDetachedTool : public BaseExternalTool { Q_OBJECT public: @@ -33,7 +35,7 @@ protected: virtual void runImpl() = 0; }; -class BaseExternalToolFactory +class MULTIMC_LOGIC_EXPORT BaseExternalToolFactory { public: virtual ~BaseExternalToolFactory(); @@ -51,7 +53,7 @@ protected: SettingsObjectPtr globalSettings; }; -class BaseDetachedToolFactory : public BaseExternalToolFactory +class MULTIMC_LOGIC_EXPORT BaseDetachedToolFactory : public BaseExternalToolFactory { public: virtual BaseDetachedTool *createDetachedTool(InstancePtr instance, QObject *parent = 0); diff --git a/logic/tools/BaseProfiler.h b/logic/tools/BaseProfiler.h index 5191f7b89..3340b7e4a 100644 --- a/logic/tools/BaseProfiler.h +++ b/logic/tools/BaseProfiler.h @@ -2,12 +2,14 @@ #include "BaseExternalTool.h" +#include "multimc_logic_export.h" + class BaseInstance; class SettingsObject; class LaunchTask; class QProcess; -class BaseProfiler : public BaseExternalTool +class MULTIMC_LOGIC_EXPORT BaseProfiler : public BaseExternalTool { Q_OBJECT public: @@ -29,7 +31,7 @@ signals: void abortLaunch(const QString &message); }; -class BaseProfilerFactory : public BaseExternalToolFactory +class MULTIMC_LOGIC_EXPORT BaseProfilerFactory : public BaseExternalToolFactory { public: virtual BaseProfiler *createProfiler(InstancePtr instance, QObject *parent = 0); diff --git a/logic/tools/JProfiler.h b/logic/tools/JProfiler.h index b5440b0b4..d658d6c22 100644 --- a/logic/tools/JProfiler.h +++ b/logic/tools/JProfiler.h @@ -2,7 +2,9 @@ #include "BaseProfiler.h" -class JProfilerFactory : public BaseProfilerFactory +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT JProfilerFactory : public BaseProfilerFactory { public: QString name() const override { return "JProfiler"; } diff --git a/logic/tools/JVisualVM.h b/logic/tools/JVisualVM.h index 45de2618a..0674da136 100644 --- a/logic/tools/JVisualVM.h +++ b/logic/tools/JVisualVM.h @@ -2,7 +2,9 @@ #include "BaseProfiler.h" -class JVisualVMFactory : public BaseProfilerFactory +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT JVisualVMFactory : public BaseProfilerFactory { public: QString name() const override { return "JVisualVM"; } diff --git a/logic/tools/MCEditTool.h b/logic/tools/MCEditTool.h index bd40f02dc..c287f1ea0 100644 --- a/logic/tools/MCEditTool.h +++ b/logic/tools/MCEditTool.h @@ -2,7 +2,9 @@ #include "BaseExternalTool.h" -class MCEditTool : public BaseDetachedTool +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT MCEditTool : public BaseDetachedTool { Q_OBJECT public: @@ -13,7 +15,7 @@ protected: void runImpl() override; }; -class MCEditFactory : public BaseDetachedToolFactory +class MULTIMC_LOGIC_EXPORT MCEditFactory : public BaseDetachedToolFactory { public: QString name() const override { return "MCEdit"; } diff --git a/logic/trans/TranslationDownloader.h b/logic/trans/TranslationDownloader.h index 78e7fe1cd..e7893805c 100644 --- a/logic/trans/TranslationDownloader.h +++ b/logic/trans/TranslationDownloader.h @@ -5,11 +5,12 @@ #include #include #include +#include "multimc_logic_export.h" class ByteArrayDownload; class NetJob; -class TranslationDownloader : public QObject +class MULTIMC_LOGIC_EXPORT TranslationDownloader : public QObject { Q_OBJECT diff --git a/logic/updater/DownloadTask.h b/logic/updater/DownloadTask.h index d77c2b2c5..83b4a1426 100644 --- a/logic/updater/DownloadTask.h +++ b/logic/updater/DownloadTask.h @@ -19,13 +19,15 @@ #include "net/NetJob.h" #include "GoUpdate.h" +#include "multimc_logic_export.h" + namespace GoUpdate { /*! * The DownloadTask is a task that takes a given version ID and repository URL, * downloads that version's files from the repository, and prepares to install them. */ -class DownloadTask : public Task +class MULTIMC_LOGIC_EXPORT DownloadTask : public Task { Q_OBJECT diff --git a/logic/updater/GoUpdate.h b/logic/updater/GoUpdate.h index 479f1eebb..b8a534dec 100644 --- a/logic/updater/GoUpdate.h +++ b/logic/updater/GoUpdate.h @@ -2,13 +2,15 @@ #include #include +#include "multimc_logic_export.h" + namespace GoUpdate { /** * A temporary object exchanged between updated checker and the actual update task */ -struct Status +struct MULTIMC_LOGIC_EXPORT Status { bool updateAvailable = false; @@ -25,7 +27,7 @@ struct Status /** * Struct that describes an entry in a VersionFileEntry's `Sources` list. */ -struct FileSource +struct MULTIMC_LOGIC_EXPORT FileSource { FileSource(QString type, QString url, QString compression="") { @@ -48,7 +50,7 @@ typedef QList FileSourceList; /** * Structure that describes an entry in a GoUpdate version's `Files` list. */ -struct VersionFileEntry +struct MULTIMC_LOGIC_EXPORT VersionFileEntry { QString path; int mode; @@ -64,7 +66,7 @@ typedef QList VersionFileList; /** * Structure that describes an operation to perform when installing updates. */ -struct Operation +struct MULTIMC_LOGIC_EXPORT Operation { static Operation CopyOp(QString fsource, QString fdest, int fmode=0644) { @@ -102,13 +104,13 @@ typedef QList OperationList; /** * Loads the file list from the given version info JSON object into the given list. */ -bool parseVersionInfo(const QByteArray &data, VersionFileList& list, QString &error); +bool MULTIMC_LOGIC_EXPORT parseVersionInfo(const QByteArray &data, VersionFileList& list, QString &error); /*! * Takes a list of file entries for the current version's files and the new version's files * and populates the downloadList and operationList with information about how to download and install the update. */ -bool processFileLists +bool MULTIMC_LOGIC_EXPORT processFileLists ( const VersionFileList ¤tVersion, const VersionFileList &newVersion, @@ -125,7 +127,7 @@ bool processFileLists * * @return false if the path couldn't be fixed (is invalid) */ -bool fixPathForOSX(QString &path); +bool MULTIMC_LOGIC_EXPORT fixPathForOSX(QString &path); } Q_DECLARE_METATYPE(GoUpdate::Status); \ No newline at end of file diff --git a/logic/updater/UpdateChecker.h b/logic/updater/UpdateChecker.h index 39ccd1385..c7fad10e3 100644 --- a/logic/updater/UpdateChecker.h +++ b/logic/updater/UpdateChecker.h @@ -20,7 +20,9 @@ #include -class UpdateChecker : public QObject +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT UpdateChecker : public QObject { Q_OBJECT diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 238accf9d..d6487a654 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ # run the unit tests with `make test` find_package(Qt5 COMPONENTS Test Core Network) -include_directories(../logic) +include_directories(../logic ${CMAKE_CURRENT_BINARY_DIR}/../logic) include_directories(../depends/util/include/) unset(MultiMC_TESTS)