]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.cpp
Allow architecture specifications to be refined after creation
[builder.git] / source / architecture.cpp
index 48c6a204b17fc43220086ca207c68817739c9179..5f8aea0d853f37759cf725cd25a88801eab3e486 100644 (file)
@@ -96,9 +96,7 @@ const char *aliases[] =
 }
 
 Architecture::Architecture(Builder &b, const string &spec):
-       builder(b),
-       bits(0),
-       native(false)
+       builder(b)
 {
        if(spec.empty())
        {
@@ -140,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);
@@ -147,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");