]> git.tdb.fi Git - builder.git/blob - source/buildinfo.h
Reorder class members
[builder.git] / source / buildinfo.h
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef BUILDINFO_H_
9 #define BUILDINFO_H_
10
11 #include <list>
12 #include <string>
13 #include <msp/datafile/loader.h>
14 #include "misc.h"
15
16 /**
17 Stores information about compiler command line parameters in a more abstract
18 form.  Allows combining with other BuildInfos to support package dependencies.
19 */
20 class BuildInfo
21 {
22 public:
23         class Loader: public Msp::DataFile::Loader
24         {
25         private:
26                 BuildInfo &binfo;
27                 
28         public:
29                 Loader(BuildInfo &);
30         private:
31                 void cflag(const std::string &);
32                 void incpath(const std::string &);
33                 void define(const std::string &);
34                 void ldflag(const std::string &);
35                 void libpath(const std::string &);
36                 void library(const std::string &);
37                 void warning(const std::string &);
38         };
39         
40         StringList cflags;
41         StringList defines;
42         StringList incpath;
43         StringList ldflags;
44         StringList libpath;
45         StringList libs;
46         StringList warnings;
47
48         /** Adds another BuildInfo to the end of this one. */
49         void add(const BuildInfo &);
50
51         /** Makes sure there are no duplicate entries in the lists.  For warnings,
52         contradicting flags are eliminated and the last one stays in effect. */
53         void unique();
54 };
55
56 #endif