]> git.tdb.fi Git - builder.git/commitdiff
Allow architecture specifications to be refined after creation
authorMikko Rasa <tdb@tdb.fi>
Mon, 26 Dec 2022 11:01:10 +0000 (13:01 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 26 Dec 2022 11:34:51 +0000 (13:34 +0200)
source/architecture.cpp
source/architecture.h

index 9662bbaa6f08e2dbcaeef2f9a75c9df77818b99d..5f8aea0d853f37759cf725cd25a88801eab3e486 100644 (file)
@@ -138,6 +138,17 @@ Architecture::Architecture(Builder &b, const string &spec):
                        toolchain = "gnu";
        }
 
+       update();
+}
+
+void Architecture::refine(const string &spec)
+{
+       parse_specification(spec);
+       update();
+}
+
+void Architecture::update()
+{
        name = type;
        if(!cpu.empty())
                name += format("-%s", cpu);
@@ -145,6 +156,7 @@ Architecture::Architecture(Builder &b, const string &spec):
                name += format("-%s", fpu);
        name += format("-%d-%s-%s", bits, system, toolchain);
 
+       filename_patterns.clear();
        if(system=="windows")
        {
                add_pattern<SharedLibrary>("%.dll");
index 4642080c59307ab897fabb76d22c81d26ea70aed..6a17c3e44852aeecfc0e7b6ae9a2fd24e748dabc 100644 (file)
@@ -37,6 +37,11 @@ private:
 public:
        Architecture(Builder &b, const std::string &spec);
 
+       void refine(const std::string &);
+private:
+       void update();
+
+public:
        const std::string &get_type() const { return type; }
        const std::string &get_name() const { return name; }
        const std::string &get_system() const { return system; }