]> git.tdb.fi Git - builder.git/blob - source/buildinfo.h
Replace per-file copyright notices with a single file
[builder.git] / source / buildinfo.h
1 #ifndef BUILDINFO_H_
2 #define BUILDINFO_H_
3
4 #include <list>
5 #include <string>
6 #include <msp/datafile/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::DataFile::Loader
17         {
18         private:
19                 BuildInfo &binfo;
20                 
21         public:
22                 Loader(BuildInfo &);
23         private:
24                 void cflag(const std::string &);
25                 void incpath(const std::string &);
26                 void define(const std::string &);
27                 void ldflag(const std::string &);
28                 void libpath(const std::string &);
29                 void library(const std::string &);
30                 void warning(const std::string &);
31         };
32         
33         StringList cflags;
34         StringList defines;
35         StringList incpath;
36         StringList ldflags;
37         StringList libpath;
38         StringList libs;
39         StringList warnings;
40
41         /** Adds another BuildInfo to the end of this one. */
42         void add(const BuildInfo &);
43
44         /** Makes sure there are no duplicate entries in the lists.  For warnings,
45         contradicting flags are eliminated and the last one stays in effect. */
46         void unique();
47 };
48
49 #endif