summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--task_cc.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/task_cc.cc b/task_cc.cc
index a5fd9f0..366cbfe 100644
--- a/task_cc.cc
+++ b/task_cc.cc
@@ -93,13 +93,25 @@ TaskCC::TaskCC(const BuildConfiguration& config, const Settings& settings,
sourceFile = sourceDir;
sourceFile /= source;
- targetFile = settings.builddir / sourceFile.stem();
- targetFile += ".o";
+ std::filesystem::path base = settings.builddir;
+ base /= config.target;
+ base += "-";
+ base += sourceFile.stem();
- depsFile = settings.builddir / sourceFile.stem();
- depsFile += ".d";
+ if(sourceFile.extension().string() == ".c")
+ {
+ base += "_c";
+ }
+ else
+ {
+ base += "_cc";
+ }
- flagsFile = settings.builddir / sourceFile.stem();
+ targetFile = base;
+ targetFile += ".o";
+ depsFile = base;
+ depsFile += ".d";
+ flagsFile = base;
flagsFile += ".flags";
target_type = TargetType::Object;