summaryrefslogtreecommitdiff
path: root/src/task_ar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/task_ar.cc')
-rw-r--r--src/task_ar.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/task_ar.cc b/src/task_ar.cc
index d767912..84cda1b 100644
--- a/src/task_ar.cc
+++ b/src/task_ar.cc
@@ -30,13 +30,17 @@ std::string readFile(const std::string &fileName)
TaskAR::TaskAR(const BuildConfiguration& config,
const Settings& settings,
const std::string& target,
- const std::vector<std::string>& objects)
+ const std::vector<std::string>& objects,
+ const std::string& sourcePath)
: Task(config)
, config(config)
, settings(settings)
{
- targetFile = settings.builddir;
- targetFile /= target;
+ std::filesystem::path base = settings.builddir;
+ base /= sourcePath;
+ std::filesystem::create_directories(base);
+
+ targetFile = base / target;
for(const auto& object : objects)
{
std::filesystem::path objectFile = object;
@@ -51,7 +55,7 @@ TaskAR::TaskAR(const BuildConfiguration& config,
depFiles.push_back(depFile);
}
- flagsFile = settings.builddir / targetFile.stem();
+ flagsFile = base / targetFile.stem();
flagsFile += ".flags";
target_type = TargetType::StaticLibrary;
@@ -59,6 +63,7 @@ TaskAR::TaskAR(const BuildConfiguration& config,
for(const auto& source : config.sources)
{
std::filesystem::path sourceFile(source.file);
+ // TODO: Use task languages instead
if(sourceFile.extension().string() != ".c")
{
source_language = Language::Cpp;