]> git.tdb.fi Git - builder.git/blob - source/buildinfo.h
Add comments
[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 #include "misc.h"
8
9 /**
10 Stores information about compiler command line parameters in a more abstract
11 form.  Allows combining with other BuildInfos to support package dependencies.
12 */
13 class BuildInfo
14 {
15 public:
16         class Loader: public Msp::Parser::Loader
17         {
18         public:
19                 Loader(BuildInfo &);
20         private:
21                 BuildInfo &binfo;
22                 
23                 void cflag(const std::string &s)   { binfo.cflags.push_back(s); }
24                 void incpath(const std::string &s) { binfo.incpath.push_back(s); }
25                 void define(const std::string &s)  { binfo.defines.push_back(s); }
26                 void ldflag(const std::string &s)  { binfo.ldflags.push_back(s); }
27                 void libpath(const std::string &s) { binfo.libpath.push_back(s); }
28                 void library(const std::string &s) { binfo.libs.push_back(s); }
29         };
30         
31         StringList cflags;
32         StringList defines;
33         StringList incpath;
34         StringList ldflags;
35         StringList libpath;
36         StringList libs;
37
38         void add(const BuildInfo &);
39         void unique();
40 private:
41         void unique(StringList &);
42 };
43
44 #endif