]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.cpp
Refactor arch handling a bit
[builder.git] / source / architecture.cpp
index 50013e88de7adc955dbb37b10f0ac381edbf65a9..1f578af409f72ce367f5fb09ee0fa968e5020976 100644 (file)
@@ -11,9 +11,10 @@ Distributed under the LGPL
 using namespace std;
 using namespace Msp;
 
-Architecture::Architecture(Builder &b, const string &n):
+Architecture::Architecture(Builder &b, const string &n, bool a):
        builder(b),
-       name(n)
+       name(n),
+       native(a)
 { }
 
 void Architecture::set_tool(const string &t, const string &p)
@@ -32,10 +33,10 @@ std::string Architecture::get_tool(const string &t) const
                        return i->second;
        }
 
-       if(name!="native")
+       if(!native)
        {
-               const Architecture &native=builder.get_architecture("native");
-               return prefix+"-"+native.get_tool(t);
+               const Architecture &native_arch=builder.get_native_arch();
+               return prefix+"-"+native_arch.get_tool(t);
        }
        else
                throw KeyError("Unknown tool");