fix: tests failing
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "Engine/Operator/OperatorTable.h"
|
||||
#include <boost/dll/import.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -26,5 +27,18 @@ std::vector<enzo::op::OpInfo> enzo::op::OperatorTable::getData()
|
||||
return opInfoStore_;
|
||||
}
|
||||
|
||||
void enzo::op::OperatorTable::initPlugins()
|
||||
{
|
||||
static bool pluginsLoaded=false;
|
||||
if(pluginsLoaded) return;
|
||||
|
||||
auto initPlugin = boost::dll::import_symbol<void(enzo::op::addOperatorPtr)>(
|
||||
"build/src/OpDefs/libenzoOps1.so", "newSopOperator"
|
||||
);
|
||||
|
||||
initPlugin(enzo::op::OperatorTable::addOperator);
|
||||
|
||||
pluginsLoaded = true;
|
||||
}
|
||||
|
||||
std::vector<enzo::op::OpInfo> enzo::op::OperatorTable::opInfoStore_;
|
||||
|
||||
@@ -20,6 +20,8 @@ public:
|
||||
static void addOperator(const char* internalName, const char* displayName, nt::opConstructor ctorFunc);
|
||||
static nt::opConstructor getOpConstructor(std::string name);
|
||||
static std::vector<OpInfo> getData();
|
||||
// TODO: move to better spot (maybe engine class)
|
||||
static void initPlugins();
|
||||
private:
|
||||
static std::vector<OpInfo> opInfoStore_;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <QPushButton>
|
||||
#include <QSurfaceFormat>
|
||||
#include "Engine/Operator/OperatorTable.h"
|
||||
#include <boost/dll/import.hpp>
|
||||
|
||||
#include "Interface.h"
|
||||
|
||||
@@ -16,12 +15,7 @@ int main(int argc, char **argv)
|
||||
format.setSamples(4);
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
|
||||
// setup table
|
||||
auto initPlugin = boost::dll::import_symbol<void(enzo::op::addOperatorPtr)>(
|
||||
"build/src/OpDefs/libenzoOps1.so", "newSopOperator"
|
||||
);
|
||||
|
||||
initPlugin(enzo::op::OperatorTable::addOperator);
|
||||
enzo::op::OperatorTable::initPlugins();
|
||||
|
||||
|
||||
QApplication app (argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user