]> git.tdb.fi Git - builder.git/blob - plugins/base/baseplugin.cpp
Move the VS project and solution generators to the MSVC plugin
[builder.git] / plugins / base / baseplugin.cpp
1 #include <msp/builder/builder.h>
2 #include <msp/builder/tool.h>
3 #include "baseplugin.h"
4 #include "basetools.h"
5 #include "compilecommandsjson.h"
6 #include "pkgconfigfile.h"
7
8 void BasePlugin::add_tools(Toolchain &toolchain, const Architecture &) const
9 {
10         toolchain.add_toolchain(new BaseTools(builder));
11 }
12
13 void BasePlugin::create_targets(SourcePackage &spkg) const
14 {
15         const Architecture &native_arch = builder.get_native_arch();
16
17         if(!spkg.get_exported_build_info().libs.empty() && native_arch.get_system()=="linux")
18         {
19                 PkgConfigFile *pc = new PkgConfigFile(builder, spkg);
20                 builder.get_build_graph().get_target("install")->add_dependency(*builder.get_toolchain().get_tool("CP").create_target(*pc));
21         }
22
23         new CompileCommandsJson(builder, spkg);
24 }
25
26
27 extern "C"
28 Plugin *create_plugin(Builder &builder)
29 {
30         return new BasePlugin(builder);
31 }