Modules are static by default
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src \
|
-I src \
|
||||||
-Wall \
|
-Wall \
|
||||||
|
-DTESTMENU_DYNAMIC \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -42,6 +43,7 @@
|
|||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src -I include \
|
-I src -I include \
|
||||||
-Wall \
|
-Wall \
|
||||||
|
-DPRINT_DYNAMIC \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -68,6 +70,7 @@
|
|||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src -I include \
|
-I src -I include \
|
||||||
-Wall \
|
-Wall \
|
||||||
|
-DDEPENDSONPRINT_DYNAMIC \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
modules/examples/Modules/Print/src/*.cpp \
|
modules/examples/Modules/Print/src/*.cpp \
|
||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src -I include -I . \
|
-I src -I include -I . \
|
||||||
-DPRINT_STATIC \
|
-DDEPENDSONPRINTSTATIC_DYNAMIC \
|
||||||
-Wall \
|
-Wall \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
@@ -133,7 +136,7 @@
|
|||||||
-DRENDERER_OPENGL \
|
-DRENDERER_OPENGL \
|
||||||
-DWINDOW_GLFW \
|
-DWINDOW_GLFW \
|
||||||
-DGUIMODULE \
|
-DGUIMODULE \
|
||||||
-DWINDOWMODULE_STATIC \
|
-DTESTIMGUI_DYNAMIC \
|
||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src -I include -I $imgui -I . \
|
-I src -I include -I $imgui -I . \
|
||||||
-lGL -lglfw -lGLEW \
|
-lGL -lglfw -lGLEW \
|
||||||
@@ -167,6 +170,7 @@
|
|||||||
-I src -I include \
|
-I src -I include \
|
||||||
-DRENDERER_OPENGL \
|
-DRENDERER_OPENGL \
|
||||||
-DWINDOW_GLFW \
|
-DWINDOW_GLFW \
|
||||||
|
-DTESTCLAY_DYNAMIC \
|
||||||
-Wall \
|
-Wall \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
#include "utils/Module/Module.h"
|
#include "utils/Module/Module.h"
|
||||||
|
|
||||||
#ifndef WINDOWMODULE_STATIC
|
|
||||||
#define WINDOWMODULE_STATIC
|
|
||||||
#endif
|
|
||||||
#include "modules/WindowModule/src/WindowModule.h"
|
#include "modules/WindowModule/src/WindowModule.h"
|
||||||
|
|
||||||
namespace Archimedes {
|
namespace Archimedes {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class WindowModule : public Archimedes::Module {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifndef WINDOWMODULE_STATIC
|
#ifdef WINDOWMODULE_DYNAMIC
|
||||||
#define MODULE_TYPE WindowModule
|
#define MODULE_TYPE WindowModule
|
||||||
#include "endModule.h"
|
#include "endModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class TestImgui : public Archimedes::GuiModule {
|
|||||||
Archimedes::Window* window;
|
Archimedes::Window* window;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef TESTIMGUI_STATIC
|
#ifdef TESTIMGUI_DYNAMIC
|
||||||
#define MODULE_TYPE TestImgui
|
#define MODULE_TYPE TestImgui
|
||||||
#include "endModule.h"
|
#include "endModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ DependsOnPrint::~DependsOnPrint() {
|
|||||||
|
|
||||||
void DependsOnPrint::run() {
|
void DependsOnPrint::run() {
|
||||||
std::cout << "DependsOnPrint lib loaded and run!\n";
|
std::cout << "DependsOnPrint lib loaded and run!\n";
|
||||||
app->stopModule(self);
|
app->stopModule(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class DependsOnPrint : public Archimedes::Module {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef DEPENDSONPRINT_STATIC
|
#ifdef DEPENDSONPRINT_DYNAMIC
|
||||||
#define MODULE_TYPE DependsOnPrint
|
#define MODULE_TYPE DependsOnPrint
|
||||||
#include "endModule.h"
|
#include "endModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "DependsOnPrintStatic.h"
|
#include "DependsOnPrintStatic.h"
|
||||||
#include "modules/Print/src/Print.h"
|
|
||||||
|
#include "modules/examples/Modules/Print/src/Print.h"
|
||||||
|
|
||||||
DependsOnPrintStatic::DependsOnPrintStatic(void* h, Archimedes::App* a) : Module(h, a) {
|
DependsOnPrintStatic::DependsOnPrintStatic(void* h, Archimedes::App* a) : Module(h, a) {
|
||||||
name = "DependsOnPrintStatic";
|
name = "DependsOnPrintStatic";
|
||||||
@@ -13,5 +14,5 @@ DependsOnPrintStatic::~DependsOnPrintStatic() {
|
|||||||
|
|
||||||
void DependsOnPrintStatic::run() {
|
void DependsOnPrintStatic::run() {
|
||||||
std::cout << "DependsOnPrintStatic lib loaded and run!\n";
|
std::cout << "DependsOnPrintStatic lib loaded and run!\n";
|
||||||
app->stopModule(self);
|
app->stopModule(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class DependsOnPrintStatic : public Archimedes::Module {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef DEPENDSONPRINTSTATIC_STATIC
|
#ifdef DEPENDSONPRINTSTATIC_DYNAMIC
|
||||||
#define MODULE_TYPE DependsOnPrintStatic
|
#define MODULE_TYPE DependsOnPrintStatic
|
||||||
#include "endModule.h"
|
#include "endModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ Print::~Print() {
|
|||||||
void Print::run() {
|
void Print::run() {
|
||||||
std::cout << "Print lib loaded and run!\n";
|
std::cout << "Print lib loaded and run!\n";
|
||||||
|
|
||||||
app->stopModule(self);
|
app->stopModule(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Print : public Archimedes::Module {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef PRINT_STATIC
|
#ifdef PRINT_DYNAMIC
|
||||||
#define MODULE_TYPE Print
|
#define MODULE_TYPE Print
|
||||||
#include "endModule.h"
|
#include "endModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "TestMenu.h"
|
#include "TestMenu.h"
|
||||||
|
|
||||||
TestMenu::TestMenu(void* h, App& a) : Module(h, a) {
|
TestMenu::TestMenu(void* h, Archimedes::App* a) : Module(h, a) {
|
||||||
name = "TestMenu";
|
name = "TestMenu";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,10 +26,10 @@ void TestMenu::run() {
|
|||||||
num--;
|
num--;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
app.stopModule(self);
|
app->stopModule(name);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
app.end();
|
app->end();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "Archimedes.h"
|
#include "Archimedes.h"
|
||||||
|
|
||||||
class TestMenu : public Module {
|
class TestMenu : public Archimedes::Module {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestMenu(void*, App&);
|
TestMenu(void*, Archimedes::App*);
|
||||||
~TestMenu();
|
~TestMenu();
|
||||||
void run();
|
void run();
|
||||||
void onLoad() {}
|
void onLoad() {}
|
||||||
@@ -13,8 +13,7 @@ class TestMenu : public Module {
|
|||||||
int num = 5;
|
int num = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" {
|
#ifdef TESTMENU_DYNAMIC
|
||||||
Module* create(void* handle, App& app) {
|
#define MODULE_TYPE TestMenu
|
||||||
return new TestMenu(handle, app);
|
#include "endModule.h"
|
||||||
}
|
#endif
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user