]> git.tdb.fi Git - builder.git/blobdiff - source/csourcefile.cpp
Refactor logger to do message formatting internally
[builder.git] / source / csourcefile.cpp
index 41dbd437cc836b75697342381f590b1c09f89fc4..6429d4fe287504948480bd2e740f02c392a46c36 100644 (file)
@@ -47,7 +47,7 @@ void CSourceFile::find_dependencies()
        {
                IO::BufferedFile in(path.str());
 
-               builder.get_logger().log("files", format("Reading includes from %s", path.str()));
+               builder.get_logger().log("files", "Reading includes from %s", path.str());
 
                parse_includes(in);
                cache.set_values(this, "includes", includes);
@@ -55,9 +55,11 @@ void CSourceFile::find_dependencies()
 
        const BuildInfo &build_info = component->get_build_info_for_path(path);
        const auto &incpath = build_info.incpath;
-       VirtualFileSystem::SearchPath local_incpath = incpath;
-       local_incpath.insert(local_incpath.begin(), build_info.local_incpath.begin(), build_info.local_incpath.end());
-       local_incpath.push_front(FS::dirname(path).str());
+       VirtualFileSystem::SearchPath local_incpath;
+       local_incpath.reserve(1+build_info.local_incpath.size()+incpath.size());
+       local_incpath.push_back(FS::dirname(path).str());
+       local_incpath.insert(local_incpath.end(), build_info.local_incpath.begin(), build_info.local_incpath.end());
+       local_incpath.insert(local_incpath.end(), incpath.begin(), incpath.end());
 
        Tool *compiler = builder.get_toolchain().get_tool_for_suffix(FS::extpart(FS::basename(path)), true);
        if(compiler)