updated build system
This commit is contained in:
@@ -29,19 +29,16 @@ static std::vector<std::unique_ptr<repertory::utils::file::i_fs_item>>
|
||||
|
||||
static void delete_generated_files() {
|
||||
repertory::recur_mutex_lock lock{file_mtx};
|
||||
std::optional<std::string> parent_path;
|
||||
std::map<std::string, bool> parent_paths;
|
||||
for (auto &&path : generated_files) {
|
||||
if (parent_path->empty()) {
|
||||
parent_path = repertory::utils::path::get_parent_path(path->get_path());
|
||||
}
|
||||
|
||||
[[maybe_unused]] auto removed = path->remove();
|
||||
parent_paths[repertory::utils::path::get_parent_path(path->get_path())] =
|
||||
true;
|
||||
}
|
||||
generated_files.clear();
|
||||
|
||||
if (parent_path.has_value()) {
|
||||
for (auto &&entry : parent_paths) {
|
||||
EXPECT_TRUE(
|
||||
repertory::utils::file::directory(*parent_path).remove_recursively());
|
||||
repertory::utils::file::directory(entry.first).remove_recursively());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +46,9 @@ struct file_deleter final {
|
||||
~file_deleter() { delete_generated_files(); }
|
||||
};
|
||||
|
||||
static auto deleter{std::make_unique<file_deleter>()};
|
||||
static auto deleter{
|
||||
std::make_unique<file_deleter>(),
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace repertory::test {
|
||||
|
||||
Reference in New Issue
Block a user