summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-01-21 12:50:43 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2023-01-21 12:50:43 +0100
commite4ccfe780f52cdb6c0764074effcd60235d33762 (patch)
treecf23adbd17d9bada3fa470a84c541acf84f56737
parentabaf47c7b8fec08803d7b2deab3a4f13c2dfcb29 (diff)
Make sure to create target directories as they appear in their actual (cleaned) form.
-rw-r--r--src/task_ar.cc4
-rw-r--r--src/task_cc.cc3
-rw-r--r--src/task_ld.cc4
-rw-r--r--src/task_so.cc3
4 files changed, 8 insertions, 6 deletions
diff --git a/src/task_ar.cc b/src/task_ar.cc
index 9cd78d0..60f7dd1 100644
--- a/src/task_ar.cc
+++ b/src/task_ar.cc
@@ -21,8 +21,6 @@ TaskAR::TaskAR(const ctor::build_configuration& config,
, settings(settings)
, sourceDir(sourceDir)
{
- std::filesystem::create_directories(std::filesystem::path(settings.builddir) / sourceDir);
-
target_type = ctor::target_type::static_library;
_targetFile = target;
auto toolchain = getToolChain(config.system);
@@ -52,6 +50,8 @@ TaskAR::TaskAR(const ctor::build_configuration& config,
source_language = ctor::language::cpp;
}
}
+
+ std::filesystem::create_directories(targetFile().parent_path());
}
bool TaskAR::dirtyInner()
diff --git a/src/task_cc.cc b/src/task_cc.cc
index 2238b67..5c4adfb 100644
--- a/src/task_cc.cc
+++ b/src/task_cc.cc
@@ -24,7 +24,6 @@ TaskCC::TaskCC(const ctor::build_configuration& config, const ctor::settings& se
sourceFile /= source.file;
std::filesystem::path base = sourceFile.parent_path();
- std::filesystem::create_directories(std::filesystem::path(settings.builddir) / base);
base /= cleanUp(config.target);
base += "-";
@@ -68,6 +67,8 @@ TaskCC::TaskCC(const ctor::build_configuration& config, const ctor::settings& se
depsFile += ".d";
flagsFile = targetFile().parent_path() / targetFile().stem();
flagsFile += ".flags";
+
+ std::filesystem::create_directories(targetFile().parent_path());
}
int TaskCC::registerDepTasksInner(const std::set<std::shared_ptr<Task>>& tasks)
diff --git a/src/task_ld.cc b/src/task_ld.cc
index a98ef44..b7e8749 100644
--- a/src/task_ld.cc
+++ b/src/task_ld.cc
@@ -27,8 +27,6 @@ TaskLD::TaskLD(const ctor::build_configuration& config,
target_type = ctor::target_type::executable;
}
- std::filesystem::create_directories(std::filesystem::path(settings.builddir) / sourceDir);
-
_targetFile = target;
auto toolchain = getToolChain(config.system);
_targetFile = extension(toolchain, target_type, config.system, _targetFile);
@@ -56,6 +54,8 @@ TaskLD::TaskLD(const ctor::build_configuration& config,
source_language = ctor::language::cpp;
}
}
+
+ std::filesystem::create_directories(targetFile().parent_path());
}
bool TaskLD::dirtyInner()
diff --git a/src/task_so.cc b/src/task_so.cc
index e99205d..54f9c05 100644
--- a/src/task_so.cc
+++ b/src/task_so.cc
@@ -22,7 +22,6 @@ TaskSO::TaskSO(const ctor::build_configuration& config,
, sourceDir(sourceDir)
{
std::filesystem::path base = sourceDir;
- std::filesystem::create_directories(std::filesystem::path(settings.builddir) / base);
target_type = ctor::target_type::dynamic_library;
_targetFile = base / target;
@@ -53,6 +52,8 @@ TaskSO::TaskSO(const ctor::build_configuration& config,
source_language = ctor::language::cpp;
}
}
+
+ std::filesystem::create_directories(targetFile().parent_path());
}
bool TaskSO::dirtyInner()