summaryrefslogtreecommitdiff
path: root/src/task_cc.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-12-23 12:14:46 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-12-28 15:39:26 +0100
commit15e2bd35a8da320f074942e814885f3d6eaf0706 (patch)
treef74b1067dbde357532d8e38871e6b8cb76ea6da9 /src/task_cc.cc
parent78c5477b3989d67169de2d05665adfb801caab23 (diff)
Diffstat (limited to 'src/task_cc.cc')
-rw-r--r--src/task_cc.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/task_cc.cc b/src/task_cc.cc
index e1f3023..f2cd34f 100644
--- a/src/task_cc.cc
+++ b/src/task_cc.cc
@@ -12,6 +12,7 @@
#include "execute.h"
#include "util.h"
#include "tools.h"
+#include "deps.h"
TaskCC::TaskCC(const ctor::build_configuration& config_, const ctor::settings& settings_,
const std::string& sourceDir_, const ctor::source& source)
@@ -136,7 +137,8 @@ bool TaskCC::dirtyInner()
}
}
- auto depList = readDeps(depsFile.string());
+ auto toolchain = getToolChain(config.system);
+ auto depList = readDeps(depsFile.string(), toolchain);
for(const auto& dep : depList)
{
if(!std::filesystem::exists(dep) ||
@@ -173,24 +175,25 @@ int TaskCC::runInner()
flagsStream << flagsString();
}
+ std::string output;
if(settings.verbose == 0)
{
switch(sourceLanguage())
{
case ctor::language::c:
- std::cout << "CC ";
+ output += "CC ";
break;
case ctor::language::cpp:
- std::cout << "CXX ";
+ output += "CXX ";
break;
case ctor::language::automatic:
case ctor::language::assembler:
// Only c/c++ handled by this task type.
break;
}
- std::cout <<
- sourceFile.lexically_normal().string() << " => " <<
- targetFile().lexically_normal().string() << std::endl;
+ output += sourceFile.lexically_normal().string() + " => " +
+ targetFile().lexically_normal().string() + '\n';
+ std::cout << output << std::flush;
}
const auto& cfg = ctor::get_configuration();
@@ -275,18 +278,21 @@ std::vector<std::string> TaskCC::flags() const
{
append(flags, to_strings(toolchain, flag));
}
+ append(flags, to_strings(toolchain, {ctor::toolchain::msvc, ctor::c_opt::custom, "/nologo"}));
return flags;
case ctor::language::cpp:
for(const auto& flag : config.flags.cxxflags)
{
append(flags, to_strings(toolchain, flag));
}
+ append(flags, to_strings(toolchain, {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/nologo"}));
return flags;
default:
std::cerr << "Unknown CC target type\n";
exit(1);
break;
}
+
}
std::string TaskCC::flagsString() const
@@ -310,7 +316,7 @@ std::vector<std::string> TaskCC::getCompilerArgs() const
{
case ctor::language::c:
{
- append(args, c_option(toolchain, ctor::c_opt::generate_dep_tree));
+ append(args, c_option(toolchain, ctor::c_opt::generate_dep_tree, depsFile.string()));
if(std::filesystem::path(config.target).extension() == ".so")
{
@@ -352,7 +358,7 @@ std::vector<std::string> TaskCC::getCompilerArgs() const
case ctor::language::cpp:
{
- append(args, cxx_option(toolchain, ctor::cxx_opt::generate_dep_tree));
+ append(args, cxx_option(toolchain, ctor::cxx_opt::generate_dep_tree, depsFile.string()));
if(std::filesystem::path(config.target).extension() == ".so")
{