]> git.tdb.fi Git - builder.git/commitdiff
Group most existing tools in sub-toolchains
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 15:38:57 +0000 (18:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 15:38:57 +0000 (18:38 +0300)
source/builder.cpp
source/builtintools.cpp [new file with mode: 0644]
source/builtintools.h [new file with mode: 0644]
source/gnutools.cpp [new file with mode: 0644]
source/gnutools.h [new file with mode: 0644]

index b73618f25ae637b36d5b1c96ffca2f55ccd4b0d2..cf49f41663e71b45d16dd16bc2a73d0ff5915449 100644 (file)
 #include <msp/time/utils.h>
 #include "binarypackage.h"
 #include "builder.h"
-#include "copy.h"
+#include "builtintools.h"
 #include "datatool.h"
-#include "gnuarchiver.h"
-#include "gnuccompiler.h"
-#include "gnucxxcompiler.h"
-#include "gnulinker.h"
+#include "gnutools.h"
 #include "installedfile.h"
-#include "mingwdlltool.h"
 #include "package.h"
-#include "pkgconfiggenerator.h"
 #include "sharedlibrary.h"
 #include "sourcepackage.h"
-#include "tar.h"
 #include "task.h"
 #include "virtualtarget.h"
 
@@ -81,15 +75,8 @@ void Builder::set_temp_directory(const FS::Path &p)
 
 void Builder::add_default_tools()
 {
-       toolchain.add_tool(new GnuCCompiler(*this, *current_arch));
-       toolchain.add_tool(new GnuCxxCompiler(*this, *current_arch));
-       toolchain.add_tool(new GnuLinker(*this, *current_arch));
-       toolchain.add_tool(new GnuArchiver(*this, *current_arch));
-       toolchain.add_tool(new Copy(*this));
-       toolchain.add_tool(new Tar(*this));
-       toolchain.add_tool(new PkgConfigGenerator(*this));
-       if(current_arch->get_system()=="windows")
-               toolchain.add_tool(new MingwDllTool(*this, *current_arch));
+       toolchain.add_toolchain(new GnuTools(*this, *current_arch));
+       toolchain.add_toolchain(new BuiltinTools(*this));
        toolchain.add_tool(new DataTool(*this));
 }
 
diff --git a/source/builtintools.cpp b/source/builtintools.cpp
new file mode 100644 (file)
index 0000000..db1d4f3
--- /dev/null
@@ -0,0 +1,11 @@
+#include "builtintools.h"
+#include "copy.h"
+#include "pkgconfiggenerator.h"
+#include "tar.h"
+
+BuiltinTools::BuiltinTools(Builder &builder)
+{
+       add_tool(new Copy(builder));
+       add_tool(new Tar(builder));
+       add_tool(new PkgConfigGenerator(builder));
+}
diff --git a/source/builtintools.h b/source/builtintools.h
new file mode 100644 (file)
index 0000000..e3b0256
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef BUILTINTOOLS_H_
+#define BUILTINTOOLS_H_
+
+#include "toolchain.h"
+
+class Builder;
+
+class BuiltinTools: public Toolchain
+{
+public:
+       BuiltinTools(Builder &);
+};
+
+#endif
diff --git a/source/gnutools.cpp b/source/gnutools.cpp
new file mode 100644 (file)
index 0000000..20463e6
--- /dev/null
@@ -0,0 +1,17 @@
+#include "architecture.h"
+#include "gnuarchiver.h"
+#include "gnuccompiler.h"
+#include "gnucxxcompiler.h"
+#include "gnulinker.h"
+#include "gnutools.h"
+#include "mingwdlltool.h"
+
+GnuTools::GnuTools(Builder &builder, const Architecture &arch)
+{
+       add_tool(new GnuCCompiler(builder, arch));
+       add_tool(new GnuCxxCompiler(builder, arch));
+       add_tool(new GnuLinker(builder, arch));
+       add_tool(new GnuArchiver(builder, arch));
+       if(arch.get_system()=="windows")
+               add_tool(new MingwDllTool(builder, arch));
+}
diff --git a/source/gnutools.h b/source/gnutools.h
new file mode 100644 (file)
index 0000000..98e2856
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef GNUTOOLS_H_
+#define GNUTOOLS_H_
+
+#include "toolchain.h"
+
+class Architecture;
+class Builder;
+
+class GnuTools: public Toolchain
+{
+public:
+       GnuTools(Builder &, const Architecture &);
+};
+
+#endif