X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildinfo.h;h=203ba5fe5bfbc844373f82b5d89c3ed02a16d725;hb=aa053d637e8259755af7d2e4b510a242f4d29c7b;hp=595fe1a55ccd5bb414ebbe5febec8f86431465b2;hpb=f76c063eb9b792088e034ffb4c2f173b843e8c57;p=builder.git diff --git a/source/buildinfo.h b/source/buildinfo.h index 595fe1a..203ba5f 100644 --- a/source/buildinfo.h +++ b/source/buildinfo.h @@ -1,8 +1,8 @@ #ifndef BUILDINFO_H_ #define BUILDINFO_H_ -#include #include +#include #include #include @@ -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 { public: @@ -28,8 +35,13 @@ 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 &); + void local_incpath(const std::string &); + void standard(Msp::DataFile::Symbol, const std::string &); + void sysroot(const std::string &); }; enum UpdateLevel @@ -39,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 @@ -50,7 +73,7 @@ public: class Tracked { public: - typedef T LoadType; + using LoadType = T; private: T value; @@ -59,21 +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=(T 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 DefineMap; - typedef std::list PathList; - typedef std::list WordList; - - DefineMap defines; - PathList incpath; - PathList libpath; - WordList libs; + Tracked sysroot; + std::map defines; + std::vector incpath; + std::vector local_incpath; + std::vector libpath; + std::vector libs; Tracked libmode; + Tracked rpath_mode; + std::map libmodes; + std::vector keep_symbols; + std::map standards; Tracked threads; Tracked debug; Tracked optimize; @@ -83,6 +109,11 @@ public: BuildInfo(); + /** Returns the library mode for linking a particular library. If no mode + has been specified for that library, the the global library mode is + returned. */ + LibraryMode get_libmode_for(const std::string &) const; + /** Updates the BuildInfo from another one. Lists are concatenated, with the first occurrence of each item preserved. Scalars are overwritten.