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