#include <msp/builder/component.h>
#include <msp/builder/executable.h>
#include <msp/builder/importlibrary.h>
+#include <msp/builder/installedfile.h>
#include <msp/builder/objectfile.h>
#include <msp/builder/sharedlibrary.h>
#include <msp/builder/sourcepackage.h>
const Component &comp = *objs.front()->get_component();
Binary *bin = 0;
if(arg=="shared")
- bin = new SharedLibrary(builder, comp, objs);
+ {
+ SharedLibrary *shlib = new SharedLibrary(builder, comp, objs);
+ bin = shlib;
+ ImportLibrary *imp = new ImportLibrary(builder, comp, *shlib);
+ for(ObjectFile *o: objs)
+ imp->add_dependency(*o);
+ imp->set_tool(*this);
+ shlib->add_side_effect(*imp);
+ }
else
bin = new Executable(builder, comp, objs);
bin->set_tool(*this);
return bin;
}
+Target *MsvcLinker::create_install(Target &target) const
+{
+ if(SharedLibrary *shlib = dynamic_cast<SharedLibrary *>(&target))
+ {
+ Tool © = builder.get_toolchain().get_tool("CP");
+ InstalledFile *inst_tgt = dynamic_cast<InstalledFile *>(copy.create_target(target));
+ builder.get_build_graph().add_installed_target(*shlib->get_import_library());
+ return inst_tgt;
+ }
+ else
+ return 0;
+}
+
string MsvcLinker::create_build_signature(const BuildInfo &binfo) const
{
string result = Tool::create_build_signature(binfo);
MsvcLinker(Builder &, const Architecture &, const MicrosoftTools &);
Target *create_target(const std::vector<Target *> &, const std::string &) override;
+ Target *create_install(Target &) const override;
std::string create_build_signature(const BuildInfo &) const override;
protected: