]> git.tdb.fi Git - builder.git/blob - source/importlibrary.cpp
Build and install import libraries on windows
[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 "sourcepackage.h"
6
7 using namespace std;
8 using namespace Msp;
9
10 ImportLibrary::ImportLibrary(Builder &b, const FS::Path &p):
11         FileTarget(b, p),
12         shared_lib(0)
13 { }
14
15 ImportLibrary::ImportLibrary(Builder &b, const Component &c, ExportDefinitions &exp):
16         FileTarget(b, c.get_package(), c.get_package().get_out_dir()/format("lib%s.dll.a", c.get_name())),
17         shared_lib(&exp.get_library())
18 {
19         component = &c;
20         add_dependency(exp);
21
22         install_location = "lib";
23
24         const string &version = component->get_package().get_interface_version();
25         if(!version.empty())
26                 install_filename = format("lib%s-%s.dll.a", c.get_name(), version);
27 }