Fix MSVC dll building
This commit is contained in:
@@ -70,6 +70,7 @@ if(${PD_BUILD_SHARED})
|
||||
target_compile_definitions(palladium PRIVATE -DPD_BUILD_SHARED)
|
||||
else()
|
||||
add_library(palladium STATIC ${PD_SOURCES})
|
||||
target_compile_definitions(palladium PUBLIC -DPD_BUILD_STATIC)
|
||||
endif()
|
||||
|
||||
target_include_directories(palladium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
@@ -82,12 +83,10 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
||||
)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
target_compile_options(palladium PRIVATE
|
||||
$<$<CONFIG:Debug>:-O0 -g>
|
||||
$<$<CONFIG:Release>:-O3>
|
||||
)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include DESTINATION ".")
|
||||
install(TARGETS palladium)
|
||||
|
||||
@@ -83,7 +83,8 @@ constexpr static KbKey Kb_F11 = KbKey::Flag(47);
|
||||
constexpr static KbKey Kb_F12 = KbKey::Flag(48);
|
||||
constexpr static KbKey Kb_MouseLeft = KbKey::Flag(120);
|
||||
} // namespace HidKb
|
||||
class HidDriver {
|
||||
|
||||
class PD_API HidDriver {
|
||||
public:
|
||||
enum Flags : u32 {
|
||||
Flags_None = 0,
|
||||
|
||||
@@ -91,7 +91,7 @@ class PD_API DrawList {
|
||||
void SetFontScale(float scale) { pFontScale = scale; }
|
||||
|
||||
void DrawSolid();
|
||||
void DrawTexture(Texture::Ref tex) { CurrentTex = tex; }
|
||||
void DrawTexture(Texture::Ref tex);
|
||||
|
||||
// SECTION: Draw API //
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
/** Generated with ppam */
|
||||
|
||||
#ifndef PD_BUILD_STATIC
|
||||
#ifdef _WIN32 // Windows (MSVC Tested)
|
||||
#ifdef PD_BUILD_SHARED
|
||||
#define PD_API __declspec(dllexport)
|
||||
@@ -49,3 +49,6 @@ SOFTWARE.
|
||||
#else
|
||||
#define PD_API
|
||||
#endif
|
||||
#else
|
||||
#define PD_API
|
||||
#endif
|
||||
|
||||
@@ -34,6 +34,7 @@ SOFTWARE.
|
||||
|
||||
namespace PD {
|
||||
namespace UI7 {
|
||||
class Context;
|
||||
class PD_API Layout {
|
||||
public:
|
||||
Layout(const ID& id, IO::Ref io) : ID(id) {
|
||||
@@ -172,7 +173,7 @@ class PD_API Layout {
|
||||
|
||||
private:
|
||||
friend class Menu;
|
||||
friend class Context;
|
||||
friend class PD::UI7::Context;
|
||||
friend class ReMenu;
|
||||
// Base Components
|
||||
UI7::ID ID;
|
||||
|
||||
@@ -24,13 +24,13 @@ SOFTWARE.
|
||||
#include <pd/drivers/hid.hpp>
|
||||
|
||||
namespace PD {
|
||||
bool HidDriver::IsEvent(Event e, Key keys) { return KeyEvents[0][e] & keys; }
|
||||
PD_API bool HidDriver::IsEvent(Event e, Key keys) { return KeyEvents[0][e] & keys; }
|
||||
|
||||
bool HidDriver::IsEvent(Event e, KbKey keys) {
|
||||
PD_API bool HidDriver::IsEvent(Event e, KbKey keys) {
|
||||
return KbKeyEvents[0][e].Has(keys);
|
||||
}
|
||||
|
||||
void HidDriver::SwapTab() {
|
||||
PD_API void HidDriver::SwapTab() {
|
||||
auto tkd = KeyEvents[1][Event_Down];
|
||||
auto tkh = KeyEvents[1][Event_Held];
|
||||
auto tku = KeyEvents[1][Event_Up];
|
||||
@@ -46,7 +46,7 @@ void HidDriver::SwapTab() {
|
||||
* If this func has no verride, still clear the stats
|
||||
* cause if they are empty this leads to a crash
|
||||
*/
|
||||
void HidDriver::Update() {
|
||||
PD_API void HidDriver::Update() {
|
||||
// Clear States
|
||||
for (int i = 0; i < 2; i++) {
|
||||
KeyEvents[i][Event_Down] = 0;
|
||||
|
||||
@@ -306,5 +306,7 @@ PD_API void DrawList::DrawLine(const fvec2& a, const fvec2& b, u32 color,
|
||||
PathAdd(b);
|
||||
PathStroke(color, t);
|
||||
}
|
||||
|
||||
PD_API void DrawList::DrawTexture(Texture::Ref tex) { CurrentTex = tex; }
|
||||
} // namespace Li
|
||||
} // namespace PD
|
||||
|
||||
Reference in New Issue
Block a user