]> git.tdb.fi Git - builder.git/blobdiff - source/buildinfo.h
Remove most container typedefs and refactor others
[builder.git] / source / buildinfo.h
index 0af7374575e1a5979111ea12c999d99e8a288b45..f84315c74369b7b73f6f4e839ff0a8701193627f 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:
@@ -28,6 +35,7 @@ public:
        private:
                void incpath(const std::string &);
                void define(const std::string &, const std::string &);
+               void keep_symbol(const std::string &);
                void libmode_for_lib(const std::string &, LibraryMode);
                void libpath(const std::string &);
                void library(const std::string &);
@@ -43,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
@@ -54,7 +73,7 @@ public:
        class Tracked
        {
        public:
-               typedef T LoadType;
+               using LoadType = T;
 
        private:
                T value;
@@ -63,27 +82,24 @@ 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=(v) { value = v; set = true; return *this; }
-               operator T() const { return value; }
+               Tracked &operator=(const T &v) { value = v; set = true; return *this; }
+               operator const T &() const { return value; }
        };
 
-       typedef std::map<std::string, std::string> DefineMap;
-       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;
-
        Tracked<Msp::FS::Path> sysroot;
-       DefineMap defines;
-       PathList incpath;
-       PathList local_incpath;
-       PathList libpath;
-       WordList libs;
+       std::map<std::string, std::string> defines;
+       std::list<Msp::FS::Path> incpath;
+       std::list<Msp::FS::Path> local_incpath;
+       std::list<Msp::FS::Path> libpath;
+       std::list<std::string> libs;
        Tracked<LibraryMode> libmode;
-       LibModeMap libmodes;
-       StandardMap standards;
+       Tracked<RuntimePathMode> rpath_mode;
+       std::map<std::string, LibraryMode> libmodes;
+       std::list<std::string> keep_symbols;
+       std::map<std::string, LanguageStandard> standards;
        Tracked<bool> threads;
        Tracked<bool> debug;
        Tracked<int> optimize;