]> git.tdb.fi Git - builder.git/blob - source/importlibrary.cpp
1e6650fdac1ee648ebae4fbf642ef2cf498a1c6e
[builder.git] / source / importlibrary.cpp
1 #include <msp/strings/format.h>
2 #include "component.h"
3 #include "exportdefinitions.h"
4 #include "importlibrary.h"
5 #include "sharedlibrary.h"
6 #include "sourcepackage.h"
7
8 using namespace std;
9 using namespace Msp;
10
11 ImportLibrary::ImportLibrary(Builder &b, const FS::Path &p):
12         FileTarget(b, p),
13         shared_lib(0)
14 { }
15
16 ImportLibrary::ImportLibrary(Builder &b, const Component &c, SharedLibrary &sl, ExportDefinitions &exp):
17         FileTarget(b, c.get_package(), c.get_package().get_output_directory()/format("lib%s.dll.a", sl.get_libname())),
18         shared_lib(&sl)
19 {
20         component = &c;
21         add_dependency(exp);
22         shared_lib->set_import_library(this);
23
24         install_location = "lib";
25
26         const string &version = component->get_package().get_interface_version();
27         if(!version.empty())
28                 install_filename = format("lib%s-%s.dll.a", sl.get_libname(), version);
29 }