]> git.tdb.fi Git - builder.git/blob - source/buildinfo.h
Make warnings configurable through build_info and command line
[builder.git] / source / buildinfo.h
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2007 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         public:
26                 Loader(BuildInfo &);
27         private:
28                 BuildInfo &binfo;
29                 
30                 void cflag(const std::string &s)   { binfo.cflags.push_back(s); }
31                 void incpath(const std::string &s) { binfo.incpath.push_back(s); }
32                 void define(const std::string &s)  { binfo.defines.push_back(s); }
33                 void ldflag(const std::string &s)  { binfo.ldflags.push_back(s); }
34                 void libpath(const std::string &s) { binfo.libpath.push_back(s); }
35                 void library(const std::string &s) { binfo.libs.push_back(s); }
36                 void warning(const std::string &s) { binfo.warnings.push_back(s); }
37         };
38         
39         StringList cflags;
40         StringList defines;
41         StringList incpath;
42         StringList ldflags;
43         StringList libpath;
44         StringList libs;
45         StringList warnings;
46
47         void add(const BuildInfo &);
48         void unique();
49 private:
50         void unique(StringList &);
51 };
52
53 #endif