diff --git a/CMakeLists.txt b/CMakeLists.txt index cd0c6e3e..f6045ed4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ endif() list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) +include(GenerateExportHeader) include(address_sanitizer) set(NOSTALGIA_CONAN_PATHS ${CMAKE_SOURCE_DIR}/conanbuild/conan_paths.cmake) diff --git a/src/nostalgia/core/studio/tilesheeteditor.cpp b/src/nostalgia/core/studio/tilesheeteditor.cpp index eca45c9a..4fd08fa3 100644 --- a/src/nostalgia/core/studio/tilesheeteditor.cpp +++ b/src/nostalgia/core/studio/tilesheeteditor.cpp @@ -67,7 +67,7 @@ class UpdatePixelsCommand: public QUndoCommand { return item < o.item; } - operator auto() const { + operator quint64() const { return reinterpret_cast(item.data()); } }; diff --git a/src/nostalgia/studio/lib/CMakeLists.txt b/src/nostalgia/studio/lib/CMakeLists.txt index a681330f..da9f37d0 100644 --- a/src/nostalgia/studio/lib/CMakeLists.txt +++ b/src/nostalgia/studio/lib/CMakeLists.txt @@ -14,6 +14,9 @@ add_library( install(TARGETS NostalgiaStudio LIBRARY DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia) +generate_export_header(NostalgiaStudio) +target_include_directories(NostalgiaStudio PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries( NostalgiaStudio PUBLIC Qt5::Widgets @@ -31,6 +34,7 @@ install( wizard.hpp plugin.hpp project.hpp + ${PROJECT_BINARY_DIR}/nostalgiastudio_export.h DESTINATION include/nostalgia/studio/lib ) diff --git a/src/nostalgia/studio/lib/editor.hpp b/src/nostalgia/studio/lib/editor.hpp index afd17754..fbebb81b 100644 --- a/src/nostalgia/studio/lib/editor.hpp +++ b/src/nostalgia/studio/lib/editor.hpp @@ -11,9 +11,11 @@ #include #include +#include "nostalgiastudio_export.h" + namespace nostalgia::studio { -class Editor: public QWidget { +class NOSTALGIASTUDIO_EXPORT Editor: public QWidget { Q_OBJECT public: diff --git a/src/nostalgia/studio/lib/project.hpp b/src/nostalgia/studio/lib/project.hpp index e9da57c9..04600d03 100644 --- a/src/nostalgia/studio/lib/project.hpp +++ b/src/nostalgia/studio/lib/project.hpp @@ -15,9 +15,11 @@ #include #include +#include "nostalgiastudio_export.h" + namespace nostalgia::studio { -class Project: public QObject { +class NOSTALGIASTUDIO_EXPORT Project: public QObject { Q_OBJECT private: diff --git a/src/nostalgia/studio/lib/wizard.cpp b/src/nostalgia/studio/lib/wizard.cpp index 51ab4146..4f3a3a67 100644 --- a/src/nostalgia/studio/lib/wizard.cpp +++ b/src/nostalgia/studio/lib/wizard.cpp @@ -55,7 +55,7 @@ bool WizardSelect::isComplete() const { void WizardSelect::itemSelected(int row) { auto w = dynamic_cast(wizard()); - if (w and row > -1) { + if (w && row > -1) { // remove other pages while (nextId() > -1) { w->removePage(nextId()); diff --git a/src/nostalgia/studio/lib/wizard.hpp b/src/nostalgia/studio/lib/wizard.hpp index de6f0e2b..0f78c860 100644 --- a/src/nostalgia/studio/lib/wizard.hpp +++ b/src/nostalgia/studio/lib/wizard.hpp @@ -21,15 +21,17 @@ #include #include +#include "nostalgiastudio_export.h" + namespace nostalgia::studio { -struct WizardMaker { +struct NOSTALGIASTUDIO_EXPORT WizardMaker { QString name; std::function()> make; std::function onAccept = [](QWizard*) { return 0; }; }; -class WizardSelect: public QWizardPage { +class NOSTALGIASTUDIO_EXPORT WizardSelect: public QWizardPage { Q_OBJECT private: @@ -56,7 +58,7 @@ class WizardSelect: public QWizardPage { }; -class WizardFormPage: public QWizardPage { +class NOSTALGIASTUDIO_EXPORT WizardFormPage: public QWizardPage { Q_OBJECT private: @@ -103,7 +105,7 @@ class WizardFormPage: public QWizardPage { }; -class WizardConclusionPage: public QWizardPage { +class NOSTALGIASTUDIO_EXPORT WizardConclusionPage: public QWizardPage { Q_OBJECT private: QString m_baseMsg = ""; @@ -119,7 +121,7 @@ class WizardConclusionPage: public QWizardPage { }; -class Wizard: public QWizard { +class NOSTALGIASTUDIO_EXPORT Wizard: public QWizard { Q_OBJECT private: std::function m_acceptFunc;