X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildinfo.h;h=ccfa2b630bc9f47a03e471c846e8bc7e2e3c8838;hb=HEAD;hp=595fe1a55ccd5bb414ebbe5febec8f86431465b2;hpb=f76c063eb9b792088e034ffb4c2f173b843e8c57;p=builder.git diff --git a/source/buildinfo.h b/source/buildinfo.h deleted file mode 100644 index 595fe1a..0000000 --- a/source/buildinfo.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef BUILDINFO_H_ -#define BUILDINFO_H_ - -#include -#include -#include -#include - -/** -Stores information about compiler command line parameters in a more abstract -form. Allows combining with other BuildInfos to support package dependencies. -*/ -class BuildInfo -{ -public: - enum LibraryMode - { - FORCE_STATIC, //< Only accept static libraries - STATIC, //< Prefer static libraries but accept dynamic as well - DYNAMIC, //< Prefer dynamic libraries but accept static as well - FORCE_DYNAMIC //< Only accept dynamic libraries - }; - - class Loader: public Msp::DataFile::ObjectLoader - { - public: - Loader(BuildInfo &); - private: - void incpath(const std::string &); - void define(const std::string &, const std::string &); - void libpath(const std::string &); - void library(const std::string &); - }; - - enum UpdateLevel - { - LOCAL, //< Include all information - DEPENDENCY, //< Include all but code generation options - CHAINED //< Include only compilation options - }; - - /** - A wrapper which tracks the set status of the wrapped variable. A default - value may be provided in initialization without causing it to be treated as - set. Assigning from a raw value flags the Tracked object as set. Assigning - from another Tracked object will only change the value of the target if the - source is set. - */ - template - class Tracked - { - public: - typedef T LoadType; - - private: - T value; - bool set; - - public: - Tracked(): value(T()), set(false) { } - Tracked(T v): value(v), set(false) { } - Tracked &operator=(const Tracked &v) { if(v.set) { value = v.value; set = true; } return *this; } - - Tracked &operator=(T v) { value = v; set = true; return *this; } - operator T() const { return value; } - }; - - typedef std::map DefineMap; - typedef std::list PathList; - typedef std::list WordList; - - DefineMap defines; - PathList incpath; - PathList libpath; - WordList libs; - Tracked libmode; - Tracked threads; - Tracked debug; - Tracked optimize; - Tracked strip; - Tracked warning_level; - Tracked fatal_warnings; - - BuildInfo(); - - /** Updates the BuildInfo from another one. Lists are concatenated, with - the first occurrence of each item preserved. Scalars are overwritten. - - The update level determines what information is updated. */ - void update_from(const BuildInfo &, UpdateLevel = LOCAL); -}; - -#endif