]> git.tdb.fi Git - builder.git/blobdiff - source/buildinfo.h
More sophisticated handling of language standards
[builder.git] / source / buildinfo.h
index 5528748fc55c82bfde6b14d09e3ca9bc3313e3bc..c0584002233512392849dd7a6097de40bc02f1a6 100644 (file)
@@ -21,6 +21,13 @@ public:
                FORCE_DYNAMIC  //< Only accept dynamic libraries
        };
 
+       enum RuntimePathMode
+       {
+               NO_RPATH,  //< Do not record rpath in binaries
+               RELATIVE,  //< Record relative rpath in binaries
+               ABSOLUTE   //< Record absolute rpath in binaries
+       };
+
        class Loader: public Msp::DataFile::ObjectLoader<BuildInfo>
        {
        public:
@@ -44,6 +51,17 @@ public:
                CHAINED      //< Include only compilation options
        };
 
+       struct LanguageStandard
+       {
+               std::string type;
+               unsigned year;
+
+               LanguageStandard(): year(0) { }
+               LanguageStandard(const std::string &);
+
+               std::string str() const;
+       };
+
        /**
        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
@@ -64,6 +82,7 @@ public:
        public:
                Tracked(): value(T()), set(false) { }
                Tracked(T v): value(v), set(false) { }
+               Tracked(const Tracked &t): value(t.value), set(t.set) { }
                Tracked &operator=(const Tracked &v) { if(v.set) { value = v.value; set = true; } return *this; }
 
                Tracked &operator=(const T &v) { value = v; set = true; return *this; }
@@ -74,7 +93,7 @@ public:
        typedef std::list<Msp::FS::Path> PathList;
        typedef std::list<std::string> WordList;
        typedef std::map<std::string, LibraryMode> LibModeMap;
-       typedef std::map<std::string, std::string> StandardMap;
+       typedef std::map<std::string, LanguageStandard> StandardMap;
 
        Tracked<Msp::FS::Path> sysroot;
        DefineMap defines;
@@ -83,6 +102,7 @@ public:
        PathList libpath;
        WordList libs;
        Tracked<LibraryMode> libmode;
+       Tracked<RuntimePathMode> rpath_mode;
        LibModeMap libmodes;
        WordList keep_symbols;
        StandardMap standards;