summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libctor.h6
-rw-r--r--src/task_cc.cc11
2 files changed, 15 insertions, 2 deletions
diff --git a/src/libctor.h b/src/libctor.h
index f80a5c5..b539910 100644
--- a/src/libctor.h
+++ b/src/libctor.h
@@ -44,8 +44,14 @@ struct Source
Source(const char* file, Language lang) : file(file), language(lang) {}
Source(const std::string& file, Language lang) : file(file), language(lang) {}
+ Source(const char* file, const char* output) : file(file), output(output) {}
+ Source(const std::string& file, const std::string& output) : file(file), output(output) {}
+ Source(const char* file, Language lang, const char* output) : file(file), language(lang), output(output) {}
+ Source(const std::string& file, Language lang, const std::string& output) : file(file), language(lang), output(output) {}
+
std::string file;
Language language{Language::Auto};
+ std::string output{};
};
struct Flags
diff --git a/src/task_cc.cc b/src/task_cc.cc
index 673c16d..ee25abf 100644
--- a/src/task_cc.cc
+++ b/src/task_cc.cc
@@ -51,8 +51,15 @@ TaskCC::TaskCC(const BuildConfiguration& config, const Settings& settings,
break;
}
- _targetFile = base;
- _targetFile += ".o";
+ if(source.output.empty())
+ {
+ _targetFile = base;
+ _targetFile += ".o";
+ }
+ else
+ {
+ _targetFile = source.output;
+ }
depsFile = targetFile().parent_path() / targetFile().stem();
depsFile += ".d";
flagsFile = targetFile().parent_path() / targetFile().stem();