From 3aeb6f6bfeaa6bd138d8e1dcbfe71addef26f43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 5 Feb 2023 20:04:45 -0300 Subject: [PATCH] Fix eepp windows build not exporting all symbols required for ecode. --- include/eepp/graphics/blendmode.hpp | 4 ++-- include/eepp/graphics/font.hpp | 2 +- include/eepp/graphics/glyphdrawable.hpp | 2 +- include/eepp/graphics/particlesystem.hpp | 2 +- include/eepp/graphics/pixeldensity.hpp | 2 +- include/eepp/graphics/texture.hpp | 6 +++--- include/eepp/graphics/vertexbufferhelper.hpp | 2 +- include/eepp/system/log.hpp | 2 +- include/eepp/ui/abstract/uiabstractview.hpp | 2 +- include/eepp/ui/border.hpp | 2 +- include/eepp/ui/css/propertydefinition.hpp | 6 +++--- include/eepp/ui/css/shorthanddefinition.hpp | 2 +- include/eepp/ui/css/stylesheetpropertyanimation.hpp | 2 +- include/eepp/ui/css/stylesheetstyle.hpp | 2 +- include/eepp/ui/doc/textdocument.hpp | 10 +++++----- include/eepp/ui/doc/undostack.hpp | 2 +- include/eepp/ui/models/filesystemmodel.hpp | 2 +- include/eepp/ui/models/model.hpp | 6 +++--- include/eepp/ui/models/modelrole.hpp | 2 +- include/eepp/ui/tools/uicodeeditorsplitter.hpp | 2 +- include/eepp/ui/uiclip.hpp | 2 +- include/eepp/ui/uihelper.hpp | 10 +++++----- include/eepp/ui/uipushbutton.hpp | 2 +- include/eepp/ui/uiscenenode.hpp | 2 +- include/eepp/ui/uitreeview.hpp | 2 +- include/eepp/window/window.hpp | 2 +- premake4.lua | 12 ++++++++++-- premake5.lua | 12 ++++++++++-- 28 files changed, 61 insertions(+), 45 deletions(-) diff --git a/include/eepp/graphics/blendmode.hpp b/include/eepp/graphics/blendmode.hpp index b6f7f1136..34c2d3857 100644 --- a/include/eepp/graphics/blendmode.hpp +++ b/include/eepp/graphics/blendmode.hpp @@ -8,7 +8,7 @@ namespace EE { namespace Graphics { class EE_API BlendMode { public: - enum class Factor { + enum class EE_API Factor { Zero, /// (0, 0, 0, 0) One, /// (1, 1, 1, 1) SrcColor, /// (src.r, src.g, src.b, src.a) @@ -21,7 +21,7 @@ class EE_API BlendMode { OneMinusDstAlpha /// (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a) }; - enum class Equation { + enum class EE_API Equation { Add, /// Pixel = Src * SrcFactor + Dst * DstFactor Subtract, /// Pixel = Src * SrcFactor - Dst * DstFactor ReverseSubtract /// Pixel = Dst * DstFactor - Src * SrcFactor diff --git a/include/eepp/graphics/font.hpp b/include/eepp/graphics/font.hpp index e25e5e7df..62ec13848 100644 --- a/include/eepp/graphics/font.hpp +++ b/include/eepp/graphics/font.hpp @@ -17,7 +17,7 @@ class EE_API Glyph { int rsbDelta{ 0 }; //!< Right offset after forced autohint. Internally used by getKerning() }; -enum class FontType { TTF, BMF, Sprite }; +enum class EE_API FontType { TTF, BMF, Sprite }; enum FontHorizontalAlign { TEXT_ALIGN_LEFT = ( 0 << 0 ), diff --git a/include/eepp/graphics/glyphdrawable.hpp b/include/eepp/graphics/glyphdrawable.hpp index e7785ec58..266310c6d 100644 --- a/include/eepp/graphics/glyphdrawable.hpp +++ b/include/eepp/graphics/glyphdrawable.hpp @@ -14,7 +14,7 @@ class EE_API GlyphDrawable : public DrawableResource { static GlyphDrawable* New( Texture* texture, const Rect& srcRect, const std::string& resourceName = "" ); - enum class DrawMode { + enum class EE_API DrawMode { Image, ///< It will be treated as a simple image, no special offset is applied. Text, ///< Will add the glyph offset corresponding to that character TextItalic ///< Will add the glyph offset corresponding to that character and simulate diff --git a/include/eepp/graphics/particlesystem.hpp b/include/eepp/graphics/particlesystem.hpp index 8ae22f780..a02002c76 100644 --- a/include/eepp/graphics/particlesystem.hpp +++ b/include/eepp/graphics/particlesystem.hpp @@ -14,7 +14,7 @@ class Texture; /** @enum EE::Graphics::ParticleEffect Predefined effects for the particle system. Use Callback when * wan't to create a new effect, o set the parameters using NoFx, but it's much more limited. */ -enum class ParticleEffect : Uint32 { +enum class EE_API ParticleEffect : Uint32 { Nofx = 0, //!< User defined effect BlueBall, Fire, diff --git a/include/eepp/graphics/pixeldensity.hpp b/include/eepp/graphics/pixeldensity.hpp index 0c89af055..6de987cf0 100644 --- a/include/eepp/graphics/pixeldensity.hpp +++ b/include/eepp/graphics/pixeldensity.hpp @@ -12,7 +12,7 @@ using namespace EE::Math; namespace EE { namespace Graphics { -enum class PixelDensitySize : Uint32 { +enum class EE_API PixelDensitySize : Uint32 { MDPI = 1, //!< 1dp = 1px HDPI = 2, //!< 1dp = 1.5px XHDPI = 3, //!< 1dp = 2px diff --git a/include/eepp/graphics/texture.hpp b/include/eepp/graphics/texture.hpp index 6a9123cab..7e529a27e 100644 --- a/include/eepp/graphics/texture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -13,15 +13,15 @@ namespace EE { namespace Graphics { class EE_API Texture : public DrawableResource, public Image, private NonCopyable { public: /** @enum TextureFilter Defines the texture filter used. */ - enum class Filter : Uint32 { + enum class EE_API Filter : Uint32 { Linear, //!< Linear filtering (Smoothed Zoom) Nearest //!< No filtering (Pixeled Zoom) }; /** @enum ClampMode Set the clamp mode of the texture. */ - enum class ClampMode : Uint32 { ClampToEdge, ClampRepeat }; + enum class EE_API ClampMode : Uint32 { ClampToEdge, ClampRepeat }; - enum class CoordinateType : Uint32 { + enum class EE_API CoordinateType : Uint32 { Normalized, ///< Texture coordinates in range [0 .. 1] Pixels ///< Texture coordinates in range [0 .. size] }; diff --git a/include/eepp/graphics/vertexbufferhelper.hpp b/include/eepp/graphics/vertexbufferhelper.hpp index 3486e9816..f38e00af9 100644 --- a/include/eepp/graphics/vertexbufferhelper.hpp +++ b/include/eepp/graphics/vertexbufferhelper.hpp @@ -4,7 +4,7 @@ namespace EE { namespace Graphics { /// VBO default usage type -enum class VertexBufferUsageType : int { +enum class EE_API VertexBufferUsageType : int { Static, Dynamic, Stream, diff --git a/include/eepp/system/log.hpp b/include/eepp/system/log.hpp index 737df276c..3ec760c4a 100644 --- a/include/eepp/system/log.hpp +++ b/include/eepp/system/log.hpp @@ -17,7 +17,7 @@ class LogReaderInterface { virtual void writeLog( const std::string& Text ) = 0; }; -enum class LogLevel : int { +enum class EE_API LogLevel : int { Debug, ///< Detailed debug information. Info, ///< Interesting events in your application. Notice, ///< Normal, but significant events in your application. diff --git a/include/eepp/ui/abstract/uiabstractview.hpp b/include/eepp/ui/abstract/uiabstractview.hpp index 51f013189..7e825d7ab 100644 --- a/include/eepp/ui/abstract/uiabstractview.hpp +++ b/include/eepp/ui/abstract/uiabstractview.hpp @@ -11,7 +11,7 @@ using namespace EE::UI::Models; namespace EE { namespace UI { namespace Abstract { -enum class ModelEventType { Open, OpenTree, CloseTree, OpenMenu }; +enum class EE_API ModelEventType { Open, OpenTree, CloseTree, OpenMenu }; class EE_API ModelEvent : public Event { public: diff --git a/include/eepp/ui/border.hpp b/include/eepp/ui/border.hpp index 7d378c0be..d87a45a26 100644 --- a/include/eepp/ui/border.hpp +++ b/include/eepp/ui/border.hpp @@ -15,7 +15,7 @@ using namespace EE::Math; namespace EE { namespace UI { class UINode; -enum class BorderType : Uint32 { Inside, Outside, Outline }; +enum class EE_API BorderType : Uint32 { Inside, Outside, Outline }; struct EE_API Border { int width = 0; diff --git a/include/eepp/ui/css/propertydefinition.hpp b/include/eepp/ui/css/propertydefinition.hpp index 4909f7959..7f2e88e37 100644 --- a/include/eepp/ui/css/propertydefinition.hpp +++ b/include/eepp/ui/css/propertydefinition.hpp @@ -6,7 +6,7 @@ namespace EE { namespace UI { namespace CSS { -enum class PropertyId : Uint32 { +enum class EE_API PropertyId : Uint32 { Id = String::hash( "id" ), Class = String::hash( "class" ), X = String::hash( "x" ), @@ -209,7 +209,7 @@ enum class PropertyId : Uint32 { GravityOwner = String::hash( "gravity-owner" ), }; -enum class PropertyType : Uint32 { +enum class EE_API PropertyType : Uint32 { Undefined, String, Bool, @@ -227,7 +227,7 @@ enum class PropertyType : Uint32 { Time }; -enum class PropertyRelativeTarget : Uint32 { +enum class EE_API PropertyRelativeTarget : Uint32 { None, ContainingBlockWidth, ContainingBlockHeight, diff --git a/include/eepp/ui/css/shorthanddefinition.hpp b/include/eepp/ui/css/shorthanddefinition.hpp index 4a283d587..fe4720dc7 100644 --- a/include/eepp/ui/css/shorthanddefinition.hpp +++ b/include/eepp/ui/css/shorthanddefinition.hpp @@ -8,7 +8,7 @@ namespace EE { namespace UI { namespace CSS { -enum class ShorthandId : Uint32 { +enum class EE_API ShorthandId : Uint32 { Margin = String::hash( "margin" ), Padding = String::hash( "padding" ), Transition = String::hash( "transition" ), diff --git a/include/eepp/ui/css/stylesheetpropertyanimation.hpp b/include/eepp/ui/css/stylesheetpropertyanimation.hpp index 20873f942..df282a154 100644 --- a/include/eepp/ui/css/stylesheetpropertyanimation.hpp +++ b/include/eepp/ui/css/stylesheetpropertyanimation.hpp @@ -16,7 +16,7 @@ class UIWidget; namespace EE { namespace UI { namespace CSS { -enum class AnimationOrigin : uint8_t { User, Animation, Transition }; +enum class EE_API AnimationOrigin : uint8_t { User, Animation, Transition }; class EE_API StyleSheetPropertyAnimation : public Action { public: diff --git a/include/eepp/ui/css/stylesheetstyle.hpp b/include/eepp/ui/css/stylesheetstyle.hpp index 2ba0f5c37..8fdbd9d76 100644 --- a/include/eepp/ui/css/stylesheetstyle.hpp +++ b/include/eepp/ui/css/stylesheetstyle.hpp @@ -9,7 +9,7 @@ namespace EE { namespace UI { namespace CSS { -enum class AtRuleType : Uint32 { None, FontFace }; +enum class EE_API AtRuleType : Uint32 { None, FontFace }; class EE_API StyleSheetStyle { public: diff --git a/include/eepp/ui/doc/textdocument.hpp b/include/eepp/ui/doc/textdocument.hpp index 12c370688..676746ca9 100644 --- a/include/eepp/ui/doc/textdocument.hpp +++ b/include/eepp/ui/doc/textdocument.hpp @@ -35,15 +35,15 @@ class EE_API TextDocument { public: typedef std::function DocumentCommand; - enum class UndoRedo { Undo, Redo }; + enum class EE_API UndoRedo { Undo, Redo }; - enum class IndentType { IndentSpaces, IndentTabs }; + enum class EE_API IndentType { IndentSpaces, IndentTabs }; - enum class LineEnding { LF, CRLF, CR }; + enum class EE_API LineEnding { LF, CRLF, CR }; - enum class FindReplaceType { Normal, LuaPattern }; + enum class EE_API FindReplaceType { Normal, LuaPattern }; - enum class LoadStatus { Loaded, Interrupted, Failed }; + enum class EE_API LoadStatus { Loaded, Interrupted, Failed }; static std::string lineEndingToString( const LineEnding& le ) { switch ( le ) { diff --git a/include/eepp/ui/doc/undostack.hpp b/include/eepp/ui/doc/undostack.hpp index 0774ed6a7..18c1d9294 100644 --- a/include/eepp/ui/doc/undostack.hpp +++ b/include/eepp/ui/doc/undostack.hpp @@ -14,7 +14,7 @@ namespace EE { namespace UI { namespace Doc { class TextDocument; -enum class TextUndoCommandType { Insert, Remove, Selection }; +enum class EE_API TextUndoCommandType { Insert, Remove, Selection }; class EE_API TextUndoCommand { public: diff --git a/include/eepp/ui/models/filesystemmodel.hpp b/include/eepp/ui/models/filesystemmodel.hpp index c387b9f2d..27619f38d 100644 --- a/include/eepp/ui/models/filesystemmodel.hpp +++ b/include/eepp/ui/models/filesystemmodel.hpp @@ -33,7 +33,7 @@ struct FileEvent { class EE_API FileSystemModel : public Model { public: - enum class Mode { DirectoriesOnly, FilesAndDirectories }; + enum class EE_API Mode { DirectoriesOnly, FilesAndDirectories }; struct DisplayConfig { DisplayConfig() {} diff --git a/include/eepp/ui/models/model.hpp b/include/eepp/ui/models/model.hpp index 161f1068c..f66bbb32f 100644 --- a/include/eepp/ui/models/model.hpp +++ b/include/eepp/ui/models/model.hpp @@ -25,7 +25,7 @@ namespace EE { namespace UI { namespace Models { class PersistentHandle; -enum class SortOrder { None, Ascending, Descending }; +enum class EE_API SortOrder { None, Ascending, Descending }; class EE_API Model { public: @@ -152,8 +152,8 @@ class EE_API Model { ModelIndex createIndex( int row, int column, const void* data = nullptr, const Int64& internalId = 0 ) const; - enum class OperationType { Invalid = 0, Insert, Move, Delete, Reset }; - enum class Direction { Row, Column }; + enum class EE_API OperationType { Invalid = 0, Insert, Move, Delete, Reset }; + enum class EE_API Direction { Row, Column }; struct Operation { OperationType type{ OperationType::Invalid }; diff --git a/include/eepp/ui/models/modelrole.hpp b/include/eepp/ui/models/modelrole.hpp index 8f6853027..2f0964214 100644 --- a/include/eepp/ui/models/modelrole.hpp +++ b/include/eepp/ui/models/modelrole.hpp @@ -3,7 +3,7 @@ namespace EE { namespace UI { namespace Models { -enum class ModelRole { Display, Icon, Sort, Custom }; +enum class EE_API ModelRole { Display, Icon, Sort, Custom }; }}} // namespace EE::UI::Models diff --git a/include/eepp/ui/tools/uicodeeditorsplitter.hpp b/include/eepp/ui/tools/uicodeeditorsplitter.hpp index 46206ed84..0e6b5e356 100644 --- a/include/eepp/ui/tools/uicodeeditorsplitter.hpp +++ b/include/eepp/ui/tools/uicodeeditorsplitter.hpp @@ -17,7 +17,7 @@ class EE_API UICodeEditorSplitter { static const std::map getLocalDefaultKeybindings(); - enum class SplitDirection { Left, Right, Top, Bottom }; + enum class EE_API SplitDirection { Left, Right, Top, Bottom }; class EE_API Client { public: diff --git a/include/eepp/ui/uiclip.hpp b/include/eepp/ui/uiclip.hpp index b89f40467..35ed10592 100644 --- a/include/eepp/ui/uiclip.hpp +++ b/include/eepp/ui/uiclip.hpp @@ -6,7 +6,7 @@ namespace EE { namespace UI { -enum class ClipType : Uint32 { None, ContentBox, PaddingBox, BorderBox }; +enum class EE_API ClipType : Uint32 { None, ContentBox, PaddingBox, BorderBox }; class UIClip { public: diff --git a/include/eepp/ui/uihelper.hpp b/include/eepp/ui/uihelper.hpp index 973ec90e9..f46f41365 100644 --- a/include/eepp/ui/uihelper.hpp +++ b/include/eepp/ui/uihelper.hpp @@ -105,15 +105,15 @@ enum UINodeType { UI_TYPE_USER = 100000 }; -enum class ScrollBarMode : Uint32 { Auto, AlwaysOn, AlwaysOff }; +enum class EE_API ScrollBarMode : Uint32 { Auto, AlwaysOn, AlwaysOff }; -enum class UIOrientation : Uint32 { Vertical, Horizontal }; +enum class EE_API UIOrientation : Uint32 { Vertical, Horizontal }; -enum class SizePolicy : Uint32 { Fixed, MatchParent, WrapContent }; +enum class EE_API SizePolicy : Uint32 { Fixed, MatchParent, WrapContent }; -enum class PositionPolicy : Uint32 { None, LeftOf, RightOf, TopOf, BottomOf }; +enum class EE_API PositionPolicy : Uint32 { None, LeftOf, RightOf, TopOf, BottomOf }; -enum class UIScaleType : Uint32 { None, Expand, FitInside }; +enum class EE_API UIScaleType : Uint32 { None, Expand, FitInside }; static const Uint32 UI_NODE_DEFAULT_ALIGN = UI_HALIGN_LEFT | UI_VALIGN_CENTER; diff --git a/include/eepp/ui/uipushbutton.hpp b/include/eepp/ui/uipushbutton.hpp index 408763d53..4c764bb53 100644 --- a/include/eepp/ui/uipushbutton.hpp +++ b/include/eepp/ui/uipushbutton.hpp @@ -7,7 +7,7 @@ namespace EE { namespace UI { -enum class InnerWidgetOrientation { Left, Right, Center }; +enum class EE_API InnerWidgetOrientation { Left, Right, Center }; class EE_API UIPushButton : public UIWidget { public: diff --git a/include/eepp/ui/uiscenenode.hpp b/include/eepp/ui/uiscenenode.hpp index a23c97ada..0fe43da88 100644 --- a/include/eepp/ui/uiscenenode.hpp +++ b/include/eepp/ui/uiscenenode.hpp @@ -22,7 +22,7 @@ class UIWidget; class UILayout; class UIIcon; -enum class ColorSchemePreference { Light, Dark }; +enum class EE_API ColorSchemePreference { Light, Dark }; class EE_API UISceneNode : public SceneNode { public: diff --git a/include/eepp/ui/uitreeview.hpp b/include/eepp/ui/uitreeview.hpp index 0ec12ba70..c999f1f62 100644 --- a/include/eepp/ui/uitreeview.hpp +++ b/include/eepp/ui/uitreeview.hpp @@ -145,7 +145,7 @@ class EE_API UITreeView : public UIAbstractTableView { void updateContentSize(); protected: - enum class IterationDecision { + enum class EE_API IterationDecision { Continue, Break, Stop, diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 3520a943c..ddb27500d 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -29,7 +29,7 @@ enum WindowStyle { #endif }; -enum class WindowBackend : Uint32 { SDL2, Default }; +enum class EE_API WindowBackend : Uint32 { SDL2, Default }; #ifndef EE_SCREEN_KEYBOARD_ENABLED #if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS diff --git a/premake4.lua b/premake4.lua index 9ed357799..92e20b6ff 100644 --- a/premake4.lua +++ b/premake4.lua @@ -232,9 +232,17 @@ function postsymlinklib(src_path, dst_path, lib) return end configuration { "release", "windows" } - postbuildcommands { "mklink \"" .. dst_path .. lib .. ".dll\"" .. " \"" .. src_path .. lib .. ".dll\" || ver>nul" } + if os.is("windows") then + postbuildcommands { "mklink \"" .. dst_path .. lib .. ".dll\"" .. " \"" .. src_path .. lib .. ".dll\" || ver>nul" } + else + postbuildcommands { "ln -sf \"" .. src_path .. "lib" .. lib .. "." .. get_dll_extension() .. "\" \"" .. dst_path .. "\"" } + end configuration { "debug", "windows" } - postbuildcommands { "mklink \"" .. dst_path .. lib .. "-debug.dll\"" .. " \"" .. src_path .. lib .. "-debug.dll\" || ver>nul" } + if os.is("windows") then + postbuildcommands { "mklink \"" .. dst_path .. lib .. "-debug.dll\"" .. " \"" .. src_path .. lib .. "-debug.dll\" || ver>nul" } + else + postbuildcommands { "ln -sf \"" .. src_path .. "lib" .. lib .. "-debug." .. get_dll_extension() .. "\" \"" .. dst_path .. "\"" } + end configuration { "release", "not windows" } postbuildcommands { "ln -sf \"" .. src_path .. "lib" .. lib .. "." .. get_dll_extension() .. "\" \"" .. dst_path .. "\"" } configuration { "debug", "not windows" } diff --git a/premake5.lua b/premake5.lua index 00e99609d..71bd8c84d 100644 --- a/premake5.lua +++ b/premake5.lua @@ -32,9 +32,17 @@ end function postsymlinklib(src_path, dst_path, lib) filter { "configurations:release*", "system:windows" } - postbuildcommands { "mklink \"" .. dst_path .. lib .. ".dll\"" .. " \"" .. src_path .. lib .. ".dll\" || ver>nul" } + if os.ishost("windows") then + postbuildcommands { "mklink \"" .. dst_path .. lib .. ".dll\"" .. " \"" .. src_path .. lib .. ".dll\" || ver>nul" } + else + postbuildcommands { "ln -sf \"" .. src_path .. "lib" .. lib .. "." .. get_dll_extension() .. "\" \"" .. dst_path .. "\"" } + end filter { "configurations:debug*", "system:windows" } - postbuildcommands { "mklink \"" .. dst_path .. lib .. "-debug.dll\"" .. " \"" .. src_path .. lib .. "-debug.dll\" || ver>nul" } + if os.ishost("windows") then + postbuildcommands { "mklink \"" .. dst_path .. lib .. "-debug.dll\"" .. " \"" .. src_path .. lib .. "-debug.dll\" || ver>nul" } + else + postbuildcommands { "ln -sf \"" .. src_path .. "lib" .. lib .. "-debug." .. get_dll_extension() .. "\" \"" .. dst_path .. "\"" } + end filter { "configurations:release*", "not system:windows" } postbuildcommands { "ln -sf \"" .. src_path .. "lib" .. lib .. "." .. get_dll_extension() .. "\" \"" .. dst_path .. "\"" } filter { "configurations:debug*", "not system:windows" }