#INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
SET_SOURCE_FILES_PROPERTIES(src/bindings/guile/frida.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE(frida-guile guile src/bindings/guile/frida.i)
-SWIG_LINK_LIBRARIES(frida-guile)
+SWIG_LINK_LIBRARIES(frida-guile ${GUILE_LDFLAGS})
#################
#################
SET(frida_SOURCES
- src/bindings/Guile.cxx
src/core/InformationManager.cxx
src/core/BasicBlock.cxx
src/core/Function.cxx
qt5_use_modules(frida Widgets)
-TARGET_LINK_LIBRARIES(frida ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} ${QUAZIP_LIBRARIES})
+TARGET_LINK_LIBRARIES(frida
+ ${QT_LIBRARIES}
+ ${LLVM_LDFLAGS}
+ -lLLVM-3.5
+ ${LLVM_SYSTEM_LIBS}
+ ${LOG4CXX_LDFLAGS}
+ ${QUAZIP_LIBRARIES})
+
+
+###########
+# Plugins #
+###########
+
+# GUILE
+
+set(plugin_guile_SOURCES
+ src/bindings/Interpreter.cxx
+ src/bindings/Guile.cxx)
+
+set(plugin_guile_HEADERS
+ src/bindings/Interpreter.hxx
+ src/bindings/Guile.hxx)
+
+add_library(guilePlugin MODULE ${plugin_guile_SOURCES} ${plugin_guile_HEADERS_MOC})
+qt5_use_modules(guilePlugin Core)
+target_link_libraries(guilePlugin ${QT_LIBRARIES} ${GUILE_LDFLAGS})
##################
# TEST Framework #
#include "Interpreter.hxx"
-class GuileInterpreter : public Interpreter {
+class GuileInterpreter : public QObject, public Interpreter {
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "xyz.frida.Interpreter")
+ Q_INTERFACES(Interpreter)
public:
GuileInterpreter();
#include <string>
#include <sstream>
+#include <QtPlugin>
class Interpreter {
public:
private:
};
+Q_DECLARE_INTERFACE(Interpreter, "xyz.frida.Interpreter")
+
#endif /* INCLUDE__Interpreter_hxx_ */
QMenu* interpretermenu = menuBar()->addMenu(tr("&Interpreter"));
- interpreter["GUILE"] = new GuileInterpreter;
+ QPluginLoader* loader = new QPluginLoader("libguilePlugin", this);
+ if (!loader->load())
+ LOG4CXX_ERROR(logger, "Loading plugin failed: " << loader->errorString().toStdString());
+ interpreter["GUILE"] = qobject_cast<Interpreter*>(loader->instance());
scripting = new ScriptingDock(interpreter["GUILE"], tr("Scripting"), this);
scripting->setAllowedAreas(Qt::BottomDockWidgetArea);
addDockWidget(Qt::BottomDockWidgetArea, scripting);
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QApplication>
+#include <QPluginLoader>
#endif /* INCLUDE__qt_hxx_ */