]> git.tdb.fi Git - libs/game.git/blobdiff - tools/builder-plugin/gameplugin.cpp
Create a builder plugin for the setup generator tool
[libs/game.git] / tools / builder-plugin / gameplugin.cpp
diff --git a/tools/builder-plugin/gameplugin.cpp b/tools/builder-plugin/gameplugin.cpp
new file mode 100644 (file)
index 0000000..7b01b20
--- /dev/null
@@ -0,0 +1,23 @@
+#include "gameplugin.h"
+#include <msp/builder/toolchain.h>
+#include "gametools.h"
+
+void GamePlugin::add_tools(Toolchain &toolchain, const Architecture &) const
+{
+       toolchain.add_toolchain(new GameTools(builder));
+}
+
+
+#if defined(_WIN32)
+#define GAMETOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define GAMETOOLS_API __attribute__((visibility("default")))
+#else
+#define GAMETOOLS_API
+#endif
+
+extern "C"
+GAMETOOLS_API Plugin *create_plugin(Builder &builder)
+{
+       return new GamePlugin(builder);
+}