]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / architecture.h
diff --git a/source/architecture.h b/source/architecture.h
deleted file mode 100644 (file)
index 7f3c4b2..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef ARCHITECTURE_H_
-#define ARCHITECTURE_H_
-
-#include <typeinfo>
-#include <msp/datafile/loader.h>
-#include "buildinfo.h"
-#include "pattern.h"
-
-class Builder;
-
-/**
-Stores information about an architecture.  This includes CPU type, model and
-bitness and operating system.
-*/
-class Architecture
-{
-public:
-       class Loader: public Msp::DataFile::ObjectLoader<Architecture>
-       {
-       public:
-               Loader(Architecture &);
-       };
-
-private:
-       Builder &builder;
-       std::string type;
-       std::string cpu;
-       std::string fpu;
-       std::string system;
-       unsigned bits;
-       std::string toolchain;
-       std::string name;
-       bool native;
-       std::string cross_prefix;
-       std::map<std::string, std::list<Pattern>> filename_patterns;
-
-public:
-       Architecture(Builder &b, const std::string &spec);
-
-       const std::string &get_type() const { return type; }
-       const std::string &get_name() const { return name; }
-       const std::string &get_system() const { return system; }
-       unsigned get_bits() const { return bits; }
-       const std::string &get_cpu() const { return cpu; }
-       const std::string &get_fpu() const { return fpu; }
-       const std::string &get_toolchain() const { return toolchain; }
-       bool match_name(const std::string &) const;
-       std::string best_match(const std::vector<std::string> &) const;
-       bool is_native() const { return native; }
-       bool is_cross() const { return !cross_prefix.empty(); }
-
-       const std::string &get_cross_prefix() const { return cross_prefix; }
-
-       template<typename T>
-       const std::list<Pattern> &get_patterns() const;
-
-       template<typename T>
-       std::string create_filename(const std::string &) const;
-
-private:
-       template<typename T>
-       void add_pattern(const std::string &);
-
-private:
-       static void resolve_aliases(std::vector<std::string> &);
-       void parse_specification(const std::string &);
-};
-
-template<typename T>
-inline const std::list<Pattern> &Architecture::get_patterns() const
-{
-       auto i = filename_patterns.find(typeid(T).name());
-       if(i!=filename_patterns.end())
-               return i->second;
-
-       static std::list<Pattern> empty;
-       return empty;
-}
-
-template<typename T>
-inline std::string Architecture::create_filename(const std::string &base) const
-{
-       const std::list<Pattern> &patterns = get_patterns<T>();
-       return patterns.empty() ? base : patterns.front().apply(base);
-}
-
-#endif