From 84e224e6839afcb3971938dee91e63ade279f2bb Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 27 Dec 2022 18:11:11 +0200 Subject: [PATCH] Add a customized linker tool to ClangTools Also remove the GnuArchiver from it, beacuse the GNU and clang toolchains can now be active at the same time. --- source/clanglinker.cpp | 7 +++++++ source/clanglinker.h | 12 ++++++++++++ source/clangtools.cpp | 8 +++----- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 source/clanglinker.cpp create mode 100644 source/clanglinker.h diff --git a/source/clanglinker.cpp b/source/clanglinker.cpp new file mode 100644 index 0000000..9d39979 --- /dev/null +++ b/source/clanglinker.cpp @@ -0,0 +1,7 @@ +#include "clanglinker.h" + +ClangLinker::ClangLinker(Builder &b, const Architecture &a): + CustomizedTool(b, "LINK", a) +{ + set_command("clang", true); +} diff --git a/source/clanglinker.h b/source/clanglinker.h new file mode 100644 index 0000000..fd7e264 --- /dev/null +++ b/source/clanglinker.h @@ -0,0 +1,12 @@ +#ifndef CLANGLINKER_H_ +#define CLANGLINKER_H_ + +#include "customizedtool.h" + +class ClangLinker: public CustomizedTool +{ +public: + ClangLinker(Builder &, const Architecture &); +}; + +#endif diff --git a/source/clangtools.cpp b/source/clangtools.cpp index 80968a7..8e8973d 100644 --- a/source/clangtools.cpp +++ b/source/clangtools.cpp @@ -1,8 +1,7 @@ -#include "builder.h" +#include "architecture.h" #include "clangcompiler.h" +#include "clanglinker.h" #include "clangtools.h" -#include "gnuarchiver.h" -#include "gnulinker.h" using namespace std; @@ -13,8 +12,7 @@ ClangTools::ClangTools(Builder &builder, const Architecture &arch): add_tool(new ClangCompiler(builder, arch, "CXX")); add_tool(new ClangCompiler(builder, arch, "OBJC")); - add_tool(new GnuLinker(builder, arch)); - add_tool(new GnuArchiver(builder, arch)); + add_tool(new ClangLinker(builder, arch)); } int ClangTools::get_priority(const Architecture &arch) -- 2.45.2