]> git.tdb.fi Git - builder.git/blobdiff - source/clanglinker.cpp
Add gcc's private library directory to ClangLinker's system path
[builder.git] / source / clanglinker.cpp
index 9d39979835fe5c7c1a5eb01b1804a38cbf16700c..508902804af2d58a8b89c29edf40ce0474745bdb 100644 (file)
@@ -1,7 +1,24 @@
+#include <msp/fs/stat.h>
+#include "builder.h"
 #include "clanglinker.h"
 
+using namespace Msp;
+
 ClangLinker::ClangLinker(Builder &b, const Architecture &a):
        CustomizedTool(b, "LINK", a)
 {
        set_command("clang", true);
 }
+
+void ClangLinker::do_prepare(ToolData &tool) const
+{
+       parent.prepare();
+       CustomizedTool::do_prepare(tool);
+       for(const FS::Path &p: parent.get_system_path())
+               if(FS::exists(p/"libstdc++.so"))
+               {
+                       builder.get_logger().log("tools", "Got %s gcc system path: %s", static_cast<const Tool &>(tool).get_tag(), p);
+                       tool.system_path.push_back(p);
+                       break;
+               }
+}