]> git.tdb.fi Git - builder.git/blob - source/buildinfo.h
Support custom build info
[builder.git] / source / buildinfo.h
1 #ifndef BUILDINFO_H_
2 #define BUILDINFO_H_
3
4 #include <list>
5 #include <string>
6 #include <msp/parser/loader.h>
7
8 class BuildInfo
9 {
10 public:
11         class Loader: public Msp::Parser::Loader
12         {
13         public:
14                 Loader(BuildInfo &);
15         private:
16                 BuildInfo &binfo;
17                 
18                 void cflag(const std::string &s)   { binfo.cflags.push_back(s); }
19                 void incpath(const std::string &s) { binfo.incpath.push_back(s); }
20                 void define(const std::string &s)  { binfo.defines.push_back(s); }
21                 void ldflag(const std::string &s)  { binfo.ldflags.push_back(s); }
22                 void libpath(const std::string &s) { binfo.libpath.push_back(s); }
23                 void library(const std::string &s) { binfo.libs.push_back(s); }
24         };
25         
26         typedef std::list<std::string> InfoList;
27         
28         InfoList cflags;
29         InfoList defines;
30         InfoList incpath;
31         InfoList ldflags;
32         InfoList libpath;
33         InfoList libs;
34
35         void add(const BuildInfo &);
36         void unique();
37 private:
38         void unique(InfoList &);
39 };
40
41 #endif